Created
December 4, 2010 20:33
-
-
Save jmaicher/728462 to your computer and use it in GitHub Desktop.
Confirm Alerts using Cucumber with Selenium
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
# create the following step to confirm the next alert | |
When /^(?:|I )follow "([^"]*)" and I confirm the next alert$/ do |link| | |
page.evaluate_script('window.confirm = function() { return true; }') | |
When "I follow \"#{link}\"" | |
end |
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
# you can use it like this | |
Scenario: Delete user account | |
Given I am on the dashboard site | |
When I follow "Edit user account" | |
When I follow "Delete user account" and I confirm the next alert | |
Then I should be signed out | |
When I try to sign in as the user | |
Then I should see a signin form error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment