Created
April 3, 2012 18:29
-
-
Save rchampourlier/2294447 to your computer and use it in GitHub Desktop.
Hooks for Cucumber, enabling to examine @javascript scenarios and deal with SSL
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
# features/support/hooks.rb | |
# This ensure SslRequirement is enabled for all scenarios, except | |
# if stated otherwise elsewhere (such as within Before('@javascript@')) | |
Before do | |
SslRequirement.disable_ssl_check = false | |
end | |
Before('@javascript') do | |
SslRequirement.disable_ssl_check = true | |
end | |
# Some hooks/examiners from https://makandracards.com/makandra/1687-prevent-the-selenium-webbrowser-window-from-closing-after-a-failed-javascript-step | |
AfterStep('@slow_motion') do | |
sleep 2 | |
end | |
AfterStep('@single_step') do | |
print "Single Stepping. Hit enter to continue" | |
STDIN.getc | |
end | |
After('@leave_the_window_open') do |scenario| | |
if scenario.respond_to?(:status) && scenario.status == :failed | |
print "Step Failed. Press return to close browser" | |
STDIN.getc | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment