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:
parent
11333b6460
commit
528a942cff
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue