Skip to content

Commit 158b408

Browse files
added example of satisfy validation (#107)
1 parent 791f221 commit 158b408

File tree

8 files changed

+1611
-1995
lines changed

8 files changed

+1611
-1995
lines changed

package-lock.json

Lines changed: 1570 additions & 1976 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@
1414
"write-heading-ids": "docusaurus write-heading-ids"
1515
},
1616
"dependencies": {
17-
"@docusaurus/core": "^3.7.0",
18-
"@docusaurus/preset-classic": "^3.7.0",
19-
"@easyops-cn/docusaurus-search-local": "^0.49.2",
17+
"@docusaurus/core": "^3.8.1",
18+
"@docusaurus/preset-classic": "^3.8.1",
19+
"@easyops-cn/docusaurus-search-local": "^0.52.1",
2020
"@mdx-js/react": "^3.1.0",
2121
"clsx": "^2.1.1",
2222
"prism-react-renderer": "^2.4.1",
23-
"react": "^19.1.0",
24-
"react-dom": "^19.1.0"
23+
"react": "^19.1.1",
24+
"react-dom": "^19.1.1"
2525
},
2626
"devDependencies": {
27-
"@docusaurus/module-type-aliases": "^3.7.0"
27+
"@docusaurus/module-type-aliases": "^3.8.1"
2828
},
2929
"browserslist": {
3030
"production": [

versioned_docs/version-2x/Formatters/xray-formatter.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ sidebar_position: 5
33
---
44

55
# @qavajs/xray-formatter
6-
Xray formatter for cucumber framework
6+
[Xray](https://docs.getxray.app/) formatter for cucumber framework
77

88
### Installation
99
To install formatter run
1010

11-
`npm install @qavajs/xray-formatter`
11+
```bash
12+
npm install @qavajs/xray-formatter
13+
```
1214

13-
add to formatter section in config file
15+
configure `formatterOption` property in config file:
1416

1517
cloud configuration:
1618
```javascript

versioned_docs/version-2x/Guides/cicd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_position: 6
44

55
# CI/CD
66
**qavajs**, is CI/CD agnostic and can be executed in any environment that satisfies following requirements:
7-
- [nodejs](https://nodejs.org/en) with npm > 18
7+
- [nodejs](https://nodejs.org/en) > 20
88
- installed browsers (for UI testing)
99

1010
## General Approach for qavajs in CI/CD:

versioned_docs/version-2x/Guides/parallel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_position: 3
44

55
# Parallel Execution
66
Framework support parallel execution out of the box.
7-
Number of parallel threads can be set in config file (by default it is config.js)
7+
Number of parallel threads can be set in config file (by default it is config file)
88
```typescript
99
export default {
1010
// other configs

versioned_docs/version-2x/Guides/validation.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,21 @@ match [ajv](https://www.npmjs.com/package/ajv) schema
9494
Then I expect '$object' to match schema '$schema'
9595
```
9696

97+
## satisfy
98+
verify user-defined expectation provided as predicate
99+
100+
```Gherkin
101+
Then I expect '$value' to satisfy '$either(1, 2)'
102+
```
103+
where `$either` is a predicate applied on first argument
104+
```typescript
105+
function either(...expected) {
106+
return function (actual) {
107+
return expected.includes(actual)
108+
}
109+
}
110+
```
111+
97112
## Using in custom steps
98113
You can also use validations in custom steps
99114

versioned_docs/version-2x/Steps/playwright.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default {
3737
browserName: 'chromium'
3838
}
3939
},
40-
pageObject: App
40+
pageObject: new App()
4141
}
4242
```
4343

@@ -69,6 +69,7 @@ export default {
6969

7070
## Screenshot
7171
@qavajs/steps-playwright can also take screenshot on particular event.
72+
7273
- onFail
7374
- beforeStep
7475
- afterStep
@@ -86,6 +87,7 @@ export default {
8687

8788
## Traces
8889
@qavajs support capturing playwright traces. https://playwright.dev/docs/next/trace-viewer-intro
90+
8991
Supported events:
9092
- onFail
9193
- afterScenario
@@ -106,7 +108,8 @@ export default {
106108
```
107109

108110
## Video
109-
@qavajs supports video recording. https://playwright.dev/docs/next/videos
111+
@qavajs supports video recording https://playwright.dev/docs/next/videos
112+
110113
Supported events:
111114
- onFail
112115
- afterScenario
@@ -126,7 +129,7 @@ export default {
126129
```
127130

128131
## Reuse Session
129-
_reuseSession_ flag allows to share driver session between tests. Browser will not be closed automatically after test.
132+
`reuseSession` flag allows to share driver session between tests. Browser will not be closed automatically after test.
130133

131134
```typescript
132135
export default {
@@ -137,7 +140,7 @@ export default {
137140
```
138141

139142
## Restart Browser
140-
_restartBrowser_ flag allows to restart browser between tests instead of default restarting context
143+
`restartBrowser` flag allows to restart browser between tests instead of default restarting context
141144

142145
```javascript
143146
export default {
@@ -168,7 +171,7 @@ mouse button to interact
168171
- right
169172
- middle
170173

171-
## Context variables
174+
## Context properties
172175
@qavajs/steps-playwright exposes following world variables
173176

174177
| variable | type | description |

versioned_docs/version-2x/Steps/wdio.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@ export default {
3838
browserName: 'chrome'
3939
}
4040
},
41-
pageObject: App
41+
pageObject: new App()
4242
}
4343
```
4444

4545
## Screenshot
4646
@qavajs/steps-wdio has build-in capability to take screenshot on particular event.
47+
4748
- onFail
4849
- beforeStep
4950
- afterStep
@@ -59,6 +60,7 @@ export default {
5960

6061
## Snapshot
6162
@qavajs/steps-wdio has build-in capability to take snapshot on particular event.
63+
6264
- onFail
6365
- beforeStep
6466
- afterStep
@@ -72,7 +74,7 @@ export default {
7274
```
7375

7476
## Reuse Session
75-
_reuseSession_ flag allows to share driver session between tests. Browser will not be closed automatically after test.
77+
`reuseSession` flag allows to share driver session between tests. Browser will not be closed automatically after test.
7678

7779
```typescript
7880
export default {
@@ -105,7 +107,7 @@ mouse button to interact
105107
- right
106108
- middle
107109

108-
## Context variables
110+
## Context properties
109111
@qavajs/steps-wdio exposes following world variables
110112

111113
| variable | type | description |

0 commit comments

Comments
 (0)