Skip to content

Commit 9b937cd

Browse files
AlexGalichenkoOleksandr_Halichenko
andauthored
added value expect and wait steps (#77)
Co-authored-by: Oleksandr_Halichenko <[email protected]>
1 parent 0252b43 commit 9b937cd

File tree

3 files changed

+100
-11
lines changed

3 files changed

+100
-11
lines changed

docs/Formatters/console-formatter.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ module.exports = {
1818
format: ['@qavajs/console-formatter'],
1919
formatOptions: {
2020
console: {
21-
showLogs: true //show cucumber logs
21+
showLogs: true, //show cucumber logs. Default - false
22+
showProgress: true //show progress bar. Default - false
2223
}
2324
},
2425
}

docs/Steps/playwright.md

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,20 @@ module.exports = {
8484
}
8585
```
8686

87-
## Playwright traces
87+
## Traces
8888
@qavajs support capturing playwright traces. https://playwright.dev/docs/next/trace-viewer-intro
89+
Supported events:
90+
- onFail
91+
- afterScenario
92+
8993
```typescript
9094
module.exports = {
9195
default: {
9296
//...
9397
browser: {
9498
trace: {
95-
event: ['onFail'], // Events to save trace. Possible values onFail or AfterScenario
96-
dir: 'dirToStoreTraces', // Dir to store traces. Default is traces/
99+
event: ['onFail'], // Events to save trace. Possible values onFail or afterScenario
100+
dir: 'traces', // Dir to store traces. Default is traces/
97101
attach: true // Define if trace need to be attached to cucumber report. Default false
98102
}
99103
}
@@ -103,24 +107,28 @@ module.exports = {
103107

104108
## Video
105109
@qavajs supports video recording. https://playwright.dev/docs/next/videos
110+
Supported events:
111+
- onFail
112+
- afterScenario
113+
106114
```typescript
107115
module.exports = {
108116
default: {
109117
//...
110118
browser: {
111119
video: {
112-
event: ['onFail'], // Events to save video. Possible value onFail or AfterScenario
113-
dir: 'dirToStoreVideo', // Dir to store video. Default is video/
114-
size: {width: 640, height: 480}, // Video resolution
120+
event: ['onFail'], // Events to save video. Possible value onFail or afterScenario
121+
dir: 'video', // Dir to store video. Default is video/
122+
size: { width: 640, height: 480 }, // Video resolution
115123
attach: true // Define if trace need to be attached to cucumber report. Default false
116124
}
117125
}
118126
}
119127
}
120128
```
121129

122-
## reuseSession
123-
reuseSession flag allows to share driver session between tests. Browser will not be closed automatically after test.
130+
## Reuse Session
131+
_reuseSession_ flag allows to share driver session between tests. Browser will not be closed automatically after test.
124132

125133
```javascript
126134
module.exports = {
@@ -727,6 +735,21 @@ Then I expect text of '#1 of Search Results' to be equal 'google'
727735
Then I expect text of '#1 of Search Results' to be equal '$firstResult'
728736
```
729737
---
738+
### I expect value of \{string} \{playwrightValidation} \{string}
739+
740+
Verify that value of element satisfies condition
741+
742+
| param | type | description | example |
743+
|:-------------:|:------:|:--------------------------:|:-------------------------------------:|
744+
| alias | string | element to check condition | Input, Text Area |
745+
| validation | string | validation type | to be equal, to contain, not to match |
746+
| expectedValue | string | expected result | |
747+
748+
```gherkin
749+
Then I expect value of 'Input' to be equal 'google'
750+
Then I expect value of '#1 of Textareas' to be equal '$firstResult'
751+
```
752+
---
730753
### I expect \{string} property of \{string} \{playwrightValidation} \{string}
731754

732755
Verify that property of element satisfies condition
@@ -1127,6 +1150,23 @@ When I wait until text of 'Header' not to be equal 'Python'
11271150
When I wait until text of 'Header' to be equal 'Javascript' (timeout: 3000)
11281151
```
11291152
---
1153+
### I wait until value of \{string} \{playwrightValueWait} \{string}( )\{playwrightTimeout}
1154+
1155+
Wait for element value condition
1156+
1157+
| param | type | description |
1158+
|:-------:|:-----------------:|:-----------------------:|
1159+
| alias | string | element |
1160+
| wait | string | validation type |
1161+
| value | string | expected result |
1162+
| timeout | number (optional) | timeout in milliseconds |
1163+
1164+
```gherkin
1165+
When I wait until value of 'Input' to be equal 'Javascript'
1166+
When I wait until value of 'Input' not to be equal 'Python'
1167+
When I wait until value of 'Input' to be equal 'Javascript' (timeout: 3000)
1168+
```
1169+
---
11301170
### I wait until number of elements in \{string} collection \{playwrightValueWait} \{string}( )\{playwrightTimeout}
11311171

11321172
Wait for collection length condition

docs/Steps/wdio.md

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,24 @@ module.exports = {
5757
}
5858
```
5959

60-
## reuseSession
61-
reuseSession flag allows to share driver session between tests. Browser will not be closed automatically after test.
60+
## Snapshot
61+
@qavajs/steps-wdio has build-in capability to take snapshot on particular event.
62+
- onFail
63+
- beforeStep
64+
- afterStep
65+
66+
```javascript
67+
module.exports = {
68+
default: {
69+
browser: {
70+
snapshot: ['onFail']
71+
}
72+
}
73+
}
74+
```
75+
76+
## Reuse Session
77+
_reuseSession_ flag allows to share driver session between tests. Browser will not be closed automatically after test.
6278

6379
```javascript
6480
module.exports = {
@@ -629,6 +645,21 @@ Then I expect text of '#1 of Search Results' to be equal 'google'
629645
Then I expect text of '#1 of Search Results' to be equal '$firstResult'
630646
```
631647
---
648+
### I expect value of \{string} \{playwrightValidation} \{string}
649+
650+
Verify that value of element satisfies condition
651+
652+
| param | type | description | example |
653+
|:-------------:|:------:|:--------------------------:|:-------------------------------------:|
654+
| alias | string | element to check condition | Input, Text Area |
655+
| validation | string | validation type | to be equal, to contain, not to match |
656+
| expectedValue | string | expected result | |
657+
658+
```gherkin
659+
Then I expect value of 'Input' to be equal 'google'
660+
Then I expect value of '#1 of Textareas' to be equal '$firstResult'
661+
```
662+
---
632663
### I expect \{string} property of \{string} \{wdioValidation} \{string}
633664

634665
Verify that property of element satisfies condition
@@ -1014,6 +1045,23 @@ When I wait until text of 'Header' not to be equal 'Python'
10141045
When I wait until text of 'Header' to be equal 'Javascript' (timeout: 3000)
10151046
```
10161047
---
1048+
### I wait until value of \{string} \{playwrightValueWait} \{string}( )\{playwrightTimeout}
1049+
1050+
Wait for element value condition
1051+
1052+
| param | type | description |
1053+
|:-------:|:-----------------:|:-----------------------:|
1054+
| alias | string | element |
1055+
| wait | string | validation type |
1056+
| value | string | expected result |
1057+
| timeout | number (optional) | timeout in milliseconds |
1058+
1059+
```gherkin
1060+
When I wait until value of 'Input' to be equal 'Javascript'
1061+
When I wait until value of 'Input' not to be equal 'Python'
1062+
When I wait until value of 'Input' to be equal 'Javascript' (timeout: 3000)
1063+
```
1064+
---
10171065
### I wait until number of elements in \{string} collection \{wdioValidation} \{string}( )\{wdioTimeout}
10181066

10191067
Wait for collection length condition

0 commit comments

Comments
 (0)