{"id":13492655,"url":"https://github.com/tnicola/cypress-parallel","last_synced_at":"2025-04-29T18:51:13.436Z","repository":{"id":37948175,"uuid":"266495444","full_name":"tnicola/cypress-parallel","owner":"tnicola","description":"Reduce up to 40% your Cypress suite execution time parallelizing the test run on the same machine.","archived":false,"fork":false,"pushed_at":"2025-03-22T09:44:12.000Z","size":1413,"stargazers_count":593,"open_issues_count":69,"forks_count":126,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-10T04:53:09.276Z","etag":null,"topics":["cypress","localhost","parallel","shard","sharding"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tnicola.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-24T07:58:22.000Z","updated_at":"2025-03-31T11:37:03.000Z","dependencies_parsed_at":"2023-02-15T11:46:58.992Z","dependency_job_id":"a1c44fc0-fd28-4f75-9694-44a1000c0901","html_url":"https://github.com/tnicola/cypress-parallel","commit_stats":{"total_commits":161,"total_committers":30,"mean_commits":5.366666666666666,"dds":0.782608695652174,"last_synced_commit":"f758d4533ee3df353641cb529c6ae0ab4bfa52e4"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tnicola%2Fcypress-parallel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tnicola%2Fcypress-parallel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tnicola%2Fcypress-parallel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tnicola%2Fcypress-parallel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tnicola","download_url":"https://codeload.github.com/tnicola/cypress-parallel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251564839,"owners_count":21609966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cypress","localhost","parallel","shard","sharding"],"created_at":"2024-07-31T19:01:07.945Z","updated_at":"2025-04-29T18:51:13.417Z","avatar_url":"https://github.com/tnicola.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"[![npm version](https://badge.fury.io/js/cypress-parallel.svg)](https://badge.fury.io/js/cypress-parallel)\n\n# cypress-parallel\n\nReduce up to 40% your Cypress suite execution time parallelizing the test run on the same machine.\n\n|                                                          cypress                                                          |                                                      cypress-parallel                                                       |\n| :-----------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------: |\n| ![cy-serial-small](https://user-images.githubusercontent.com/38537547/114301114-92600a80-9ac3-11eb-9166-e95ae9cd5178.gif) | ![cy-parallel_small](https://user-images.githubusercontent.com/38537547/114301127-9db33600-9ac3-11eb-9bfc-c2096023bba7.gif) |\n\n# Run your Cypress tests in parallel (locally)\n\n## How it works\n\n🔍 - Search for existing Cypress tests\\\n📄 - Read (if exists) a weight file\\\n⚖️ - Split spec files into different threads\\\n⚙️ - For each thread it runs the Cypress command you've passed as argument\\\n📈 - Wait for all threads to finish and collects the result in a single report\n\n# How to use\n\n## Install\n\n```\nnpm i cypress-parallel -D\n```\n\nor\n\n```\nyarn add cypress-parallel -D\n```\n\n## Add a new script\n\nIn your `package.json` add a new script:\n\n```typescript\n\"scripts\" :{\n  ...\n  \"cy:run\": \"cypress run\", // It can be any cypress command with any argument\n  \"cy:parallel\" : \"cypress-parallel -s cy:run -t 2 -d '\u003cyour-cypress-specs-folder\u003e' -a '\\\"\u003cyour-cypress-cmd-args\u003e\\\"'\"\n  ...\n}\n```\n\n### With Arguments\n\nSample:\n\n```\n-a '\\\"--config baseUrl=http://localhost:3000\\\"'\n```\n\n## Launch the new script\n\n```\nnpm run cy:parallel\n```\n\nor \n\nRun with npx (no package installation needed)\n\n```\nnpx cy:parallel -s cy:run -t 2 -d '\u003cyour-cypress-specs-folder\u003e' -a '\"\u003cyour-cypress-cmd-args\u003e\"'\n```\n\n## Passing Specs\n\n```\ncypress-parallel -s cy:run -t 2 -a '\\\"\u003cyour-cypress-cmd-args\u003e\\\"' --spec path/to/spec1.spec.js path/to/spec2.spec.js\n```\n\n### Scripts options\n\n| Option            | Alias | Description                        | Type   |\n| ----------------- | ----- | ---------------------------------- | ------ |\n| --help            |       | Show help                          |        |\n| --version         |       | Show version number                |        |\n| --script          | -s    | Your npm Cypress command           | string |\n| --args            | -a    | Your npm Cypress command arguments | string |\n| --threads         | -t    | Number of threads                  | number |\n| --specsDir        | -d    | Cypress specs directory            | string |\n| --spec            |       | Cypress spec file paths            | string |\n| --weightsJson     | -w    | Parallel weights json file         | string |\n| --reporter        | -r    | Reporter to pass to Cypress.       | string |\n| --reporterOptions | -o    | Reporter options                   | string |\n| --reporterModulePath | -n    | Specify the reporter module path   | string |\n| --bail            | -b    | Exit on first failing thread       | string |\n| --verbose         | -v    | Some additional logging            | string |\n| --strictMode      | -m    | Add stricter checks after running the tests           | boolean |\n\n**NB**: If you use *cypress-cucumber-preprocesor*, please **disable** the *strictMode* to avoid possible errors:\n\n```typescript\n\"scripts\" :{\n  ...\n  \"cy:parallel\" : \"cypress-parallel -s cy:run -t 4 -m false\"\n  ...\n}\n```\n\n**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.\n\n```typescript\n\"scripts\" :{\n  ...\n  \"cy:parallel\" : \"cypress-parallel -s cy:run -t 4 -n .../../../node_modules/cypress-multi-reporters\"\n  ...\n}\n```\n\n## Env variables\n\n### CYPRESS_THREAD\n\nYou can get the current thread index by reading the `CYPRESS_THREAD` variable.\n\n```javascript\n const threadIndex = process.env.CYPRESS_THREAD;\n // return 1, 2, 3, 4, ...\n```\n\n# Contributors\n\nLooking for contributors.\n\n# License\n\nThis project is licensed under the MIT license. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftnicola%2Fcypress-parallel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftnicola%2Fcypress-parallel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftnicola%2Fcypress-parallel/lists"}