Socket
Socket
Sign inDemoInstall

cypress-parallel

Package Overview
Dependencies
97
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cypress-parallel

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


Version published
Weekly downloads
92K
decreased by-11.87%
Maintainers
1
Install size
7.23 MB
Created
Weekly downloads
 

Readme

Source

npm version

cypress-parallel

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

cypresscypress-parallel
cy-serial-smallcy-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

or

Run with npx (no package installation needed)

npx cy:parallel -s cy:run -t 2 -d <your-cypress-specs-folder> -a '\"<your-cypress-cmd-args>\"'

Scripts options

OptionAliasDescriptionType
--helpShow help
--versionShow version number
--script-sYour npm Cypress commandstring
--args-aYour npm Cypress command argumentsstring
--threads-tNumber of threadsnumber
--specsDir-dCypress specs directorystring
--weightsJson-wParallel weights json filestring
--reporter-rReporter to pass to Cypress.string
--reporterOptions-oReporter optionsstring
--reporterModulePath-nSpecify the reporter module pathstring
--bail-bExit on first failing threadstring
--verbose-vSome additional loggingstring
--strictMode-mAdd stricter checks after running the testsboolean

NB: If you use cypress-cucumber-preprocesor, please disable the strictMode to avoid possible errors:

"scripts" :{
  ...
  "cy:parallel" : "cypress-parallel -s cy:run -t 4 -m false"
  ...
}

NB: If your cypress-multi-reporters module is not found on the same level as your Cypress suite (e.g. in a mono-repo) then you can specify the module directory for Cypress to search within.

"scripts" :{
  ...
  "cy:parallel" : "cypress-parallel -s cy:run -t 4 -n .../../../node_modules/cypress-multi-reporters"
  ...
}

Contributors

Looking for contributors.

License

MIT

Keywords

FAQs

Last updated on 03 Dec 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc