Commit 11b3e54c authored by Robert Speicher's avatar Robert Speicher

Merge branch '33779-reset-session-before-blocking-requests' into 'master'

Call Capybara.reset_sessions! before block_and_wait_for_requests_complete

Closes #33779

See merge request !12224
parents 352a9ed5 abc5d1d0
......@@ -35,4 +35,13 @@ RSpec.configure do |config|
TestEnv.eager_load_driver_server
$capybara_server_already_started = true
end
config.after(:each, :js) do
# 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!
block_and_wait_for_requests_complete
end
end
......@@ -53,9 +53,3 @@ module WaitForRequests
Capybara.current_driver == Capybara.javascript_driver
end
end
RSpec.configure do |config|
config.after(:each, :js) do
block_and_wait_for_requests_complete
end
end
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