Created
January 5, 2011 22:46
-
-
Save noahd1/767171 to your computer and use it in GitHub Desktop.
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 do |scenario| | |
if scenario.failed? && $browser | |
file_base = "#{scenario.file_colon_line.parameterize.to_s.underscore}_#{Time.now.to_i}" | |
file_path = Rails.root.join("tmp", "build_assets", file_base) | |
puts "Writing log of failure to #{file_base}.log..." | |
`tail -n1000 #{Rails.root.join('log', 'selenium.log')} > #{file_path}.log` | |
puts "Writing screengrab of failure to #{file_base}.png..." | |
$browser.capture_screenshot("#{file_path}.png") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment