dstala / cypress-parallel

Reduce up to 40% your Cypress suite execution time parallelizing the test run on the same machine.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

npm version

cypress-parallel

Reduce up to 40% your Cypress suite execution time parallelizing the test run on the same machine.

cypress cypress-parallel
cy-serial-small cy-parallel_small

Run your Cypress tests in parallel (locally)

How it works

๐Ÿ” - Search for existing Cypress tests
๐Ÿ“„ - Read (if exists) a weight file
โš–๏ธ - Split spec files into different threads
โš™๏ธ - For each thread it runs the Cypress command you've passed as argument
๐Ÿ“ˆ - Wait for all threads to finish and collects the result in a single report

How to use

Install

npm i cypress-parallel

or

yarn add cypress-parallel

Add a new script

In your package.json add a new script:

"scripts" :{
  ...
  "cy:run": "cypress run", // It can be any cypress command with any argument
  "cy:parallel" : "cypress-parallel -s cy:run -t 2 -d <your-cypress-specs-folder> -a '\"<your-cypress-cmd-args>\"'"
  ...
}

With Arguments

Sample:

-a '\"--config baseUrl=http://localhost:3000\"'

Launch the new script

npm run cy:parallel

Scripts options

Option Alias Description Type
--help Show help
--version Show version number
--script -s Your npm Cypress command string
--args -a Your npm Cypress command arguments string
--threads -t Number of threads number
--specsDir -d Cypress specs directory. string
--reporter -r Reporter to pass to Cypress. string
--reporterOptions -o Reporter options string
--bail -b Exit on first failing thread string
--verbose -v Some additional logging string

Contributors

Looking for contributors.

License

MIT

About

Reduce up to 40% your Cypress suite execution time parallelizing the test run on the same machine.


Languages

Language:JavaScript 72.4%Language:TypeScript 20.8%Language:SCSS 4.8%Language:CSS 1.5%Language:HTML 0.5%