How to rerun the failed scenarios using Cucumber?

Kalyan picture Kalyan · Jul 30, 2012 · Viewed 41.5k times · Source

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

Answer

Andrei Botalov picture Andrei Botalov · Jul 30, 2012

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