Reduce up to 40% your Cypress suite execution time parallelizing the test run on the same machine.
🔍 - 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
npm i finalcut/cypress-parallel
or
yarn add finalcut/cypress-parallel
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>\"'"
...
}
Sample:
cypress-parallel -s cy:run -t 2 -d cypress -a '\"--config baseUrl=http://localhost:3000\"'
npm run cy:parallel
Option | Alias | Description | Type | Default |
---|---|---|---|---|
--help | Show help | |||
--version | Show version number | |||
--script | -s | Your npm Cypress command | string | |
--args | -a | Your npm Cypress command arguments | string | |
--specsDir | -d | Cypress specs directory. | string | cypress/integration |
--weightFile | -w | if a weights file should be crated | bool | false |
--threads | -t | Number of threads; must be even # | number | 4 |
- Original Author: https://github.com/tnicola
- Total Test Time: https://github.com/stepn1k
- Updates and cleanup: https://github.com/sezane
- Few small tweaks: me @ https://github.com/finalcut
MIT