Example scripts to play with Cypress locally and running in several processes.
Each script supports arguments:
executors
- number of chainers which are picking specs to run;filter
- filtering specs path by keyword;
Is a pool of promises using recursion - runner_recursive.js
yarn cy:run:recursive
- single executoryarn cy:run:recursive:parallel:empty
- with filteringyarn cy:run:recursive:parallel
- all specs
Is an event based runner with queue - runner_queue.js. Node v12+ is required.
runner_queue
tries to solve an issue with several Cypress xvfb instances spawned at same time and fighting for same resource causing skipping some suites. Now a parameter timeout
could be configured, which blocks new instance from spawning cypress if timeout from previous start has not finished. Value of timeout
should be some +/- average time between starting cypress and opened browser, and it depends on your test suite size and available machine resources.
yarn cy:run:queue
- single executoryarn cy:run:queue:parallel:empty
- with filteringyarn cy:run:queue:parallel
- all specs
Is basically a runner_recursive
but handles spec files with external parallel-specs service to distribute spec files across processes - runner_recursive_service.js
Uses parallel-specs-client library to interact with parallel-specs service api.
runner_recursive_service
is meant to solve an issue of distributing spec files by their expected duration in order to optimize total execution time
- obtain account at parallel-specs
- obtain api key at api keys page
- set
.env
file variablesPARALLEL_SPECS_PROJECT_NAME
andPARALLEL_SPECS_API_KEY
, example - example.env
yarn cy:run:recursive:service
- single executoryarn cy:run:recursive:service:parallel:empty
- with filteringyarn cy:run:recursive:service:parallel
- all specs
How to run any command with mochawesome report:
yarn prereport
yarn cy:run:recursive:parallel:empty
yarn postreport