File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 38
38
39
39
require 'pry'
40
40
41
+ require 'rspec/retry'
42
+
43
+
41
44
RSpec . configure do |config |
45
+ # repeat flaky tests
46
+ # show retry status in spec process
47
+ config . verbose_retry = true
48
+ # show exception that triggers a retry if verbose_retry is set to true
49
+ config . display_try_failure_messages = true
50
+
51
+ # run retry only on features
52
+ config . around :each , :js do |ex |
53
+ ex . run_with_retry retry : 5
54
+ end
55
+
56
+ # callback to be run between retries
57
+ config . retry_callback = proc do |ex |
58
+ # run some additional clean up task - can be filtered by example metadata
59
+ if ex . metadata [ :js ]
60
+ Capybara . reset!
61
+ end
62
+ end
42
63
# config.include Capybara::DSL
43
64
# rspec-expectations config goes here. You can use an alternate
44
65
# assertion/expectation library such as wrong or the stdlib/minitest
You can’t perform that action at this time.
0 commit comments