Giter Club home page Giter Club logo

cypress-utils's Introduction

Cypress Utils

Easily parallelize and stress-test your Cypress tests

Cypress Utils is a command-line interface for parallelizing and stress-testing your Cypress tests.

To get started, just run npx cypress-utils --help.

Commands

Run tests in parallel

To speed up day-to-day local Cypress test runs (e.g. before committing changes to a branch), multiple Cypress test runners can be ran in parallel. The impact on system resources is surprisingly manageable, even with multiple concurrent runners.

In my unscientific n=1 sample size of running an entire suite, specifying two concurrent test runners provided the best results.

The total elapsed time was reduced by 38% when running a set of 12 tests in two concurrent threads

To run the entire suite in parallel, exclude any additional command-line arguments:

  cypress-utils run-parallel

To run two or more test files in parallel, simply specify the files to run:

  cypress-utils run-parallel specFileA specfileB

Example of running tests in parallel:

Example of running the run parallel command

Stress test

To ensure your Cypress tests are not irregularly failing with false-negatives, stress testing new test files can be a reliable way of filtering out bad test code.

To stress test one or more test files, simply specify the files to run:

  cypress-utils stress-test specFileA specfileB

Additional command-line options may be specified, such as the sample size or number of concurrent threads:

 cypress-utils stress-test --trialCount 12 --threads 4

Example of stress testing:

Example of running the stress test command

Installation

Install Cypress Utils to your project as a development dependency:

npm install --save-dev cypress-utils

Or run it once with the node package runner:

npx cypress-utils --help

Development Setup

  1. Clone the repository:
git clone https://github.com/trentrand/cypress-utils.git
  1. Install package dependencies:
cd /path/to/cypress-utils
npm install
  1. Make cypress-utils globally executable:
npm link

Cypress Utils are now executable globally with the command cypress-utils.

cypress-utils's People

Contributors

trentrand avatar dependabot[bot] avatar samwyldkw avatar istateside avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.