diff --git a/Gemfile b/Gemfile index 06d4cc318..28de94c3b 100644 --- a/Gemfile +++ b/Gemfile @@ -193,10 +193,12 @@ group :test do gem 'selenium-webdriver' gem 'timecop' gem 'vcr' + gem "rspec-rebound" + gem "percy-capybara", "~> 5.0.0" end group :travis do gem 'platform-api' end -gem "percy-capybara", "~> 5.0.0" + diff --git a/Gemfile.lock b/Gemfile.lock index 43e3692cb..1e0965804 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -262,9 +262,9 @@ GEM factory_bot_rails (6.5.0) factory_bot (~> 6.5) railties (>= 6.1.0) - faker (3.5.1) + faker (3.5.2) i18n (>= 1.8.11, < 2) - faraday (2.13.2) + faraday (2.13.4) faraday-net_http (>= 2.0, < 3.5) json logger @@ -482,7 +482,7 @@ GEM date stringio public_suffix (6.0.1) - puma (6.6.0) + puma (6.6.1) nio4r (~> 2.0) query_diet (0.7.2) racc (1.8.1) @@ -570,7 +570,7 @@ GEM rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) - rspec-activemodel-mocks (1.2.1) + rspec-activemodel-mocks (1.3.0) activemodel (>= 3.0) activesupport (>= 3.0) rspec-mocks (>= 2.99, < 4.0) @@ -590,6 +590,8 @@ GEM rspec-expectations (~> 3.13) rspec-mocks (~> 3.13) rspec-support (~> 3.13) + rspec-rebound (0.2.1) + rspec-core (~> 3.3) rspec-support (3.13.4) rspectre (0.2.0) parser (>= 3.3.7.1) @@ -660,7 +662,7 @@ GEM sprockets (> 3.0) sprockets-rails tilt - scout_apm (5.6.4) + scout_apm (5.7.0) parser searchkick (5.3.1) activemodel (>= 6.1) @@ -825,6 +827,7 @@ DEPENDENCIES responders rspec-activemodel-mocks rspec-rails + rspec-rebound rspectre rswag-api rswag-specs diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 40c0db74a..0bd6f9a1c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -17,6 +17,7 @@ # # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration require 'percy/capybara' +require 'rspec/rebound' require 'vcr' VCR.configure do |c| @@ -123,4 +124,20 @@ RSpec.configure do |config| # Remember which tests failed, so you can run rspec with the `--only-failures` flag. config.example_status_persistence_file_path = "tmp/examples.txt" + + # show retry status in spec process + config.verbose_retry = true + # show exception that triggers a retry if verbose_retry is set to true + config.display_try_failure_messages = true + + # run retry only on features + config.around :each, :js do |ex| + ex.run_with_retry retry: 3 + end + + # callback to be run between retries + config.retry_callback = proc do |ex| + # run some additional clean up task - can be filtered by example metadata + Capybara.reset! if ex.metadata[:js] + end end