@studyportals/cypress-slicer

0.1.2 • Public • Published

@studyportals/cypress-slicer

Slices the Cypress tests resolved by the specPattern config property into multiple chunks and runs them in parallel.

# runs only the first third (natural sorting) of the tests
npx cypress run --env workers=3,worker=1

# runs only the the last third (natural sorting) of the tests
npx cypress run --env workers=3,worker=3

# runs only all the tests
npx cypress run --env workers=1,worker=1

npx cypress run

Install

Assuming you have Cypress installed, add this module as a dev dependency.

# using NPM
npm i -D @studyportals/cypress-slicer
# using Yarn
yarn add -D @studyportals/cypress-slicer

Note: @studyportals/cypress-slicer only works with Cypress version >= 10.

Config file

optional: load and register this module from the config file:

// cypress.config.js
{
  e2e: {
    setupNodeEvents(on, config) {
      require('@studyportals/cypress-slicer/plugin')(config);
      return config;
  },
  }
}

Usage Overview

The number of chunks is determined by the workers environment variable. The worker environment variable determines which chunk to run.

You can configure the number of workers and the worker index through the env property of the configuration defined in the cypress.config.js file:

{
  env: {
    workers: process.env.WORKERS,
    worker: process.env.WORKER,
  }
}

The worker index is 1-based, not 0-based.

Readme

Keywords

Package Sidebar

Install

npm i @studyportals/cypress-slicer

Weekly Downloads

113

Version

0.1.2

License

ISC

Unpacked Size

5.27 kB

Total Files

8

Last publish

Collaborators

  • jordi-studyportals
  • fationsh
  • orlandoliccardo
  • ozanborafikir
  • prestonvantonder
  • mrmaruf-studyportal
  • alparslanylmaz
  • georgianaschipor
  • tamassoos
  • dandobrescu
  • gilalves95
  • martinestudyportals
  • simaopcsantos
  • skrothapalli1
  • armandduijnstudyportals
  • borismo
  • alexandramarginean
  • jooshuys
  • studyportals-devops
  • jens-sp
  • stormyy
  • stefanklokgieters
  • royvaneijndhovensp