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

parallel-cucumber

v1.1.0

Published

Executes Cucumber scenarios in parrallel, reducing the amount of time tests take to execute

Downloads

295

Readme

parallel-cucumber-js

Build Status Dependencies Code Climate

NPM NPM

Executes Cucumber scenarios in parallel, reducing the amount of time tests take to execute.

parallel-cucumber-js uses multiple node.js processes to execute more than one Cucumber feature at a time. This can greatly reduce the time it takes for a test suite to execute. However, a test suite needs to be built with parallization in mind; especially when the Cucumber features are accessing shared resources like a database-backed web service.

Usage

Install

parallel-cucumber-js is available as an npm module called parallel-cucumber.

parallel-cucumber-js should be added to your test codebase as a dev dependency. You can do this with:

$ npm install --save-dev parallel-cucumber

Alternatively you can manually add it to your package.json file:

{
  "devDependencies" : {
    "parallel-cucumber": "latest"
  }
}

then install with:

$ npm install --dev

Run

parallel-cucumber-js can be ran from a terminal as follows:

$ node_modules/.bin/parallel-cucumber-js

By default parallel-cucumber will look for features files under a directory called ./features

Number of Workers

The number of features that will be executed in parallel can be set by passing the -w argument:

$ node_modules/.bin/parallel-cucumber-js -w 4

Setting the number of workers controls the amount of parallization. The larger the number of workers, the more Cucumber feature will be executed in parallel. By default the number of workers is set to the number of CPU cores in the machine running parallel-cucumber.

Profiles

parallel-cucumber can execute the same scenario multiple times. This can be useful for things like executing the same tests against both a desktop browser and mobile browser.

$ node_modules/.bin/parallel-cucumber-js --profile.desktop.tags ~@mobile-only --profile.mobile.tags ~@desktop-only

parallel-cucumber sets an environment variable called PARALLEL_CUCUMBER_PROFILE which can be used within the Cucumber step defs and support code to determine which profile is currently executing.

Environment variables

Environment variables can be specified for a profile and those environment variables will be set when the Cucumber scenarios are executed for the profile:

$ node_modules/.bin/parallel-cucumber-js --profile.desktop.env.EXAMPLE_NAME example_value --profile.desktop.env.EXAMPLE_NAME_2 example_value_2

Formats

Two output formats are supported: json and progress. The progress format is the default. The -f argument is used to configure a different format:

$ node_modules/.bin/parallel-cucumber-js -f json

By default, output is sent to the console but you can also send it to a file:

$ node_modules/.bin/parallel-cucumber-js -f json:./output.json

You can configure multiple formats, with each format configured to output to the console or a file:

$ node_modules/.bin/parallel-cucumber-js -f json:./output.json -f progress

Example

See https://github.com/simondean/parallel-cucumber-js-example for an example test codebase that uses parallel-cucumber-js.