Create a gist now

Instantly share code, notes, and snippets.

Cucumber/Capybara JS alert handling
# Add this to more_web_steps.rb
# Selenium docs: today!
When /^I (accept|dismiss) the "([^"]*)" alert$/ do |action, text|
alert = page.driver.browser.switch_to.alert
alert.text.should eq(text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment