-
-
Save alexander-williamson/94fc5421c8fdbe93e4539a9472c1c346 to your computer and use it in GitHub Desktop.
retry wrapper for cucumber steps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def patiently(&block) | |
cycles = 0 | |
begin | |
yield | |
rescue => e | |
cycles += 1 | |
sleep 0.1 | |
if cycles < 10 | |
retry | |
else | |
raise e | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment