diff options
Diffstat (limited to 'spec/support/capybara.rb')
-rw-r--r-- | spec/support/capybara.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index be2b41d6997..f9a28c8e40b 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -157,7 +157,7 @@ RSpec.configure do |config| unless session.current_window.size == CAPYBARA_WINDOW_SIZE begin session.current_window.resize_to(*CAPYBARA_WINDOW_SIZE) - rescue # ? + rescue StandardError # ? end end end @@ -170,14 +170,16 @@ RSpec.configure do |config| Capybara.raise_server_errors = false example.run + ensure + Capybara.raise_server_errors = true + end + config.append_after do |example| if example.metadata[:screenshot] screenshot = example.metadata[:screenshot][:image] || example.metadata[:screenshot][:html] + screenshot&.delete_prefix!(ENV.fetch('CI_PROJECT_DIR', '')) example.metadata[:stdout] = %{[[ATTACHMENT|#{screenshot}]]} end - - ensure - Capybara.raise_server_errors = true end config.after(:example, :js) do |example| |