Today I Learned

hashrocket A Hashrocket project

Rerun Failed Cucumber Tests

An underused trick in Cucumber is the rerun format.

Run your suite like so:

$ cucumber -f rerun -o rerun.txt

This runs your tests with the rerun formatter, sending the output to rerun.txt. After breaking a test, here’s my generated file:

$ cat rerun.txt                                                                                                                                                 
features/visitor_views_posts.feature:9

Now we can run again against just the failing example!

$ cucumber @rerun.txt

Use this to drill down through a giant integration test suite.

See More #testing TILs