cucumber re-run failed scenarios automatically with a tag?

后端 未结 2 585
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-13 17:20

In our build there are certain scenarios that fail for reasons which are out of our control or take too long to debug properly. Things such asynchronous javascript etc.

相关标签:
2条回答
  • 2021-02-13 17:45

    I've been considering writing something like what you're describing, but I found this:

    http://web.archive.org/web/20160713013212/http://blog.crowdint.com/2011/08/22/auto-retry-failed-cucumber-tests.html

    If you're tired of having to re-kick builds in your CI server because of non deterministic failures, this post is for you.

    In a nutshell: he makes a new rake task called cucumber:rerun that uses rerun.txt to retry failed tests. It should be pretty easy to add some looping in there to retry at most 3x (for example).

    0 讨论(0)
  • 2021-02-13 17:56

    More recent versions of Cucumber have a retry flag

    cucumber --retry 2
    

    Will retry tests two times if it fails

    0 讨论(0)
提交回复
热议问题