{"id":18438765,"url":"https://github.com/webdriverio-community/wdio-rerun-service","last_synced_at":"2026-04-08T01:01:07.662Z","repository":{"id":37710666,"uuid":"286504868","full_name":"webdriverio-community/wdio-rerun-service","owner":"webdriverio-community","description":"WebdriverIO plugin for automatic re-runs of failed/flaky tests. Supports Cucumber scenarios, Mocha, and Jasmine.","archived":false,"fork":false,"pushed_at":"2026-02-13T20:50:45.000Z","size":1404,"stargazers_count":11,"open_issues_count":5,"forks_count":14,"subscribers_count":9,"default_branch":"main","last_synced_at":"2026-02-18T19:47:37.073Z","etag":null,"topics":["automation","ci-cd","cucumber-framework","e2e-testing","flaky-tests","gherkin","integration-testing","jasmine-tests","javascript-es6","mochajs","nodejs","selenium","test-automation-framework","test-retry","testing-tool","typescript","wdio","wdio-plugin","webdriverio-framework"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/wdio-rerun-service","language":"TypeScript","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/webdriverio-community.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":"CODE_OF_CONDUCT.md","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-08-10T14:58:34.000Z","updated_at":"2026-02-13T20:50:49.000Z","dependencies_parsed_at":"2024-06-18T21:19:30.110Z","dependency_job_id":"c14865d0-d904-4833-96f6-c4dd14781ca8","html_url":"https://github.com/webdriverio-community/wdio-rerun-service","commit_stats":{"total_commits":64,"total_committers":13,"mean_commits":4.923076923076923,"dds":0.515625,"last_synced_commit":"35ba8cbf053d05073479adb0081e8f25dd1ecc02"},"previous_names":["jwplayer/wdio-rerun-service"],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/webdriverio-community/wdio-rerun-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webdriverio-community%2Fwdio-rerun-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webdriverio-community%2Fwdio-rerun-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webdriverio-community%2Fwdio-rerun-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webdriverio-community%2Fwdio-rerun-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webdriverio-community","download_url":"https://codeload.github.com/webdriverio-community/wdio-rerun-service/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webdriverio-community%2Fwdio-rerun-service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31535203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["automation","ci-cd","cucumber-framework","e2e-testing","flaky-tests","gherkin","integration-testing","jasmine-tests","javascript-es6","mochajs","nodejs","selenium","test-automation-framework","test-retry","testing-tool","typescript","wdio","wdio-plugin","webdriverio-framework"],"created_at":"2024-11-06T06:21:40.344Z","updated_at":"2026-04-08T01:01:07.656Z","avatar_url":"https://github.com/webdriverio-community.png","language":"TypeScript","funding_links":["https://opencollective.com/webdriverio"],"categories":[],"sub_categories":[],"readme":"# WebdriverIO Re-run Service\n\n[![CI](https://github.com/webdriverio-community/wdio-rerun-service/actions/workflows/test.yml/badge.svg)](https://github.com/webdriverio-community/wdio-rerun-service/actions/workflows/test.yml)\n![Unit Test Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen)\n![E2E Tests](https://img.shields.io/badge/e2e-49%20tests-brightgreen)\n![npm](https://img.shields.io/npm/v/wdio-rerun-service)\n![npm downloads](https://img.shields.io/npm/dm/wdio-rerun-service)\n![node](https://img.shields.io/node/v/wdio-rerun-service)\n![TypeScript](https://img.shields.io/badge/TypeScript-100%25-blue)\n![Zero Dependencies](https://img.shields.io/badge/dependencies-0-brightgreen)\n![License](https://img.shields.io/github/license/webdriverio-community/wdio-rerun-service)\n\nThis service tracks failing Mocha or Jasmine tests and Cucumber scenarios executed within the [WebdriverIO](https://webdriver.io) test framework. It will allow failing or unstable tests or scenarios to be re-run.\n\n## Features\n\n- 🔄 Re-run failed Mocha, Jasmine, or Cucumber tests after the main test run completes\n- 🥒 Full Cucumber support including scenarios inside `Rule:` blocks\n- 🏷️ Filter out scenarios with specific tags from re-runs\n- 🪟 Cross-platform support (generates `rerun.sh` on Unix, `rerun.bat` on Windows)\n- ⚙️ Configurable command prefix and custom parameters\n\n## Quality \u0026 Reliability\n\n- ✅ **100% test coverage** — comprehensive unit and E2E tests\n- 🧪 **E2E tests** — real WebdriverIO runs across Cucumber, Mocha, and Jasmine\n- 🖥️ **Cross-platform CI** — tested on macOS, Windows, and Linux\n- 📦 **Zero runtime dependencies** — only WebdriverIO peer dependencies, minimal footprint\n- 🔷 **100% TypeScript** — fully typed for great IDE support\n- 🚀 **Modern Node.js** — uses native APIs (`crypto.randomUUID`, `util.parseArgs`)\n- 📤 **Exported types** — `RerunServiceOptions` interface exported for TypeScript consumers\n\n## Compatibility\n\n| wdio-rerun-service | WebdriverIO | Node.js |\n|--------------------|-------------|---------|\n| `^3.0.0`           | `^8.0.0 \\|\\| ^9.0.0` | `\u003e=20`  |\n| `^2.1.0`           | `^8.0.0 \\|\\| ^9.0.0` | `\u003e=18` |\n| `^2.0.0`           | `^8.0.0`    | `\u003e=18` |\n| `^1.7.0`           | `^7.0.0`    | `\u003e=14` |\n\n## Re-run vs. Retry\n\nThe `retry` logic built into WebdriverIO for Cucumber and Mocha/Jasmine is helpful for handling flaky steps in Cucumber and Mocha/Jasmine. Retrying in each framework has caveats:\n\n- **Cucumber:** It does not take into account that some steps may not be able to be retried in the middle of a test. Running a step twice may break the rest of the Scenario or it may not be possible in the test context.\n- **Mocha/Jasmine:** The `retry` logic may be applied to an individual test, however, this is still done in real-time and perhaps does not account for temporal issues or network connectivity problems.\n\nThe main distinctions of the `re-run`:\n\n- Will re-run an entire individual Cucumber Scenario and not just a single step\n- Enables an entire spec file to be re-run after a main test execution is complete\n- May be copied and executed locally (`retry` cannot)\n- Can still be used in conjunction with `retry` methods\n- Does not require any code change to apply `retry` logic to flaky or problematic tests\n\nIt is recommended to take some time to evaluate the options available. A hybrid solution may be the best solution to provide the best real and actionable test results.\n\n## Installation\n\nUsing `npm`:\n\n```bash\nnpm install wdio-rerun-service\n```\n\nUsing `yarn`:\n\n```bash\nyarn add wdio-rerun-service\n```\n\nUsing `pnpm`:\n\n```bash\npnpm add wdio-rerun-service\n```\n\nAfter package installation is complete, add it to `services` array in `wdio.conf.js`:\n\n```js\n// wdio.conf.js\nimport RerunService from 'wdio-rerun-service';\nexport const config = {\n    // ...\n    services: [\n        [RerunService, {\n            // Re-run service options here...\n        }]\n    ],\n    // ...\n};\n```\n\nInstructions on how to install `WebdriverIO` can be found in the [official documentation](https://webdriver.io/docs/gettingstarted.html).\n\n## Usage\n\nBy design, this service does not automatically re-run failed tests.\n\nAfter WebdriverIO has completed execution, if failures are found, a re-run script will be generated at **rerunScriptPath** (default: `./rerun.sh` on Unix, `./rerun.bat` on Windows).\n\nYou can then execute this script manually or integrate it into your CI pipeline.\n\n### Disabling Re-run\n\nSet the environment variable `DISABLE_RERUN=true` to disable the service (useful during re-run execution to prevent infinite loops).\n\n### Conditional Re-run\n\nEvery team's re-run needs will differ—execution could be based on any number of factors. This is an example of how to accomplish a conditional re-run based on number of failures.\n\n#### attemptRerun.sh\n\nExecutes `./rerun.sh` if less than 25 failures have been found in the last execution of WebdriverIO.\n\n```sh\n#!/usr/bin/env bash\nMAX_TO_RERUN=${MAX_TO_RERUN:=25}\nif [ -f \"rerun.sh\" ]; then\n  echo \"[rerun.sh] file exists, checking total failures.\"\n  NUMBER_OF_FAILURES=$(grep \"\\-\\-spec\" -o rerun.sh | wc -l | xargs)\n  if [ \"$MAX_TO_RERUN\" -gt \"$NUMBER_OF_FAILURES\" ]; then\n    echo \"Re-running $NUMBER_OF_FAILURES failed scenarios!\"\n    . ./rerun.sh\n  else\n    echo \"Skipping re-run, expected \u003c $MAX_TO_RERUN failures.\"\n    echo \"Got $NUMBER_OF_FAILURES failures.\"\n  fi\nelse\n  echo \"No [rerun.sh] file exists, skipping re-run!\"\nfi\n```\n\n#### Bash Re-run Command\n\nExecute in shell:\n\n```sh\n. ./attemptRerun.sh\n```\n\n#### Integrate with NPM\n\nAdd task in `package.json`:\n\n```json\n\"attempt-rerun\": \". ./attemptRerun.sh\"\n```\n\n#### NPM Re-run Command\n\nExecute in shell:\n\n```sh\nnpm run attempt-rerun\n```\n\n## Configuration\n\nThe following options may be added to the wdio.conf.js file. To define options for the service you need to add the service to the `services` list in the following way:\n\n```js\n// wdio.conf.js\nimport RerunService from 'wdio-rerun-service';\nexport const config = {\n    // ...\n    services: [\n        [RerunService, {\n            // Re-run service options here...\n        }]\n    ],\n    // ...\n};\n```\n\n### rerunDataDir\n\nDirectory where all the re-run JSON data will be kept during execution.\n\nType: `String`\n\nDefault: `./results/rerun`\n\nExample:\n\n```js\nimport RerunService from 'wdio-rerun-service';\nexport const config = {\n    // ...\n    services: [\n        [RerunService, {\n            rerunDataDir: './custom-rerun-directory'\n        }]\n    ],\n    // ...\n}\n```\n\n### rerunScriptPath\n\nPath to write the re-run script.\n\nType: `String`\n\nDefault: `./rerun.sh` (Unix) or `./rerun.bat` (Windows)\n\nExample:\n\n```js\nimport RerunService from 'wdio-rerun-service';\nexport const config = {\n    // ...\n    services: [\n        [RerunService, {\n            rerunScriptPath: './custom-path-for-rerun.sh'\n        }]\n    ],\n    // ...\n}\n```\n\n### ignoredTags\n\n(Cucumber-only) Set of Cucumber tags to exclude. If scenario contains a tag, the re-run service will skip analysis.\n\nType: `Array`\n\nDefault: `[]`\n\nExample:\n\n```js\nimport RerunService from 'wdio-rerun-service';\nexport const config = {\n    // ...\n    services: [\n        [RerunService, {\n            ignoredTags: ['@known_bug']\n        }]\n    ],\n    // ...\n}\n```\n\n### commandPrefix\n\nPrefix which will be added to the re-run command that is generated.\n\nType: `String`\n\nDefault: `''`\n\nExample:\n\n```js\nimport RerunService from 'wdio-rerun-service';\nexport const config = {\n    // ...\n    services: [\n        [RerunService, {\n            commandPrefix: \"VARIABLE=true\"\n        }]\n    ],\n    // ...\n}\n```\n\n### customParameters\n\nParameters which will be added to the re-run command that is generated.\nCan be used with `commandPrefix`.\n\nType: `String`\n\nDefault: `''`\n\nExample:\n\n```js\nimport RerunService from 'wdio-rerun-service';\nexport const config = {\n    // ...\n    services: [\n        [RerunService, {\n            customParameters: \"--foobar\"\n        }]\n    ],\n    // ...\n}\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n```bash\n# Clone the repo\ngit clone https://github.com/webdriverio-community/wdio-rerun-service.git\n\n# Install dependencies\npnpm install\n\n# Run tests\npnpm test\n```\n\n### 💰 Contributor Compensation\n\nThis project participates in the [WebdriverIO Open Collective](https://opencollective.com/webdriverio) expense program. Contributors may be compensated for their work on accepted PRs. The amount is determined by the WebdriverIO Technical Steering Committee based on the scope and impact of the contribution.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdriverio-community%2Fwdio-rerun-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebdriverio-community%2Fwdio-rerun-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdriverio-community%2Fwdio-rerun-service/lists"}