Skip to content

Commit ac94a14

Browse files
AlexGalichenkoOleksandr_Halichenko
and
Oleksandr_Halichenko
authored
added standalone playwright and cypress (#80)
Co-authored-by: Oleksandr_Halichenko <oleksandr_halichenko@epam.com>
1 parent 84062fc commit ac94a14

File tree

8 files changed

+1256
-943
lines changed

8 files changed

+1256
-943
lines changed
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"label": "Standalone Solutions",
3+
"position": 5,
4+
"link": {
5+
"type": "generated-index",
6+
"description": "Standalone Solutions"
7+
}
8+
}

docs/StandaloneSolutions/cypress.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
# @qavajs/cypress
5+
qavajs implementation on top of cypress runner
6+
7+
## Installation
8+
9+
`npm install cypress`
10+
11+
`npm install @qavajs/cypress-runner-adapter`
12+
13+
`npm install @qavajs/cypress`
14+
15+
## Configuration
16+
cypress.config.js
17+
```javascript
18+
const { defineConfig } = require('cypress');
19+
const cucumber = require('@qavajs/cypress-runner-adapter/adapter');
20+
module.exports = defineConfig({
21+
e2e: {
22+
specPattern: 'cypress/features/**/*.feature', //path to features
23+
supportFile: 'cypress/support/e2e.js', //path to main support file
24+
setupNodeEvents(on, config) {
25+
on('file:preprocessor', cucumber)
26+
},
27+
},
28+
});
29+
30+
```
31+
support file
32+
```typescript
33+
import defineQavajs from '@qavajs/cypress/defineQavajs';
34+
import '@qavajs/cypress';
35+
36+
import PageObject from '../page_object/'; // path to qavajs page objects
37+
import Memory from '../memory'; // path to qavajs memory
38+
39+
defineQavajs({
40+
pageObject: new PageObject(),
41+
memory: new Memory()
42+
});
43+
44+
45+
```
+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
sidebar_position: 0
3+
---
4+
# @qavajs/playwright
5+
qavajs implementation on top of playwright runner
6+
7+
## Installation
8+
9+
`npm init playwright`
10+
11+
`npm install @qavajs/playwright-runner-adapter`
12+
13+
`npm install @qavajs/playwright`
14+
15+
## Configuration
16+
cucumber.ts
17+
```typescript
18+
import Memory from './memory';
19+
import App from './page_object';
20+
21+
export default {
22+
paths: ['features/*.feature'],
23+
require: [
24+
'node_modules/@qavajs/playwright/index.js', // package steps
25+
'step_definitions/*.ts' // custom step definitions
26+
],
27+
memory: new Memory(),
28+
pageObject: new App()
29+
}
30+
```
31+
32+
playwright.config.ts
33+
```typescript
34+
proces.env.CONFIG = 'cucumber.ts';
35+
proces.env.PROFILE = 'default';
36+
37+
export default defineConfig({
38+
testDir: resolve('node_modules/@qavajs/playwright-runner-adapter/adapter'),
39+
...
40+
});
41+
```
42+

docs/Steps/playwright.md

+36
Original file line numberDiff line numberDiff line change
@@ -1253,6 +1253,42 @@ When I wait until page title not to contain 'cypress'
12531253
When I wait until page title to be equal 'qavajs' (timeout: 3000)
12541254
```
12551255

1256+
-------------------------
1257+
### I refresh page until \{string} \{playwrightConditionWait}( )\{wdioTimeout}
1258+
1259+
Refresh page until element matches condition
1260+
1261+
| param | type | description |
1262+
|:---------:|:-----------------:|:-----------------------:|
1263+
| alias | string | element alias |
1264+
| condition | string | condition to wait |
1265+
| timeout | number (optional) | timeout in milliseconds |
1266+
1267+
```gherkin
1268+
When I refresh page until 'Internal Server Error Box' to be visible
1269+
When I refresh page until 'Submit Button' to be enabled
1270+
When I refresh page until 'Place Order Button' to be clickable (timeout: 3000)
1271+
```
1272+
-------------------------
1273+
1274+
### I refresh page until text of \{string} \{playwrightValidation} \{string}( )\{playwrightTimeout}
1275+
1276+
Refresh page until element text matches condition
1277+
1278+
| param | type | description |
1279+
|:---------:|:-----------------:|:-----------------------:|
1280+
| alias | string | element alias |
1281+
| condition | string | condition to wait |
1282+
| expected | string | expected value |
1283+
| timeout | number (optional) | timeout in milliseconds |
1284+
1285+
```gherkin
1286+
When I refresh page until text of 'Order Status' to be equal 'Processing'
1287+
When I refresh page until text of 'Currency' not contain '$'
1288+
When I refresh page until text of 'My Salary' to match '/5\d{3,}/' (timeout: 3000)
1289+
```
1290+
-------------------------
1291+
12561292
## Execute Steps
12571293

12581294
---

docs/Steps/wdio.md

+36
Original file line numberDiff line numberDiff line change
@@ -1150,6 +1150,42 @@ Wait until alert to pop up
11501150
When I wait for alert
11511151
```
11521152

1153+
-------------------------
1154+
### I refresh page until \{string} \{wdioConditionWait}( )\{wdioTimeout}
1155+
1156+
Refresh page until element matches condition
1157+
1158+
| param | type | description |
1159+
|:---------:|:-----------------:|:-----------------------:|
1160+
| alias | string | element alias |
1161+
| condition | string | condition to wait |
1162+
| timeout | number (optional) | timeout in milliseconds |
1163+
1164+
```gherkin
1165+
When I refresh page until 'Internal Server Error Box' to be visible
1166+
When I refresh page until 'Submit Button' to be enabled
1167+
When I refresh page until 'Place Order Button' to be clickable (timeout: 3000)
1168+
```
1169+
-------------------------
1170+
1171+
### I refresh page until text of \{string} \{wdioValidation} \{string}( )\{wdioTimeout}
1172+
1173+
Refresh page until element text matches condition
1174+
1175+
| param | type | description |
1176+
|:---------:|:-----------------:|:-----------------------:|
1177+
| alias | string | element alias |
1178+
| condition | string | condition to wait |
1179+
| expected | string | expected value |
1180+
| timeout | number (optional) | timeout in milliseconds |
1181+
1182+
```gherkin
1183+
When I refresh page until text of 'Order Status' to be equal 'Processing'
1184+
When I refresh page until text of 'Currency' not contain '$'
1185+
When I refresh page until text of 'My Salary' to match '/5\d{3,}/' (timeout: 3000)
1186+
```
1187+
-------------------------
1188+
11531189
## Cookie Steps
11541190

11551191
---

docs/intro.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ https://qavajs.github.io/
1111
@qavajs framework is a solution that allows to significantly reduces automation project setup time due to a set of predefined steps, built-in page object solution, and OOB integrations with other test-related stuff (like EPAM ReportPortal etc.)
1212

1313
```gherkin
14-
Feature: Desktop Web Feature
14+
Feature: Web Feature
1515
1616
@wikipedia
1717
Scenario Outline: Search in wikipedia (<term>)

0 commit comments

Comments
 (0)