@split-tests/cypress
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Split Tests in Cypress

Splits test files in Cypress and ensures all parallel jobs finish work at a similar time.

Before

Job Time
=========================== 1 46 minutes
======== 2 13 minutes
============ 3 19 minutes

After

Job Time
============= 1 26 minutes
============= 2 26 minutes
============= 3 26 minutes

Setup

Install @split-tests/cypress package:

npm install --save-dev @split-tests/cypress
yarn add -D @split-tests/cypress

In cypress/plugins/index.js:

const plugin = require("@split-tests/cypress");

module.exports = plugin;

Use JUnit to report run times of the tests (in cypress.json):

{
  "reporter": "junit",
  "reporterOptions": {
    "mochaFile": "reports/junit-[hash].xml"
  }
};

Usage

Jobs are calculated at run time:

$ CYPRESS_JOBS_TOTAL=3 CYPRESS_JOBS_INDEX=0 jest
  • CYPRESS_JOBS_TOTAL - total number of jobs
  • CYPRESS_JOBS_INDEX - index number of the job (starts with 0)

Package Sidebar

Install

npm i @split-tests/cypress

Weekly Downloads

773

Version

0.1.0

License

MIT

Unpacked Size

16.2 kB

Total Files

8

Last publish

Collaborators

  • kamilkisiela
  • dotansimha