Skip to content

Commit 87aa191

Browse files
added first test guide (#90)
1 parent 90615a1 commit 87aa191

File tree

13 files changed

+80
-22
lines changed

13 files changed

+80
-22
lines changed

docs/Formatters/_category_.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"label": "Formatters",
3-
"position": 4,
3+
"position": 50,
44
"link": {
55
"type": "generated-index",
66
"description": "Built-in formatters"

docs/Formatters/xray-formatter.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ export default {
4444
}
4545
```
4646

47-
### How it works?
47+
## How it works?
4848
Plugin reads all tags in jira key format (@ABCD-123) and update corresponding scenarios in provided test execution
4949

50-
### F.A.Q
50+
## F.A.Q
5151
- Does it work with Jira Server?
5252

5353
Yes

docs/Guides/_category_.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"label": "Guides",
3-
"position": 5,
3+
"position": 60,
44
"link": {
55
"type": "generated-index",
66
"description": "Guides"

docs/Modules/_category_.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"label": "Modules",
3-
"position": 3,
3+
"position": 40,
44
"link": {
55
"type": "generated-index",
66
"description": "Built-in modules"

docs/StandaloneSolutions/_category_.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"label": "Standalone Solutions",
3-
"position": 5,
3+
"position": 65,
44
"link": {
55
"type": "generated-index",
66
"description": "Standalone Solutions"

docs/Steps-v1/_category_.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"label": "Steps v1",
3-
"position": 2,
3+
"position": 30,
44
"link": {
55
"type": "generated-index",
66
"description": "Steps v1"

docs/Steps/_category_.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"label": "Steps v2",
3-
"position": 2,
3+
"position": 20,
44
"link": {
55
"type": "generated-index",
66
"description": "Steps v1"

docs/Steps/playwright-v2.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ npm install @qavajs/steps-playwright@2
1515
## Configuration
1616
Playwright steps provide a couple of additional configuration properties
1717

18-
| Name | Type | Description | Default |
19-
|--------------|----------|---------------------------------------------------------------------------------|---------------|
20-
| `browser` | `object` | object describing playwright config | `{}` |
21-
| `pageObject` | `object` | instance of page object definitions [(page object)](../Guides/page-object-v1.mdx) | `constructor` |
18+
| Name | Type | Description | Default |
19+
|--------------|----------|------------------------------------------------------------------------------------|---------|
20+
| `browser` | `object` | object describing playwright config | `{}` |
21+
| `pageObject` | `object` | instance of page object definitions [(page object)](../Guides/page-object-v2.mdx) | `{}` |
2222

2323
```typescript
2424
import App from './page_object';

docs/Steps/wdio-v2.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ npm install @qavajs/steps-wdio
1414
## Configuration
1515
wdio steps provide additional configuration properties
1616

17-
| Name | Type | Description | Default |
18-
|--------------|----------|---------------------------------------------------------------------------------|---------------|
19-
| `browser` | `object` | object describing wdio config | `{}` |
20-
| `pageObject` | `object` | instance of page object definitions [(page object)](../Guides/page-object-v1.mdx) | `constructor` |
17+
| Name | Type | Description | Default |
18+
|--------------|----------|------------------------------------------------------------------------------------|---------|
19+
| `browser` | `object` | object describing wdio config | `{}` |
20+
| `pageObject` | `object` | instance of page object definitions [(page object)](../Guides/page-object-v2.mdx) | `{}` |
2121

2222
```typescript
2323
import App from './page_object';

docs/intro.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@
22
sidebar_position: 1
33
---
44

5-
# 💡 Getting Started
5+
# Getting Started
66

77
The **qavajs** is a modular test automation framework designed to minimize setup time and streamline the development of test scripts. It incorporates the best test automation tools and practices into a single whole. The framework achieves efficiency through its built-in page object engine and ready-to-use sets of domain-agnostic step definitions suitable for both API and UI testing of the web and native mobile applications. Additionally, **qavajs** provides out of the box integration with ReportPortal, Mobitru, and the Xray and many more.
88

99
Next, you will be shown how to build your own low-code test automation framework with the **qavajs**.
1010

1111
### 📦 Installation from scratch
12-
Once you have set up a clear Node.js project, run the command `npm init @qavajs` to launch the CLI application. This will configure qavajs and install the necessary modules for your testing purposes. After the process is completed, a config.ts (or config.js) file will be generated in the project's root directory, which will be used to configure test execution.
12+
Once you have set up a clear Node.js project, run the command
13+
```bash
14+
npm init @qavajs
15+
```
16+
to launch the CLI application. This will configure qavajs and install the necessary modules for your testing purposes. After the process is completed, a config.ts (or config.js) file will be generated in the project's root directory, which will be used to configure test execution.
1317

1418
### 👨‍💻 Test development
1519
As the **qavajs** based on the Cucumber the test scripts are written in [Gherkin](https://cucumber.io/docs/gherkin/reference/) language of both built-in steps and those you will create yourself.
@@ -23,8 +27,8 @@ Feature: Wikipedia
2327
When I type '<term>' to 'Wikipedia > Search Input'
2428
And I click 'Wikipedia > Search Button'
2529
And I expect text of 'Wikipedia Article > Title' equals '<term>'
26-
And I wait until text of 'Wikipedia Article > Title' not to contain 'Python'
27-
And I wait until 'Wikipedia Article > Title' to be visible
30+
And I expect text of 'Wikipedia Article > Title' not to contain 'Python'
31+
And I expect 'Wikipedia Article > Title' to be visible
2832
And I expect 'Wikipedia Article > Title' to be visible
2933
3034
Examples:

docs/qna.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 20
2+
sidebar_position: 70
33
---
44

55
# FAQ

docs/v2.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 1
2+
sidebar_position: 3
33
---
44

55
# What's new in v2

docs/writing-tests.md

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
sidebar_position: 2
3+
---
4+
5+
# Writing tests
6+
7+
**qavajs** test cases are user-friendly and leverage the Gherkin language, providing a variety of predefined steps for performing actions and assertions.
8+
9+
## First test
10+
Let's walk through an example to demonstrate how to write a test.
11+
12+
features/wikipedia.feature
13+
```gherkin
14+
Feature: Wikipedia
15+
16+
Scenario: Search in wikipedia
17+
Given I open '$wikipedia' url
18+
When I type 'JavaScript' to 'Search Input'
19+
And I click 'Search Button'
20+
And I expect text of 'Title' equals 'JavaScript'
21+
```
22+
23+
In this scenario:
24+
25+
- `Search Input`, `Search Button`, and `Title` are aliases for corresponding [(page objects)](./Guides/page-object-v2.mdx).
26+
- `$wikipedia` is an alias for a [(constant)](./Guides/memory.md) URL.
27+
28+
## Page Objects
29+
Define the page objects in the page_object folder:
30+
31+
page_object/index.ts
32+
```typescript
33+
import { locator } from '@qavajs/steps-playwright/po';
34+
35+
export class App {
36+
SearchInput = locator('#searchInput');
37+
SearchButton = locator('button[type=submit]');
38+
Title = locator('#firstHeading');
39+
}
40+
```
41+
42+
## Constants
43+
Declare the constant for the Wikipedia URL in the memory folder.
44+
memory/index.ts
45+
```typescript
46+
export class Constant {
47+
wikipedia = 'https://www.wikipedia.org/';
48+
}
49+
```
50+
51+
## Summary
52+
- The feature file (`wikipedia.feature`) outlines the test scenario using Gherkin syntax.
53+
- The page objects (`index.ts` in the `page_object` folder) define the locators for the elements used in the test.
54+
- The constants (`index.ts` in the `memory` folder) store the URLs or other constants used in the tests

0 commit comments

Comments
 (0)