Created
July 5, 2017 11:49
-
-
Save shapovalovei/45863d5f8585340439f74f3e085518c6 to your computer and use it in GitHub Desktop.
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
Capybara.default_driver = :selenium | |
Capybara.register_driver :selenium do |app| | |
Capybara::Selenium::Driver.new(app, browser: :chrome) | |
end | |
Capybara.save_path = 'reports/screenshots' | |
After do |scenario| | |
# Do something after each scenario. | |
# The +scenario+ argument is optional, but | |
# if you use it, you can inspect status with | |
# the #failed?, #passed? and #exception methods. | |
if scenario.failed? | |
path = page.save_screenshot | |
puts "path to attach #{path}" | |
AllureCucumber::DSL.attach_file("#{scenario.name}.png Screenshot", path) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment