Save a screenshot of the page in tmp/capybara when a cucumber test is failing
closes #7912
This commit is contained in:
parent
65e0f90b86
commit
b977e9c39a
1 changed files with 5 additions and 0 deletions
|
|
@ -77,3 +77,8 @@ Before do |scenario|
|
|||
# Reset overridden settings
|
||||
AppConfig.reset_dynamic!
|
||||
end
|
||||
|
||||
After do |scenario|
|
||||
Capybara.save_path = ENV["SCREENSHOT_PATH"]
|
||||
page.save_screenshot("#{Time.now.utc} #{scenario.name}.png", full: true) if scenario.failed? && ENV["SCREENSHOT_PATH"]
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue