npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@qavajs/cli

v1.0.0

Published

cli for qavajs framework

Downloads

1,153

Readme

npm version

@qavajs/cli

Cli for @qavajs framework.

npm install @qavajs/cli

Run tests

npx qavajs run --config <config> --profile <profile> or npx qavajs --config <config> --profile <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 overridden

example

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.

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

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

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

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'); |