1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

Deal with race condition when reseting between tests (#2150)

* recover from race condition where app under test can navigate us away from about:blank
This commit is contained in:
Perryn Fowler 2019-02-24 07:45:49 +11:00 committed by Thomas Walpole
parent 11333b6460
commit 528a942cff

View file

@ -386,6 +386,11 @@ private
raise Capybara::ExpectationNotMet, 'Timed out waiting for Selenium session reset' if timer.expired?
sleep 0.01
# It has been observed that it is possible that asynchronous JS code in
# the application under test can navigate the browser away from about:blank
# if the timing is just right. Ensure we are still at about:blank...
@browser.navigate.to('about:blank') unless current_url == 'about:blank'
end
end