Commit bc773967 authored by Mark Lapierre's avatar Mark Lapierre

Merge branch 'mo-fix-capybara-screenshot-attachment' into 'master'

Fix capybara screenshot attachment

See merge request gitlab-org/gitlab!61515
parents 36733fdc 3ffea8a4
...@@ -170,14 +170,16 @@ RSpec.configure do |config| ...@@ -170,14 +170,16 @@ RSpec.configure do |config|
Capybara.raise_server_errors = false Capybara.raise_server_errors = false
example.run example.run
ensure
Capybara.raise_server_errors = true
end
config.append_after do |example|
if example.metadata[:screenshot] if example.metadata[:screenshot]
screenshot = example.metadata[:screenshot][:image] || example.metadata[:screenshot][:html] screenshot = example.metadata[:screenshot][:image] || example.metadata[:screenshot][:html]
screenshot&.delete_prefix!(ENV.fetch('CI_PROJECT_DIR', ''))
example.metadata[:stdout] = %{[[ATTACHMENT|#{screenshot}]]} example.metadata[:stdout] = %{[[ATTACHMENT|#{screenshot}]]}
end end
ensure
Capybara.raise_server_errors = true
end end
config.after(:example, :js) do |example| config.after(:example, :js) do |example|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment