Created
September 23, 2011 19:03
-
-
Save fantactuka/1238174 to your computer and use it in GitHub Desktop.
Cucumber + Capybara test new window opened
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Then /url "([^"]*)" is opened in new window/ do |url| | |
browser = page.driver.browser | |
current_id = browser.window_handle | |
tab_id = page.driver.find_window(url) | |
browser.switch_to.window tab_id | |
page.driver.browser.close | |
browser.switch_to.window current_id | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is a new syntax for capybara https://github.com/teamcapybara/capybara#working-with-windows