This service tracks failing tests and scenarios, allowing failing or unstable tests or scenarios to be re-run.
NOTE: Currently only Webdriver.io versions 5.x and 6.x are supported. Support for version 7.x coming shortly.
retry logic built into WDIO for Cucumber and Mocha/Jasmine is helpful for handling flaky steps in Cucumber and flaky tests in Mocha/Jasmine. However, for Cucumber this does not take into account that some steps may not be able to retry and running them 2x could break the rest of the Scenario. Mocha/Jasmine is another story as the
retry logic can be applied to an entire test, however, this is still done real-time and perhaps does not account for temporal issues or netework connectivity problems.
The main distinctions of the
- will re-run an entire Cucumber Scenario by line number and not just the step
- allows for an entire Spec file to be re-run after a main test execution is complete
- can be copied and executed locally (
- can be used in conjuction with
- does not require code changes to apply
retrymethod to flaky or problematic tests
It is recommended to take some time to evaluate the options available, often times, a mixed solution maybe the solution which will provide the best real and actionable results to developers.
The easiest way is to add
devDependencies in your
You can simple do it by:
After package installation is complete, add it to
Instructions on how to install
WebdriverIO can be found here.
The following options can 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:
Directory where all the re-run JSON data will be kept during execution.
Path to write re-run Bash script.
(Cucumber-only) Set of Cucumber tags, if scenario contains tag re-run service skip analysis.
Prefix which will be added to the re-run command that is generated.
For more information on WebdriverIO see the homepage.