Skip to content

Instantly share code, notes, and snippets.

Forked from leshill/gist:870866
Created Mar 17, 2011
What would you like to do?
# Add this to more_web_steps.rb
# Selenium docs: today!
When /^I (accept|dismiss) the "([^"]*)" alert$/ do |action, text|
window = page.driver.browser.window_handle
alert = page.driver.browser.switch_to.alert
alert.text.should == text
page.driver.browser.switch_to.window window
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment