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:
commit
0e9c4aae37
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue