{"id":19845389,"url":"https://github.com/qavajs/core","last_synced_at":"2026-03-02T00:32:16.514Z","repository":{"id":37824954,"uuid":"502554342","full_name":"qavajs/core","owner":"qavajs","description":"@qavajs test runner module","archived":false,"fork":false,"pushed_at":"2026-02-03T09:28:14.000Z","size":782,"stargazers_count":21,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-02-03T22:17:35.913Z","etag":null,"topics":["qa","test-automation","testing"],"latest_commit_sha":null,"homepage":"https://qavajs.github.io","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qavajs.png","metadata":{"files":{"readme":"README.MD","changelog":"CHANGELOG.MD","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-06-12T08:01:06.000Z","updated_at":"2026-02-03T09:27:47.000Z","dependencies_parsed_at":"2023-02-19T09:20:51.873Z","dependency_job_id":"8b58bea4-65d0-4e91-9d33-7a20c8427dd1","html_url":"https://github.com/qavajs/core","commit_stats":null,"previous_names":["qavajs/core","qavajs/cli"],"tags_count":67,"template":false,"template_full_name":null,"purl":"pkg:github/qavajs/core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qavajs%2Fcore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qavajs%2Fcore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qavajs%2Fcore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qavajs%2Fcore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qavajs","download_url":"https://codeload.github.com/qavajs/core/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qavajs%2Fcore/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29988045,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T22:42:38.399Z","status":"ssl_error","status_checked_at":"2026-03-01T22:41:51.863Z","response_time":124,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["qa","test-automation","testing"],"created_at":"2024-11-12T13:07:33.560Z","updated_at":"2026-03-02T00:32:16.490Z","avatar_url":"https://github.com/qavajs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](https://badge.fury.io/js/@qavajs%2Fcore.svg)](https://badge.fury.io/js/@qavajs%2Fcore)\n\n## @qavajs/core\n\n@qavajs framework core\n          \n`npm install @qavajs/core`\n\nRun tests\n\n`npx qavajs run --config \u003cconfig\u003e --profile \u003cprofile\u003e`\nor\n`npx qavajs --config \u003cconfig\u003e --profile \u003cprofile\u003e`\n\n### Override memory values\nIn 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)\nIt can be done by passing `--memory-values` parameter which is JSON with params that need to be overridden\n\nexample\n\n```npx qavajs run --config config.ts --memory-values '{\"url\": \"https://github.com\"}'``` \n\nit will override $url memory value\n\n### Pass CLI params to workers\nAll params that you passed to qavajs cli will be available in CLI_ARGV environment variable in all child workers.\n\n### Memory value parameter type\n`value` parameter type provides API to access memory\n\n```javascript\nWhen('Read memory {value}', async function(memoryValue) {\n    expect(memoryValue.value()).to.equal('ts');\n});\n\nWhen('Set memory {value} as {string}', async function(memoryKey, value) {\n    memoryKey.set(value);\n});\n```\n\n### Validation parameter type\n`validation` parameter type provides an API to verify values by a certain condition\n\n```javascript\nWhen('I expect {string} {validation} {string}', async function(value1, validate, value2) {\n    validate(value1, value2);\n});\n```\n\n### Soft Validation\nYou can use the `softly` prefix before expect.\n```gherkin\nFeature: Feature\n\n  Scenario: verify soft assert\n    # first step fails, but other steps will not be skipped\n    Then I expect '2' to softly equal '1'\n    # pass\n    And I expect '1' to softly equal '1'\n    # fail\n    And I expect '2' to softly equal '1'\n    # skip\n    And I expect '1' to softly equal '1'\n```\n\n### Test Sharding\nqavajs provides the ability to shard your tests between different machines. To do so pass `--shard x/y` parameter in CLI,\nwhere x - current shard, y - total number of shards.\n\n```\nnpx qavajs run --config config.js --shard 1/2\nnpx qavajs run --config config.js --shard 2/2\n```\n\n### Execute steps from other steps\nIt is possible to implement complex logic using built-in qavajs steps via `executeStep` world method\n```javascript\nWhen('I do smth complex', async function() {\n    await this.executeStep(`I type 'username' to 'Username Input'`);\n    await this.executeStep(`I type 'password' to 'Password Input'`);\n    await this.executeStep(`I click 'Login Button'`);\n    await this.executeStep(`I fill following fields`, new DataTable([\n        [ 'Order', '123' ],\n        [ 'Delivery Location', 'New York' ]\n    ]))\n});\n```\n\n### World\nModule extends CucumberJS world with additional entities  \n \n| entity      | type     | description                                      | example                                                            |\n|-------------|----------|--------------------------------------------------|--------------------------------------------------------------------|\n| config      | object   | loaded config                                    | `this.config.parallel`                                             |\n| executeStep | function | programmatically execute certain step definition | `await this.executeStep(\"I type 'username' to 'Username Input'\");` |\n| setValue    | function | set memory value                                 | `await this.setValue('key', 'value');`                             |\n| getValue    | function | get memory value or expression                   | `await this.getValue('$key');`                                     |\n| validation  | function | get validation function based                    | `await this.getValue('to equal');`                                 |\n\n### Override step definition\n`Override` function provides capability to override step implementation and avoid ambiguous exception\n\n```typescript\nimport { Override } from '@qavajs/core';\n\nWhen('I do test', async function () {});\n\nOverride('I do test', async function () {\n    console.log('I am overridden');\n});\n```\n\n### Fixture\n`Fixture` provides a convenient way to prepare a test environment for specific test.\n\nThis example will open pdp page before test and clean the cart after the test\n```typescript\nimport { Fixture } from '@qavajs/core';\n\nFixture('pdp', async function() {\n    await this.playwright.page.goto('https://my-site/pdp');\n    // fixture may return function that will be executed after test\n    return async function() {\n        await this.playwright.page.request.get('/cleanCart');\n    }\n});\n```\n\n```gherkin\nFeature: feature with fixture\n\n  @pdp\n  Scenario: scenario with fixture\n    When I click 'qavajs T-shirt'\n    And I click 'cart icon'\n    Then I expect 'qavajs T-shirt cart item' to be visible\n```\n\n### Template\n`Template` provides a way to define step definition using Gherkin language\n\n```typescript\nimport { When, Template } from '@qavajs/core';\n\nWhen('I click {string} and verify {string}', Template((locator, expected) =\u003e `\n    I click '${locator}'\n    I expect '${locator} \u003e Value' to equal '${expected}'\n`));\n```\n\n### Test Execution Hooks\n`BeforeExecution` and `AfterExecution` allow to define hooks that will be executed \nonce before/after the whole test execution\n\n```typescript\nimport { BeforeExecution, AfterExecution } from '@qavajs/core';\nimport { Server } from './server';\n\nconst server = new Server();\n\nBeforeExecution(async function () {\n    await server.start();\n});\n\nAfterExecution(async function () {\n    await server.stop();\n});\n```\n\n### Service\nServices are entities that can execute logic before and after the whole test run.\n\n```typescript\nimport externalService from './externalService';\n\nexport default {\n    service: [\n        {\n            options: {\n                data: 42\n            },\n            before() {\n                console.log(this.options.data);\n            },\n            after(result) {\n                if (!result.success) process.exitCode = 1;\n            }\n        },\n        {\n            options: {\n                data: 42\n            },\n            ...externalService\n        }\n    ]\n}\n```\nThere is a one-minute default timeout for the before and after test logic to prevent the entire process from freezing.\nTo set up a custom timeout in milliseconds, use `serviceTimeout` property in the config file\n```typescript\nexport default {\n    serviceTimeout: 1_200_000\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqavajs%2Fcore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqavajs%2Fcore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqavajs%2Fcore/lists"}