ojthdw
Last Updated: February 25, 2016
·
324
· baltazore

Capybara access new window

I just leave this here:

When (/^I access the new window$/) do 
  if Capybara.javascript_driver == :webkit
   page.driver.browser.window_focus( page.driver.browser.window_handles.last)
  else
    page.driver.browser.switch_to.window( page.driver.browser.window_handles.last)
  end
end