Parallel execution helps run multiple tests at the same time. This makes testing faster and saves time.
0
0
Parallel execution in Cypress
Introduction
You have many tests and want to finish them quickly.
You want to test your app on different browsers or devices at once.
You want to reduce waiting time during continuous integration.
You want to use multiple machines or servers to run tests together.
You want faster feedback after code changes.
Syntax
Cypress
cypress run --parallel --record --key <record-key>
Use --parallel flag to enable parallel test runs.
--record and --key are needed to connect with Cypress Dashboard for parallel support.
Examples
Runs tests in parallel using the Cypress Dashboard with the project key
abc123.Cypress
cypress run --parallel --record --key abc123
Runs tests recorded to the Dashboard but without parallel execution.
Cypress
cypress run --record --key abc123
Runs tests sequentially without recording or parallel execution.
Cypress
cypress run
Sample Program
This config sets up Cypress to run all tests in the cypress/e2e folder. Running the command with --parallel will split tests across available machines or containers to run at the same time.
Cypress
// cypress.config.js module.exports = { e2e: { setupNodeEvents(on, config) { // no special setup needed for parallel }, specPattern: 'cypress/e2e/**/*.cy.js' } } // Run command in terminal: cypress run --parallel --record --key abc123
OutputSuccess
Important Notes
You must use the Cypress Dashboard service to enable parallel execution.
Tests are split automatically based on spec files and available machines.
Make sure your tests are independent to avoid conflicts when running in parallel.
Summary
Parallel execution runs tests at the same time to save time.
Use cypress run --parallel --record --key <key> to enable it.
Requires Cypress Dashboard and independent tests for best results.