Skip to content

Instantly share code, notes, and snippets.

@jxson
Forked from leshill/gist:870866
Created March 22, 2011 02:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jxson/880667 to your computer and use it in GitHub Desktop.
Save jxson/880667 to your computer and use it in GitHub Desktop.
# Add this to more_web_steps.rb
# Selenium docs: http://code.google.com/p/selenium/wiki/RubyBindings#Javascript_Alert/Confirm today!
When /^I (accept|dismiss) the "([^"]*)" alert$/ do |action, text|
alert = page.driver.browser.switch_to.alert
alert.text.should eq(text)
alert.send(action)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment