Skip to content
Snippets Groups Projects
Commit af5bf713 authored by Douwe Maan's avatar Douwe Maan
Browse files

Don't reset the session when the example failed, because we need...

Don't reset the session when the example failed, because we need capybara-screenshot to have access to it
parent f85d0a00
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -36,12 +36,13 @@ RSpec.configure do |config|
$capybara_server_already_started = true
end
 
config.after(:each, :js) do
config.after(:each, :js) do |example|
# capybara/rspec already calls Capybara.reset_sessions! in an `after` hook,
# but `block_and_wait_for_requests_complete` is called before it so by
# calling it explicitely here, we prevent any new requests from being fired
# See https://github.com/teamcapybara/capybara/blob/ffb41cfad620de1961bb49b1562a9fa9b28c0903/lib/capybara/rspec.rb#L20-L25
Capybara.reset_sessions!
# We don't reset the session when the example failed, because we need capybara-screenshot to have access to it.
Capybara.reset_sessions! unless example.exception
block_and_wait_for_requests_complete
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment