open-index/open-npm huggingface dataset:
npm package: @qatonda/tsc-run-scripts-hook
Description: This is a package that will run configured npm scripts after `tsc` is run. It will even follow project references in your `tsconfig.json` to run their scripts.
Latest version: 1.1.3

# tsc-run-scripts-hook

This is a package that will run configured npm scripts after `tsc` is run. It will even follow
project references in your `tsconfig.json` to run their scripts.

## when does this run

We only run scripts under the following conditions:
- the args aren't present: `-h`, `--help`, `-all`, `--clean`
- and if the tsc process exits successfully (0)

The npm scripts will be run as the `tsc` process exits.

## examples

### copy files

Say you want to be able to copy all non-{ts,js} files after typescript builds. You would use the following `tsconfig.json`:

`tsconfig.json`
```
{
  "compilerOptions": { ... },
  "run-scripts": ["build-step:copy-files"]
}
```

`package.json`
```
{
  "scripts": {
    "build-step:copy-files": "copyfiles -u 1 src/**/*.{json,html} dist/",
  },
  ...
  "devDependencies": {
    "copyfiles": "*",
  }
}
```

This would be equivalent to the following when running `$ tsc ...`.
```
$ tsc [-b] # or whatever you use to build
$ npm run build-step:copy-files
| $ copyfiles ...
```

### copy files with project references

Say you want to be able to copy all non-{ts,js} files after typescript builds and you had more than
one project in your repo that you defined using `tsconfig.json`'s `references` field. You would use
the following layout:

`project-a/tsconfig.json`
```
{
  "compilerOptions": { ... },
  "run-scripts": ["build-step:copy-files"],
  "references": [
    { "path": "project-b" }
  ]
}
```

`project-a/package.json`
```
{
  "scripts": {
    "build-step:copy-files": "copyfiles -u 1 src/**/*.{json,html} dist/",
  },
  ...
}
```

`project-b/tsconfig.json`
```
{
  "compilerOptions": { ... },
  "run-scripts": ["build-step:copy-files"]
}
```

`project-b/package.json`
```
{
  "scripts": {
    "build-step:copy-files": "copyfiles -u 1 src/**/*.{json,html} dist/",
  },
  ...
}
```

This would be equivalent to the following when running `$ tsc ...`.
```
[project-a] $ tsc -b
[project-b] $ npm run build-step:copy-files
[project-b] | $ copyfiles ...
[project-a] $ npm run build-step:copy-files
[project-a] | $ copyfiles ...
```

## tsconfig.json: project references

This is particularly helpful in situations with a monorepo and configured tsconfig [project
references](https://www.typescriptlang.org/docs/handbook/project-references.html). By default
without this project, it will compile the references, but not run scripts! This is where
`tsc-run-scripts-hook` comes in handy. It's a lightweight project meant to run npm scripts post
build.
npm package: @qatools/js-utils
Description: JavaScript utilities
Author: Dan Rusu
Latest version: 1.0.6

# js-utils

![Tests](https://github.com/danrusu/js-utils/actions/workflows/test.yaml/badge.svg)

## JavaScript utilities playground

- ### Install

```bash
npm install --save @qatools/js-utils
```

- ### Use

```javascript
const jsUtils = require('@qatools/js-utils');
```

- ### [Specs](./test)
npm package: @qauri/create-qauri
Description: Create a new Qauri project with interactive prompts
Author: Qauri Team
Latest version: 0.3.0

# @qauri/create-qauri

Scaffolding tool for creating [Qauri](https://github.com/popo-studio/qauri-web-component) projects with interactive prompts.

## Usage

```bash
# npm
npm create @qauri/qauri@latest

# pnpm
pnpm create @qauri/qauri

# yarn
yarn create @qauri/qauri
```

Optionally specify a project name:

```bash
npm create @qauri/qauri@latest my-app
```

## What it does

The CLI walks you through an interactive wizard to configure your project:

1. **Project name** — validates naming conventions
2. **Native language** — C++ or Python
3. **Python configuration** (if Python selected):
   - Package manager (pip or uv)
   - Python version (3.9-3.12)
   - Python path detection
4. **Qt configuration**:
   - Qt version (6.5.3, 6.9.2)
   - Qt path detection
5. **Backend** — WebView2 (Windows), CEF (cross-platform), or Both
6. **Frontend framework** — Vanilla, React, Vue, or Svelte (with TypeScript variants)
7. **Features** — DevTools (F12), Reload (F5), Command Whitelist, Examples
8. **New window behavior** — Block, Browser, or New Window
9. **Install dependencies** — Automatically run npm install

Then generates a complete project structure ready for development.

## Generated Project Structure

```
my-qauri-app/
├── index.html
├── package.json
├── vite.config.js
├── src/                    # Frontend source
│   └── ...
├── src-qauri/              # Native code
│   ├── qauri.config.json
│   ├── main.cpp / main.py
│   └── CMakeLists.txt      # (C++ only)
├── .gitignore
└── README.md
```

## Supported Templates

### Frontend Frameworks
- Vanilla / Vanilla + TypeScript
- React / React + TypeScript
- Vue / Vue + TypeScript
- Svelte / Svelte + TypeScript

All templates use Vite as the build tool and include `@qauri/api` for JS↔Native communication.

### Native Languages
- **C++** — CMake project linking Qt6 and qauri
- **Python** — PySide6 + pyqauri, with uv or pip environment setup

## Development

For development on the Qauri project itself, use [`@qauri/cli`](https://github.com/popo-studio/qauri-cli):

```bash
npm install -g @qauri/cli
qauri dev
qauri build
qauri info
```

## License

MIT

## Links

- [Qauri Web Component](https://github.com/popo-studio/qauri-web-component)
- [Qauri CLI](https://github.com/popo-studio/qauri-cli)
- [Qauri JS SDK](https://github.com/popo-studio/qauri-js-sdk)
npm package: @qavajs/api-service
Description: server requests(http, websocket, soap) for @qavajs project
Latest version: 0.0.8

# @qavajs/api-service
This is a core package to get basic server requests with different protocols and architecture, like REST(HTTP), Websockets, SOAP

# How to use 
```javascript
import { sendHttpRequest } from '@qavajs/api-service';
import { sendWebsocketMessage} from '@qavajs/api-service';
```
npm package: @qavajs/console-formatter
Description: console formatter for cucumber framework
Latest version: 1.1.1

# @qavajs/console-formatter

Console formatter for @qavajs and cucumberjs frameworks

### Installation
```
npm install @qavajs/console-formatter
```

add `@qavajs/console-formatter` to `format` property and configure in `formatOptions` property

```typescript
export default {
    format: ['@qavajs/console-formatter'],
    formatOptions: {
        console: {
            showLogs: true, // show this.log entries in output. Default - false
            showProgress: false // show progress bar. Default - false 
        }
    }
}
```

or pass `--format @qavajs/console-formatter in cli`
             
![](assets/report_example.png)
npm package: @qavajs/create
Description: @qavajs init
Author: Alexandr Galichenko
Latest version: 2.2.2

# @qavajs/create

The qavajs is a modular test automation framework designed to minimize setup time and streamline the development of test scripts. It incorporates the best test automation tools and practices into a single whole. The framework achieves efficiency through its built-in page object engine and ready-to-use sets of domain-agnostic step definitions suitable for both API and UI testing of the web and native mobile applications. Additionally, qavajs provides out of the box integration with ReportPortal, Mobitru, and the Xray and many more.

`@qavajs/create` is a CLI tool that streamlines the initialization of test automation projects using the qavajs framework. It facilitates the setup of a modular, low-code test automation environment tailored for UI and API testing across web and mobile platforms.

```
npm init @qavajs
```

## Tests

```
npm run test
```
npm package: @qavajs/csv-formatter
Description: csv formatter for cucumber framework
Latest version: 0.1.0

# @qavajs/csv-formatter

CSV formatter for @qavajs and CucumberJS frameworks

### Installation
To install formatter run

`npm install @qavajs/csv-formatter`

and add to formatter section in config file

```javascript
module.exports = {
    default: {
        format: ['@qavajs/csv-formatter', 'report/report.csv']
    }
}
```
npm package: @qavajs/cypress
Description: qavajs for cypress runner
Author: Alexandr Galichenko
Latest version: 2.8.0

# @qavajs/cypress
qavajs implementation for cypress runner

## Installation

```bash
npm install @qavajs/cypress @qavajs/cypress-runner-adapter @qavajs/memory
```

## Configuration
cypress.config.js
```javascript
const { defineConfig } = require('cypress');
const cucumber = require('@qavajs/cypress-runner-adapter/adapter');
module.exports = defineConfig({
    e2e: {
        specPattern: 'cypress/features/**/*.feature', //path to features
        supportFile: 'cypress/support/e2e.js', //path to main support file
        setupNodeEvents(on, config) {
            on('file:preprocessor', cucumber)
        },
    },
});

```
support file defines steps and loads qavajs entities (memory and page object)
```typescript
import defineQavajs from '@qavajs/cypress/defineQavajs';
import '@qavajs/cypress';

import PageObject from '../page_object/'; // path to qavajs page objects
import Memory from '../memory'; // path to qavajs memory

defineQavajs({
    pageObject: new PageObject(),
    memory: new Memory()
});


```

## Development and testing
Install dependencies
```
npm install
```

Execute tests
```
npm run test
```

Debug tests
```
npm run debug
```
npm package: @qavajs/cypress-runner-adapter
Description: feature file preprocessor
Latest version: 1.9.1

# @qavajs/cypress-runner-adapter
Adapter to run Gherkin tests via cypress test runner

## Installation

```
npm install @qavajs/cypress-runner-adapter
```

## Basic Configuration

```javascript
const { defineConfig } = require('cypress');
const cucumber = require('@qavajs/cypress-runner-adapter/adapter');

module.exports = defineConfig({
    e2e: {
        specPattern: 'cypress/feature/**/*.feature',
        supportFile: 'cypress/support/e2e.js',
        setupNodeEvents(on, config) {
            on('file:preprocessor', cucumber)
        },
    },
});
```

`support/e2e.js` is entry point with step definition;

```javascript
import { When, setWorldConstructor } from '@qavajs/cypress-runner-adapter';

class World {
    parameter = 42;
}

setWorldConstructor(World);

When('open {string} url', function (url) {
    cy.visit(url);
});
```

## Tags
Test can be filtered using Cucumber tag expressions provided via environment variable `TAGS`
```
TAGS='@first and @second' npx cypress run
```

## Translation Mode
Gherkin tests can be translated in different modes
- `describe` - default mode. Scenario will be translated as `describe`, each step will be translated as `it`
- `it` - Scenario will be translated as `it`

```bash
MODE=it npx cypress open
```
npm package: @qavajs/env
Description: Loads environment variables from a .env and encrypted .env.enc file into process.env
Latest version: 1.0.0

# Env
The module decrypts and loads environment variables from a `.env.enc` file into process.env as well as variables from a `.env`. 

## Usage
As early as possible in your application, import and call `loadConfig()`

To upload variables only from .env file:
```typescript
import loadConfig from '@qavajs/env'
// Load configuration from the default .env file
loadConfig();

// Load configuration from a specified *.env file
loadConfig({envConfigPath: 'path/to/local.env'});

// Load configuration from a default .env.enc encrypted file
loadConfig({password: 'mySecretPassword'});

// Load configuration from a specified *.env.enc encrypted file
loadConfig({encryptedConfigPath: 'path/to/config.env.enc', password: 'mySecretPassword'});

// Load configuration from both *.env and *.env.enc files
loadConfig({
    envConfigPath: 'path/to/local.env',
    encryptedConfigPath: 'path/to/local.env.enc',
    password: 'mySecretPassword'
});
```

## CLI tools
The module has a commandline tool to encrypt and decrypt env files in order to provide capability to update .env.enc file according to changes through project.
To encrypt default `.env` from the root folder run the next command in terminal: 
````shell
npx qavajs-env encrypt 'mySecretPassword'
````
This command will generate .env.enc it the project root folder.

To encrypt an env file with specific name run the next:
````shell
npx qavajs-env encrypt 'mySecretPassword' -f 'path/to/my/named.env'
````
The file will be encrypted and saved into the directory.

Another feature is decrypting an `.env.enc` file. This can be helpful if you would like to obtain it's content.
````shell
npx qavajs-env encrypt 'mySecretPassword'
````

To decrypt an `env.enc` file from a specific directory run the next command:
````shell
npx qavajs-env encrypt 'mySecretPassword' -f 'path/to/my/named.env.enc'
````
npm package: @qavajs/format-report-portal
Description: cucumber formatter for report portal
Latest version: 1.2.2

## @qavajs/format-report-portal
qavajs and cucumberjs formatter for EPAM [Report Portal](https://reportportal.io/)

### Install
```
npm install @qavajs/format-report-portal
```

### Configuration

add formatter to config.js
```typescript
export default {
    format: [
        ['@qavajs/format-report-portal', 'report/rp.out']
    ],
    formatOptions: {
        rpConfig: {
            enable: true,
            debug: false,
            apiKey: 'your token',
            endpoint: 'https://your-rp-instance/api/v1',
            description: 'Description',
            tags: ['Tag'],
            project: 'your project',
            launch: 'your launch name',
            mode: 'DEFAULT',
            retry: 1, // number of retries to send result to report portal (default - 1)
            ignoreErrors: false, // ignore RP errors (default: false)
            tagsAsAttributes: true, // (default: false - tags go to description)
            legacyTimeFormat: true // (default: false - use legacy milliseconds precision instead of microseconds)
        },
    }
}
```
Option `enable` is set to `true` even if it is not defined explicitly in rpConfig section.

### Test Level Attributes
Test level attributes can be added via cucumber logs e.g. in Before hook
```typescript
import { Before } from '@cucumber/cucumber';

Before(function () {
    this.log('log from before'); //just log
    this.log(`rp_attribute: fixed:42`); //static attribute
    this.log(`rp_attribute: random:${Date.now()}`); //dynamic attribute
});
```
### Run Unit Tests
add token.json file with rp token and other config
run
```
npm run test
```

### Run E2E Tests
add token.json file with rp token and other config
run
```
npm run test-e2e
```
npm package: @qavajs/html-formatter
Description: Single file HTML formatter for cucumber framework
Latest version: 1.2.0

# @qavajs/html-formatter

Single file HTML formatter for cucumber framework

### Installation
To install formatter run

```
npm install @qavajs/html-formatter
```

and add to formatter section in config file

```typescript
export default {
    format: [
        ['@qavajs/html-formatter', 'report.html']
    ],
    formatOptions: {
        htmlConfig: {
            showLogs: true, // enable/disable text/x.cucumber.log+plain
            metadata: {
                'OS': 'macos',
                'OS Version': '13.1'
            }
        }
    },
}
```

or pass `--format @qavajs/html-formatter:report.html` in cli

![](assets/qavajs_html_reporter.png)

Kudos to https://github.com/epam/UUI for providing components

## Development

```
npm install
```

```
npm run build
```

```
npm start
```
npm package: @qavajs/memory
Description: memory package for @qavajs framework
Latest version: 1.10.3

[![npm version](https://badge.fury.io/js/@qavajs%2Fmemory.svg)](https://badge.fury.io/js/@qavajs%2Fmemory)

## @qavajs/memory

Unified test data storage for the `@qavajs` framework

```
npm install @qavajs/memory
```

## Usage
       
The module resolves the provided value from storage
```typescript
import memory from '@qavajs/memory';

When(/^save variable as '(.+)'$/, async function (key) {
    memory.setValue(key, 42);
});

Then(/^value '(.+)' should be equal to '(.+)'$/, async function (variable1, variable2) {
    const val = memory.getValue(variable1);
    expect(val).to.equal(variable2);
});
```

```gherkin
When save variable as 'variable'
Then value of '$variable' should be equal to '42'
```

## Using constants and computed

The module provides the capability to set constant values and computed (values that are calculated at the moment of call)
```typescript
export default {
    constant: 42,
    now: function() {
        return Date.now()
    }
};
```
## Register constants and computed
Before using memory, it needs to be registered. The best place to do it is `Before` hook

```typescript
import memory from '@qavajs/memory';
import memoryMap from './memoryMap.js';

Before(async function() {
    memory.register(memoryMap);
});
```

## Escape `$`
`$` can be escaped with a double backslash

```Gherkin
When I expect text of 'Currency Label' to equal '\\$42'
```

## Parallel
In case you need to assign a unique value for each Cucumber thread and qavajs shard, you can use a `parallel` function.
It will assign value based on `CUCUMBER_WORKER_ID` and `SHARD` env variables.

```typescript
import { parallel } from '@qavajs/memory/utils';

export default class Memory {
    user = parallel([
        { username: 'user1', password: 'password' },
        { username: 'user2', password: 'password' }
    ]);

    // shard mode 
    shardUser = parallel([
        { username: 'user1', password: 'password' },
        { username: 'user2', password: 'password' },
        { username: 'user3', password: 'password' },
        { username: 'user4', password: 'password' }
    ], { shard: true });
}
```
npm package: @qavajs/playwright-runner-adapter
Description: adapter for playwright test runner
Author: Alexandr Galichenko
Latest version: 2.3.0

[![npm version](https://badge.fury.io/js/@qavajs%2Fplaywright-runner-adapter.svg)](https://badge.fury.io/js/@qavajs%2Fplaywright-runner-adapter)

# @qavajs/playwright-runner-adapter
Adapter to run cucumber tests via playwright test runner

## Installation

```
npm install @qavajs/playwright-runner-adapter
```

## Basic Configuration

### Create cucumber config file
Set `paths` and `require` properties
```typescript
// cucumber.config.ts
import { defineConfig } from '@qavajs/playwright-runner-adapter';

export default defineConfig({
    paths: ['test/features/*.feature'],
    require: ['test/step_definitions/*.ts']
})
```
### Set testMatch property
Set `testMatch` to adapter
```typescript
import { defineConfig } from '@playwright/test';

export default defineConfig({
    testMatch: 'cucumber.config.ts'
});
```

## Advanced Configuration
### Customizing test instance
Custom test instance can be passed to world constructor as `test` property. 
And then fixtures can be connected with world instance via `init` function-property.
```typescript
import { test as base, expect as baseExpect } from '@playwright/test';
import { SettingsPage } from './settings-page';
import { setWorldConstructor, PlaywrightWorld } from '@qavajs/playwright-runner-adapter';

type MyFixtures = {
    settingsPage: SettingsPage;
};

const customTest = base.extend<MyFixtures>({
    settingsPage: async ({ page }, use) => {
        await use(new SettingsPage(page));
    },
});

const customExpect = baseExpect.extend({
    async customMatcher() {
        // implementation
    }
});

class ExtendedPlaywrightWorld extends PlaywrightWorld {
    settingsPage: SettingsPage;
    constructor(options: any) {
        super(options);
    }
    
    // set test property with extened one
    test = customTest;
    expect = customExpect;
    
    // init arrow function connects fixtures with Cucumber world instance
    init = ({ settingsPage }) => {
        this.settingsPage = settingsPage;
    }

}
```

### Tag expression and filter
It is possible to use regular tag expressions via `tags` util function

```typescript
import { tags } from '@qavajs/playwright-runner-adapter';
export default defineConfig({
    grep: tags('@oneTag and @anotherTag')
});
```

or filter tests by predicate

```typescript
import { filter } from '@qavajs/playwright-runner-adapter';
export default defineConfig({
    grep: filter(name => name.includes('login test'))
});
```

## Limitation
- ES modules are not supported (at least for node <= 22, where experimental ESM require is introduced)
- `setParallelCanAssign` is not supported (use playwright projects and `fullyParallel` property)
- `CUCUMBER_PARALLEL`, `CUCUMBER_TOTAL_WORKERS` and `CUCUMBER_WORKER_ID` env vars are not supported. Use built-in `info()` method of world property `test`
npm package: @qavajs/playwright-wdio
Description: steps to interact with playwright wdio adapter
Latest version: 1.0.0

# @qavajs/playwright
qavajs implementation for playwright wdio fixtures. Enables features of webdriverio with playwright test runner.

## Installation

```bash
npm install @qavajs/playwright-wdio
```

## Configuration
create `qavajs.config.ts`

```typescript
import {defineConfig } from "@qavajs/playwright-wdio";
import Memory from './memory';
import App from './page_object';

export default {
    paths: ['features/*.feature'],
    require: [
        'node_modules/@qavajs/playwright-wdio/steps.js', // package steps
        'step_definitions/*.ts' // custom step definitions
    ],
    memory: new Memory(),
    pageObject: new App()
}
```
playwright.config.ts

```typescript
import { defineConfig } from '@playwright/test';
import { WdioOptions } from '@qavajs/playwright-wdio';

export default defineConfig<WdioOptions>({
    testMatch: 'qavajs.config.ts',
    projects: [
        {
            name: 'chrome',
            use: {
                wdioLaunchOptions: {
                    logLevel: 'error',
                    capabilities: {
                        browserName: 'chrome',
                        "goog:chromeOptions": {
                            args: ['headless=new']
                        }
                    },
                }
            }
        }
    ]
});
```

## Development and testing
Install dependencies
```bash
npm install
```

Build lib
```bash
npm run build
```

Execute e2e browser tests
```bash
npm run test:e2e
```
npm package: @qavajs/po-cypress
Description: library for plain-english access to page object
Latest version: 0.2.0

## @qavajs/po-cypress

This library provides the ability to create hierarchical page objects and access elements using plain-english selectors.
Works on top of Cypress.

`npm install @qavajs/po-cypress`
## Usage

Lib provides getElement method that resolves plain-english selector and return playwright locator.
```javascript
const { po } = require('@qavajs/po-cypress');

When(/^click '(.+)'$/, async function (alias) {
    const element = await po.getElement(alias);
    await element.click();
});
```

```gherkin
When click '#1 of Multiple Component > Child Item'
```

Lib provides capability to get single element from collection by index (#index of Collection) or inner text (#text in Collection).

## Create page object

Lib provides two methods $ and $$ that allow registering elements and collections.
An element can be defined in form of webdriverIO selector or as an instance of the component class. 

Each not top-level component should have selector element in form of webdriverIO selector.
```javascript
const { $, $$ } = require('@qavajs/po-cypress');

class MultipleComponent {
    selector = '.list-components li';
    ChildItem = $('div');
}

class SingleComponent {
    selector = '.container';
    ChildItem = $('.child-item');
}

class App {
    SingleElement = $('.single-element');
    List = $$('.list li');
    SingleComponent = $(new SingleComponent());
    MultipleComponents = $$(new MultipleComponent());
}

module.exports = new App();
```
## Register PO
Before using po object need to be initiated and hierarchy of elements needs to be registered
The best place to do it is cucumber-js Before hook

```javascript
const { po } = require('@qavajs/po-cypress');
const pos = require('./app.js');
Before(async function() {
    po.init(page, { timeout: 10000 });  // page is an instance of playwright page
    po.register(pos); // pos is page object hierarchy
});
```

## Ignore hierarchy
In case if child element and parent component doesn't have hierarchy dependency
it's possible to pass extra parameter _ignoreHierarchy_ parameter to start traverse from root

```javascript
class ComponentThatDescribesNotWellDesignedDOMTree {
    selector = '.container';
    //ignoreHierarchy will ignore component selector .container and start traverse from root
    ChildItem = $('.child-item', { ignoreHierarchy: true }); 
}
```

## Optional selector property
If selector property is not provided for Component then parent element will be returned

```javascript
class ParentComponent {
    selector = '.container';
    ChildComponent = $(new ChildComponent()); 
}

class ChildComponent {
    //Element will be searched in parent .container element
    Element = $('.someElement');
}
```
npm package: @qavajs/po-testcafe
Description: library for plain-english access to test cafe page object
Latest version: 0.0.2

## @qavajs/po-testcafe

This library provides the ability to create hierarchical page objects and access elements using plain-english selectors.
Works on top of testcafe.

`npm install @qavajs/po-testcafe`
## Usage

Lib provides getElement method that resolves plain-english selector and return testcafe selector.
```javascript
const { po } = require('@qavajs/po-testcafe');

When(/^click '(.+)'$/, async function (alias) {
    const element = await po.getElement(alias);
    await element.click();
});
```

```gherkin
When click '#1 of Multiple Component > Child Item'
```

Lib provides capability to get single element from collection by index (#index of Collection) or inner text (#text in Collection).

## Create page object

Lib provides two methods $ and $$ that allow registering elements and collections.
An element can be defined in form of webdriverIO selector or as an instance of the component class. 

Each not top-level component should have selector element in form of webdriverIO selector.
```javascript
const { $, $$ } = require('@qavajs/po-testcafe');

class MultipleComponent {
    selector = '.list-components li';
    ChildItem = $('div');
}

class SingleComponent {
    selector = '.container';
    ChildItem = $('.child-item');
}

class App {
    SingleElement = $('.single-element');
    List = $$('.list li');
    SingleComponent = $(new SingleComponent());
    MultipleComponents = $$(new MultipleComponent());
}

module.exports = new App();
```
## Register PO
Before using po object need to be initiated and hierarchy of elements needs to be registered
The best place to do it is cucumber-js Before hook

```javascript
const { po } = require('@qavajs/po-testcafe');
const pos = require('./app.js');
Before(async function() {
    po.init({ timeout: 10000 });
    po.register(pos); // pos is page object hierarchy
});
```

## Ignore hierarchy
In case if child element and parent component doesn't have hierarchy dependency
it's possible to pass extra parameter _ignoreHierarchy_ parameter to start traverse from root

```javascript
class ComponentThatDescribesNotWellDesignedDOMTree {
    selector = '.container';
    //ignoreHierarchy will ignore component selector .container and start traverse from root
    ChildItem = $('.child-item', { ignoreHierarchy: true }); 
}
```

## Optional selector property
If selector property is not provided for Component then parent element will be returned

```javascript
class ParentComponent {
    selector = '.container';
    ChildComponent = $(new ChildComponent()); 
}

class ChildComponent {
    //Element will be searched in parent .container element
    Element = $('.someElement');
}
```
npm package: @qavajs/service-selenium-standalone
Description: service to work with selenium standalone
Latest version: 0.0.1

# @qavajs/service-selenium-standalone
service to work with selenium standalone

`npm install @qavajs/service-selenium-standalone`

### configuration

```javascript
module.exports = {
    default: {
        service: ['@qavajs/service-selenium-standalone']
    }
}

```
npm package: @qavajs/soft-assertion
Description: soft assertions for qavajs framework
Latest version: 0.3.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @qavajs/soft-assertion
Soft assertions for qavajs frameworks

## Installation
`npm install @qavajs/soft-assertion`

## Usage
   
Add module to requireModule.
```javascript
module.exports = {
    default: {
        requireModule: [
            '@qavajs/soft-assertion/index.js'
        ]
    }
}
```

Now you can use `softly` prefix before expect.
```gherkin
Feature: Feature

  Scenario: verify soft assert
    # first step fails but other steps will not be skipped
    Then I softly expect '2' to equal '1'
    # pass
    And I expect '1' to equal '1'
    # fail
    And I expect '2' to equal '1'
    # skip
    And I expect '1' to equal '1'
```
npm package: @qavajs/steps-accessibility
Description: Steps to perform accessibility checks
Latest version: 3.1.0

# @qavajs/steps-accessibility
Steps to perform accessibility checks using axe library.
Library can work on top of playwright and webdriverio drivers

## Installation
`npm install @qavajs/steps-accessibility`

## Configuration
```javascript
module.exports = {
    default: {
        require: [
            'node_modules/@qavajs/steps-wdio/index.js', //corresponding driver library should be imported first
            'node_modules/@qavajs/steps-accessibility/index.js'
        ],
        format: [
            '@qavajs/html-formatter:report.html'
        ],
    }
}
```

## Usage
Lib provides `I perform accessibility check` step that creates axe instance, performs checks and attach html report in base 64 format

```gherkin
Feature: Accessibility

  Scenario: perform accessibility check
    When I open 'https://qavajs.github.io/' url
    And I perform accessibility check
```
npm package: @qavajs/steps-accessibility-ea
Description: Steps to perform accessibility checks powered by accessibility-checker lib
Latest version: 0.1.1

# @qavajs/steps-accessibility
qavajs steps to perform accessibility checks using accessibility-checker library.
Library can work on top of playwright and webdriverio drivers

## Installation
```
npm install @qavajs/steps-accessibility-ea
```

## Configuration
```typescript
export default {
    require: [
        'node_modules/@qavajs/steps-wdio/index.js', //corresponding driver library should be imported first
        'node_modules/@qavajs/steps-accessibility-ea/index.js'
    ],
    format: [
        ['@qavajs/html-formatter','report.html']
    ],
}
```

## Usage
Lib provides `I perform accessibility check` step that creates axe instance, performs checks and attach html report in base 64 format

```gherkin
Feature: Accessibility

  Scenario: perform accessibility check
    When I open 'https://qavajs.github.io/' url
    And I perform accessibility check
```
npm package: @qavajs/steps-api
Description: api steps for @qavajs project
Latest version: 2.4.0

# @qavajs/steps-api
Step library to work with REST, GraphQL and websocket API

## Installation

```bash
npm install @qavajs/steps-api
```

## Configuration
```typescript
export default {
    require: [
        'node_modules/@qavajs/steps-api/index.js'
    ]
}
```
npm package: @qavajs/steps-bigcommerce
Description: Collection of BigCommerce steps for qavajs framework
Latest version: 2.0.0

# steps-bigcommerce
Collection of BigCommerce steps for qavajs framework.  
Native BigCommerce capabilities are used for customer and promotions management. Companies and addresses management is performed through the B2B Edition application.

## Installation
`npm install @qavajs/steps-bigcommerce`

## Configuration
Include following properties to the qavajs config:
```javascript
module.exports = {
    require: [
        'node_modules/@qavajs/steps-bigcommerce/index.js'
    ],
    bigCommerce: {
        storeHash: 'xxxxxxxx', //hash of your BigCommerce store 
        accessToken: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', //access token of your BigCommerce account 
        b2bAccessToken: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' //access token of your B2B Edition account
    }
}
```
npm package: @qavajs/steps-config-loader
Description: config loader for @qavajs project
Latest version: 0.0.4

# @qavajs/steps-config-loader
This is a core package to load global config and memory object. Must be a first dependency in require property

```javascript
const Memory = require('./memory');
module.exports = {
    default: {
        require: [
            '@qavajs/steps-config-loader'
        ],
        memory: new Memory()
    }
}
```

This lib comes with built-in {validation} type which resolves to function performing validation.
Implemented validations
* equal
* contain
* have members
* match
* to be above
* to be below
npm package: @qavajs/steps-ctp
Description: steps to interact with commercetools platform
Latest version: 2.0.1

[![npm version](https://badge.fury.io/js/@qavajs%2Fsteps-ctp.svg)](https://badge.fury.io/js/@qavajs%2Fsteps-playwright)

# @qavajs/steps-ctp
Step library to work with commercetools platform SDK in qavajs framework

## Installation

`npm install @qavajs/steps-ctp`

## Configuration
```javascript
const App = require('./page_object');
module.exports = {
    default: {
        require: [
            'node_modules/@qavajs/steps-ctp/index.js'
        ],
        browser: {
            timeout: {
                present: 10000,
                visible: 20000,
                page: 10000
            },
            capabilities: {
                browserName: 'chromium'
            }
        },
        pageObject: new App()
    }
}
```

## Global variables
@qavajs/steps-ctp needed following environment variables:
         
| variable          | description                                  | obligation  |
|-------------------|----------------------------------------------|-------------|
| `projectKey`      | key of the commercetools platform project    | mandatory   |
| `scopes`          | array of the ctp key scopes                  | mandatory   |
| `host_auth`       | url of the host authentication               | mandatory   |
| `host_middleware` | url of the middleware host                   | mandatory   |
| `clientId`        | id of the ctp's client                       | mandatory   |
| `clientSecret`    | secret of the ctp's client                   | mandatory   |
npm package: @qavajs/steps-cypress
Description: steps to interact with cypress
Latest version: 0.1.0

[![npm version](https://badge.fury.io/js/@qavajs%2Fsteps-cypress.svg)](https://badge.fury.io/js/@qavajs%2Fsteps-cypress)

# @qavajs/steps-cypress
Step library to work with playwright in qavajs framework

## Installation

`npm install @qavajs/steps-cypress`

### Configuration
npm package: @qavajs/steps-gmail
Description: gmail steps for @qavajs project
Latest version: 2.0.0

# @qavajs/steps-gmail
Step library to test emails via gmail client

## Installation

`npm install @qavajs/steps-gmail`

## Configuration
```javascript
module.exports = {
    default: {
        require: ['node_modules/@qavajs/steps-gmail/index.js'],
        gmail: {
            timeout: 30000, // timeout to wait email delivery
            interval: 5000 // interval to check email delivery
        }
    }
}
```
npm package: @qavajs/steps-lighthouse
Description: qavajs steps to perform lighthouse audit
Latest version: 2.0.2

# @qavajs/steps-lighthouse
qavajs steps to perform lighthouse audit.
Library can work on top of playwright and webdriverio drivers

## Installation
```
npm install @qavajs/steps-lighthouse
```

## Configuration
```typescript
export default {
    require: [
        'node_modules/@qavajs/steps-wdio/index.js', //corresponding driver library should be imported first
        'node_modules/@qavajs/steps-lighthouse/index.js'
    ],
    format: [
        ['@qavajs/html-formatter', 'report.html']
    ]
}
```

## Usage
Module provides `I perform lighthouse audit as save results as {variable}` 
step that performs audit, attaches html report and save results as \{variable} variable

```gherkin
Feature: Lighthouse

  Scenario: perform lighthouse audit
    When I open 'https://qavajs.github.io/' url
    # with default config
    And I perform lighthouse audit and save results as 'lh'
    # with provided config https://github.com/GoogleChrome/lighthouse/blob/main/docs/configuration.md
    And I perform lighthouse audit and save results as 'lh':
    """
    {
        "extends": "lighthouse:default",
        "settings": {
            "formFactor": "desktop",
            "screenEmulation": {
                "mobile": false,
                "width": 1350,
                "height": 940,
                "deviceScaleFactor": 1,
                "disabled": false
            }
        }
    }
    """
```
npm package: @qavajs/steps-sql
Description: steps to interact with relational databases
Latest version: 2.0.0

# @qavajs/steps-sql
Step library to work with relational databases

## Installation
`npm install @qavajs/steps-sql`

## Configuration
```typescript
import { MySQLClient, PgClient } from '@qavajs/steps-sql/clients';
export default {
    require: [
        '@qavajs/steps-sql'
    ],
    // provide map contains client that implemennts DBClient interface
    // if only one client exist it can be defined as default property
    dbClients: {
        default: new MySQLClient({
            host: 'http://127.0.0.1',
            port: 3306,
            database: 'qavajsdb',
            user: 'username',
            password: 'password'
        }),
        pg: new MySQLClient({
            host: 'http://127.0.0.1',
            port: 3306,
            database: 'qavajsdb2',
            username: 'username',
            password: 'password'
        }),
    }
}
```

## Implemented Clients
Corresponding DB packages need to be installed separately

| client      | description                                                         |
|-------------|---------------------------------------------------------------------|
| MySQLClient | MySQL client. Works on top of https://www.npmjs.com/package/mysql2  |
| PgClient    | PostgreSQL client. Works on top of https://www.npmjs.com/package/pg |
npm package: @qavajs/steps-testcafe
Description: steps to interact with testcafe
Latest version: 0.2.0

[![npm version](https://badge.fury.io/js/@qavajs%2Fsteps-testcafe.svg)](https://badge.fury.io/js/@qavajs%2Fsteps-testcafe)

# @qavajs/steps-testcafe
Step library to work with testcafe in qavajs framework

## Installation

`npm install @qavajs/steps-testcafe`

## Configuration
```javascript
const App = require('./page_object');
module.exports = {
    default: {
        require: [
            'node_modules/@qavajs/steps-testcafe/index.js'
        ],
        browser: {
            timeout: {
                present: 10000,
                visible: 20000,
                page: 10000
            },
            capabilities: {
                browser: 'chrome'
            }
        },
        pageObject: new App()
    }
}
```

## Screenshot strategy
@qavajs/steps-testcafe has build-in capability to take screenshot on particular event. If you need to add 
screenshot to your report add _screenshot_ property to profile config.
Supported events:
- onFail
- beforeStep
- afterStep

```javascript
module.exports = {
    default: {
        screenshot: ['onFail']
    }
}
```

## Limitations
- I save value of '<cookieName>' cookie as 'cookie' is not working in hammerhead proxy mode
npm package: @qavajs/steps-visual-testing
Description: steps to perform visual testing
Latest version: 2.1.0

# @qavajs/steps-visual-testing
Step library to perform visual testing

## installation

`npm install @qavajs/steps-visual-testing`

## configuration
```javascript
const Memory = require('./memory');

module.exports = {
    default: {
        require: [
            '@qavajs/steps-visual-testing/index.js'
        ],
        memory: new Memory()
    }
}
```
npm package: @qavajs/steps-wdio
Description: qavajs steps to interact with webdriverio
Latest version: 2.14.0

[![npm version](https://badge.fury.io/js/@qavajs%2Fsteps-wdio.svg)](https://badge.fury.io/js/@qavajs%2Fsteps-wdio)

# @qavajs/steps-wdio
**`@qavajs/steps-wdio`** provides a comprehensive set of pre-built step definitions for [qavajs](https://github.com/qavajs/qavajs), powered by [webdriver.io](https://webdriver.io/). 
It enables easy and efficient browser automation in a behavior-driven development (BDD) style using Cucumber syntax.

## Features

- Predefined steps for web automation using webdriver.io
- Seamless integration with `@qavajs/core`
- Support for dynamic locators and parameters
- Built-in assertions and synchronization steps
- Easily extendable for custom needs

## Installation

```
npm install @qavajs/steps-wdio
```

## Configuration

```typescript
import App from './page_object';

export default {
    require: [
        'node_modules/@qavajs/steps-wdio/index.js'
    ],
    browser: {
        timeout: {
            present: 10000,
            visible: 20000,
            clickable: 15000,
            page: 10000,
            implicit: 0, //wdio implicit wait for element,
            element: 2000,//timeout to element to be accesible,
            value: 5000, // expect value timeout
            valueInterval: 500 //expect value interval
        },
        capabilities: {
            browserName: 'chrome'
        }
    },
    pageObject: new App()
}
```

## Screenshots
@qavajs/steps-wdio has build-in capability to take screenshot on particular event. If you need to add 
screenshot to your report add `screenshot` property to profile config.
Supported events:
- onFail
- beforeStep
- afterStep

```typescript
export default {
    browser: {
        capabilities: {
            browserName: 'chrome'
        },
        screenshot: {
            event: ['onFail']
        }
    }
}
```

## Snapshot
@qavajs/steps-wdio has build-in capability to take page snapshot on particular event.
Supported events:
- onFail
- beforeStep
- afterStep

```typescript
export default {
    browser: {
        capabilities: {
            browserName: 'chrome'
        },
        snapshot: {
            event: ['onFail']
        }
    }
}
```

## reuseSession
`reuseSession` flag allows to share session between tests in frames of process. But setting of this flag 
transfer session control to user.

```javascript
export default {
    browser: {
        reuseSession: true
    }
}
```
npm package: @qavajs/template
Description: qavajs module to define step definitions on Gherkin language
Latest version: 1.0.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @qavajs/template
Library that allow to define step definitions on Gherkin language.

## Installation
`npm install @qavajs/template`

## Templates
```gherkin
Feature: Templates

  Scenario: I login
    When I open 'https://your-app.com'
    And I type 'username' to 'Login Form > Username Input'
    And I type 'password' to 'Login Form > Password Input'
    And I click 'Login Form > Login Button'
```

Then following template can be called from scenario as simple step

```gherkin
Feature: Auth

  Scenario: Verify that user is able to login
    When I login
    Then I expect 'Header' to be visible
```

## Configuration
To use templates their location need to be passed to templates property of config file and library need to be listed
in require
```javascript
module.exports = {
    default: {
        requireModule: [
            '@qavajs/template'
        ],
        templates: ['templates/*.feature']
    }
}

```

## Parameters  
Templates also can accept parameters as `<param>` e.g

```gherkin
Feature: Templates

  Scenario: I login as '<username>' with '<password>' password
    When I open 'https://your-app.com'
    And I type '<username>' to 'Login Form > Username Input'
    And I type '<password>' to 'Login Form > Password Input'
    And I click 'Login Form > Login Button'
```

Then following template can be called with actual params

```gherkin
Feature: Auth

  Scenario: Verify that user is able to login
    When I login as 'admin' with 'admin' password
    Then I expect 'Header' to be visible
```

## Multiline parameter
It is also possible to pass multi line parameter to template
```gherkin
Feature: TextArea

  Scenario: Verify that user is able to login
    When I set text area:
    """
    this
    is
    multiline
    text
    """
```

Multiline data can be accessed by `<qavajsMultiline>` formal parameter in template
```gherkin
Feature: Templates

  Scenario: I set text area:
    When I type '<qavajsMultiline>' to 'Form > Text Area'
```

## Key Value Params
Multiple parameters can be passed in form of key-value data table
```gherkin
Feature: TextArea

  Scenario: Verify that user is able to login
    When I fill registration form:
      | name     | John Dou                 |
      | position | Test Automation Engineer |
```

And values can be accessed by corresponding keys
```gherkin
Feature: Templates

  Scenario: I fill registration form:
    When I type '<name>' to 'Form > Name'
    When I type '<position>' to 'Form > Position'
```
npm package: @qavajs/testrail-service
Description: integration with test rail for qavajs project
Author: Dzmitry Prakapuk
Latest version: 0.0.4

## @qavajs/testrail-service
This package is formatter for Test Rail

### install
`npm install @qavajs/testrail-service

### configuration

add formatter to config.js
```javascript
module.exports = {
    default: {
        format: [
            '@qavajs/testrail-service'
        ],
        formatOptions: {
            trConfig: {
                baseURL: 'https://you-baseURL.testrail.io/',
                userName: 'your user name',
                pass: 'your password',
                runId: 'run ID in test rail'
            },
        }
    }
}
```
npm package: @qavajs/validation
Description: @qavajs library that transform plain english definition to validation functions
Latest version: 1.6.2

# @qavajs/validation

A `@qavajs` library for validating data using plain English definitions. This package simplifies the process of creating validation functions by translating human-readable sentences into executable code.

## Installation

You can install the library using `npm`:

```bash
npm install @qavajs/validation
```

## Supported Validations

This library supports a variety of validation types, which can all be negated by adding the word `not`.

### Equality & Comparison

  - **`equal`**: Checks for non-strict equality (`==`).
  - **`strictly equal`**: Checks for strict equality (`===`).
  - **`deeply equal`**: Performs a deep comparison of object properties or array elements.
  - **`deeply strictly equal`**: Performs a deep comparison of object properties or array elements with nodejs [util.isDeepStrictEqual](https://nodejs.org/api/util.html#utilisdeepstrictequalval1-val2-options)
  - **`case insensitive equal`**: Compares two values for non-strict equality after converting them to lowercase.
  - **`contain`**: Verifies if a string contains a specific substring.
  - **`include members`**: Checks if an array or object includes a specific set of members.
  - **`have members`**: Validates if an array or object has an exact match of a specified set of members.
  - **`have property`**: Ensures an object has a particular property.
  - **`above`** / **`greater than`**: Checks if a value is greater than another.
  - **`below`** / **`less than`**: Checks if a value is less than another.
  - **`match`**: Validates if a string matches a regular expression.
  - **`have type`**: Checks the type of a variable (e.g., `string`, `number`, `boolean`).
  - **`match schema`**: Validates data against an [ajv](https://www.npmjs.com/package/ajv) schema, which is useful for complex object validation.
  - **`satisfy`**: verify user-defined expectation provided as predicate


## Standalone `expect`
You can use standalone extendable `expect` with many assertions out of the box

```typescript
import { expect } from '@qavajs/validation';

expect(1).toEqual(1);
```

## Test

To run the test suite for this package, use the following command:

```bash
npm run test
```

## License

This project is licensed under the MIT License.