Playwright
Playwright will use as many workers as CPU cores are available when the workers: process.env.CI value is undefined.
As an approximation, use:
node -e "console.log(require('os').cpus().length)"
Cypress
There a few ways to handle multiple workers.
- Cypress Dashboard (official way):
Use --record --parallel (and a project record key).
The Dashboard load-balances specs across multiple CI machines/containers. - Without the dashboard, Cypress runs serially.
- In CI/CD pipelines, sharding can be accomplished manually.