Search code examples
cucumber

How to rerun the failed scenarios using Cucumber?


I'm using Cucumber for my tests. How do I rerun only the failed tests?


Solution

  • Run Cucumber with rerun formatter:

    cucumber -f rerun --out rerun.txt
    

    It will output locations of all failed scenarios to this file.

    Then you can rerun them by using

    cucumber @rerun.txt