Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/qavajs/core
qavajs installer and runner
https://github.com/qavajs/core
qa test-automation testing
Last synced: about 1 month ago
JSON representation
qavajs installer and runner
- Host: GitHub
- URL: https://github.com/qavajs/core
- Owner: qavajs
- License: mit
- Created: 2022-06-12T08:01:06.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-28T14:04:32.000Z (about 2 months ago)
- Last Synced: 2024-10-28T14:49:57.846Z (about 2 months ago)
- Topics: qa, test-automation, testing
- Language: TypeScript
- Homepage:
- Size: 586 KB
- Stars: 19
- Watchers: 2
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: README.MD
- Changelog: CHANGELOG.MD
- License: LICENSE
Awesome Lists containing this project
README
[![npm version](https://badge.fury.io/js/@qavajs%2Fcli.svg)](https://badge.fury.io/js/@qavajs%2Fcli)
## @qavajs/cli
Cli for @qavajs framework.
`npm install @qavajs/cli`Run tests
`npx qavajs run --config --profile `
or
`npx qavajs --config --profile `### Override memory values
In case if tests need to be run with updated memory value they can be passed via CLI (e.g run scenarios on some other url)
It can be done by passing `--memory-values` parameter which is JSON with params that need to be overriddenexample
```npx qavajs run --config config.ts --memory-values '{"url": "https://github.com"}'```
it will override $url memory value
### Service
Services is an entities that can execute logic before and after whole test run.```javascript
module.exports = {
default: {
service: [{
after(result) {
if (!result.success) process.exitCode = 1;
}
}]
}
}
```
There is a one minute-long default timeout for a before and after test logic to prevent entire process from freezing.
To set up a custom timeout in milliseconds use serviceTimeout property in the config file
```javascript
module.exports = {
default: {
serviceTimeout: 1_200_000
}
}
```### Pass CLI params to workers
All params that you passed to qavajs cli will be available in CLI_ARGV environment variable in all child workers.### Override step definition
```javascript
const { Override } = require('@qavajs/cli/utils');When('I do test', async function() {});
Override('I do test', async function() {
console.log('I am overridden')
});
```### Test Sharding
qavajs provides ability to shard your tests between different machines. To do so pass `--shard x/y` parameter in CLI,
where x - current shard, y - total number of shards.```
npx qavajs run --config config.js --shard 1/2
npx qavajs run --config config.js --shard 2/2
```### Execute steps from other steps
It is possible to implement complex logic using built-in qavajs steps via `executeStep` world method
```javascript
When('I do smth complex', async function() {
await this.executeStep(`I type 'username' to 'Username Input'`);
await this.executeStep(`I type 'password' to 'Password Input'`);
await this.executeStep(`I click 'Login Button'`);
await this.executeStep(`I fill following fields`, new DataTable([
[ 'Order', '123' ],
[ 'Delivery Location', 'New York' ]
]))
});
```### World
Module extends CucumberJS world with additional entities
| entity | type | description | example |
|-------------|----------|--------------------------------------------------|--------------------------------------------------------------------|
| config | object | loaded config | `this.config.parallel` |
| executeStep | function | programmatically execute certain step definition | `await this.executeStep("I type 'username' to 'Username Input'");` |
| setValue | function | set memory value | `await this.setValue('key', 'value');` |
| getValue | function | get memory value or expression | `await this.getValue('$key');` |