Last active
December 14, 2015 23:08
-
-
Save ratbeard/5163180 to your computer and use it in GitHub Desktop.
screenshot tag for cucumber
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
After('@screenshot') do |scenario| | |
filename = scenario.name.parameterize + ".png" | |
filename = "FAILED-#{filename}" if scenario.failed? | |
path = File.join("doc", "screenshots", filename) | |
page.driver.save_screenshot(path) | |
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
Add that in features/support/screenshot.rb | |
parameterize is a rails addition, prob have to drop that part outside rails. | |
https://github.com/cucumber/cucumber/blob/master/examples/watir/features/support/screenshots.rb | |
Seems to be an old similar example, before selenium-webdriver had this method built in? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment