Skip to content

Commit cdc09fa

Browse files
author
Oleksandr_Halichenko
committed
initial commit
0 parents  commit cdc09fa

30 files changed

+22500
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
# Review gh actions docs if you want to further define triggers, paths, etc
8+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
9+
10+
jobs:
11+
deploy:
12+
name: Deploy to GitHub Pages
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: actions/setup-node@v3
17+
with:
18+
node-version: 18
19+
cache: yarn
20+
21+
- name: Install dependencies
22+
run: yarn install --frozen-lockfile
23+
- name: Build website
24+
run: yarn build
25+
26+
# Popular action to deploy to GitHub Pages:
27+
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
28+
- name: Deploy to GitHub Pages
29+
uses: peaceiris/actions-gh-pages@v3
30+
with:
31+
github_token: ${{ secrets.GITHUB_TOKEN }}
32+
# Build output to publish to the `gh-pages` branch:
33+
publish_dir: ./build
34+
# The following lines assign commit authorship to the official
35+
# GH-Actions bot for deploys to `gh-pages` branch:
36+
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
37+
# The GH actions bot is used by default if you didn't specify the two fields.
38+
# You can swap them out with your own user credentials.
39+
user_name: github-actions[bot]
40+
user_email: 41898282+github-actions[bot]@users.noreply.github.com

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*

.idea/.gitignore

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

.idea/modules.xml

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

.idea/qava-docs.iml

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

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Website
2+
3+
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
4+
5+
### Installation
6+
7+
```
8+
$ npm install
9+
```
10+
11+
### Local Development
12+
13+
```
14+
$ npm run start
15+
```
16+
17+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
18+
19+
### Build
20+
21+
```
22+
$ npm run build
23+
```
24+
25+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
26+
27+
### Deployment
28+
29+
Using SSH:
30+
31+
```
32+
$ USE_SSH=true npm run deploy
33+
```
34+
35+
Not using SSH:
36+
37+
```
38+
$ GIT_USER=<Your GitHub username> npm run deploy
39+
```
40+
41+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};

docs/Formatters/_category_.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"label": "Formatters",
3+
"position": 4,
4+
"link": {
5+
"type": "generated-index",
6+
"description": "Built-in formatters"
7+
}
8+
}

docs/Formatters/report-portal.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# @qavajs/format-report-portal
6+
Formatter that sends result to EPAM ReportPortal
7+
8+
`npm install @qavajs/format-report-portal`
9+
10+
## configuration
11+
12+
add formatter to config.js
13+
```javascript
14+
module.exports = {
15+
default: {
16+
format: [
17+
'@qavajs/format-report-portal'
18+
],
19+
formatOptions: {
20+
rpConfig: {
21+
token: 'your token',
22+
endpoint: 'https://your-rp-instance/api/v1',
23+
description: 'Description',
24+
tags: ['Tag'],
25+
project: 'your project',
26+
launch: 'your launch name'
27+
},
28+
}
29+
}
30+
}
31+
```

docs/Guides/_category_.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"label": "Guides",
3+
"position": 5,
4+
"link": {
5+
"type": "generated-index",
6+
"description": "Guides"
7+
}
8+
}

docs/Guides/memory.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
# Memory
5+
Framework provides the capability to transit variables between step and access them from gherkin definitions
6+
7+
You can use special type {text} to transform string parameter to memory value
8+
9+
```javascript
10+
Then('{text} value should be 42', async function (value) {
11+
expect(await value).to.equal(42);
12+
})
13+
```
14+
or read value directly from memory object
15+
```javascript
16+
const memory = require('@qavajs/memory');
17+
18+
When(/^save variable as '(.+)'$/, async function (key) {
19+
memory.setValue(key, 42);
20+
});
21+
22+
Then(/^value '(.+)' should be equal to '(.+)'$/, async function (variable1, variable2) {
23+
const val = memory.getValue(variable1);
24+
expect(val).to.equal(variable2);
25+
});
26+
```
27+
28+
```gherkin
29+
When save variable as 'variable'
30+
Then value of '$variable' should be equal to '42'
31+
```
32+
33+
## Using constants and computed
34+
35+
Lib provides capability to set constant values and computed (values that calculated in the moment of call)
36+
```javascript
37+
module.exports = {
38+
CONSTANT: 42,
39+
computed: function() {
40+
return Date.now()
41+
}
42+
};
43+
44+
```

docs/Guides/page-object.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# Page Object
6+
Framework provides capability to transform string value to corresponding page object via
7+
{element} type
8+
```javascript
9+
When('click {element}', async function(element) {
10+
await (await element).click();
11+
});
12+
```
13+
or directly call getElement method from po object that resolves plain-english selector and return webdriverIO element or array of webdriverIO element.
14+
```javascript
15+
const { po } = require('@qavajs/po');
16+
17+
When(/^click '(.+)'$/, async function (alias) {
18+
const element = await po.getElement(alias);
19+
await element.waitForClickable();
20+
await element.click();
21+
});
22+
```
23+
24+
```gherkin
25+
When click '#1 of Multiple Component > Child Item'
26+
```
27+
28+
Framework provides capability to get single element from collection by index (#index of Collection) or inner text (#text in Collection).
29+
30+
## Create page object
31+
32+
Framework provides two methods $ and $$ that allow registering elements and collections.
33+
An element can be defined in form of webdriverIO selector or as an instance of the component class.
34+
35+
Each not top-level component should have selector element in form of webdriverIO selector.
36+
```javascript
37+
const { $, $$ } = require('@qavajs/po');
38+
39+
class MultipleComponent {
40+
selector = '.list-components li';
41+
ChildItem = $('div');
42+
}
43+
44+
class SingleComponent {
45+
selector = '.container';
46+
ChildItem = $('.child-item');
47+
}
48+
49+
class App {
50+
SingleElement = $('.single-element');
51+
List = $$('.list li');
52+
SingleComponent = $(new SingleComponent());
53+
MultipleComponents = $$(new MultipleComponent());
54+
}
55+
56+
module.exports = new App();
57+
```

docs/Modules/_category_.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"label": "Modules",
3+
"position": 3,
4+
"link": {
5+
"type": "generated-index",
6+
"description": "Built-in modules"
7+
}
8+
}

docs/Modules/template.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# @qavajs/template
6+
Module that allow to define step definitions on Gherkin language.
7+
8+
`npm install @qavajs/template`
9+
10+
```gherkin
11+
Feature: Templates
12+
13+
Scenario: I login
14+
When I open 'https://your-app.com'
15+
And I type 'username' to 'Login Form > Username Input'
16+
And I type 'password' to 'Login Form > Password Input'
17+
And I click 'Login Form > Login Button'
18+
```
19+
20+
Then following template can be called from scenario as simple step
21+
22+
```gherkin
23+
Feature: Auth
24+
25+
Scenario: Verify that user is able to login
26+
When I login
27+
Then I expect 'Header' to be visible
28+
```
29+
30+
Templates also can accept parameters as < param> e.g
31+
32+
```gherkin
33+
Feature: Templates
34+
35+
Scenario: I login as <username> with <password> password
36+
When I open 'https://your-app.com'
37+
And I type '<username>' to 'Login Form > Username Input'
38+
And I type '<password>' to 'Login Form > Password Input'
39+
And I click 'Login Form > Login Button'
40+
```
41+
42+
Then following template can be called with actual params
43+
44+
```gherkin
45+
Feature: Auth
46+
47+
Scenario: Verify that user is able to login
48+
When I login as 'admin' with 'admin' password
49+
Then I expect 'Header' to be visible
50+
```
51+
52+
To use templates their location need to be passed to templates property of config file and library need to be listed
53+
in require
54+
```javascript
55+
module.exports = {
56+
default: {
57+
require: [
58+
'node_modules/@qavajs/steps-config-loader'
59+
],
60+
requireModule: [
61+
'@qavajs/template'
62+
],
63+
templates: ['templates/*.feature']
64+
}
65+
}
66+
````

docs/Steps/_category_.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"label": "Steps",
3+
"position": 2,
4+
"link": {
5+
"type": "generated-index",
6+
"description": "Built-in steps"
7+
}
8+
}

0 commit comments

Comments
 (0)