Created
March 2, 2011 15:03
-
-
Save joahking/851055 to your computer and use it in GitHub Desktop.
bypass confirm dialog
This file contains hidden or 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 /^(.+) and I confirm dialog box$/ do |step| | |
bypass_confirm_dialog | |
Then step | |
end |
This file contains hidden or 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
module JsHelpers | |
def bypass_confirm_dialog | |
# bypassing the confirm dialog | |
# http://groups.google.com/group/ruby-capybara/browse_thread/thread/89760b6fcab7fd19 | |
# http://stackoverflow.com/questions/2458632/how-to-test-a-confirm-dialog-with-cucumber | |
page.evaluate_script('window.confirm = function() { return true; }') | |
end | |
end |
This file contains hidden or 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
@javascript | |
Scenario: Lorem ipsum | |
... | |
When I press "Delete" and I confirm dialog box |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment