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

Merge pull request #2505 from teamcapybara/open_new_window_does_not_switch

`open_new_window` is defined as not changing the current window, so s…
This commit is contained in:
Thomas Walpole 2021-10-23 17:49:32 -07:00 committed by GitHub
commit 0e9c4aae37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -255,7 +255,9 @@ class Capybara::Selenium::Driver < Capybara::Driver::Base
def open_new_window(kind = :tab)
if browser.switch_to.respond_to?(:new_window)
handle = current_window_handle
browser.switch_to.new_window(kind)
switch_to_window(handle)
else
browser.manage.new_window(kind)
end