Skip to content

Instantly share code, notes, and snippets.

@karlosmid
Created February 13, 2015 12:39
Show Gist options
  • Save karlosmid/f4a0f41aeb8d510deb9e to your computer and use it in GitHub Desktop.
Save karlosmid/f4a0f41aeb8d510deb9e to your computer and use it in GitHub Desktop.
How to embed screenshot in Cucumber report across various environments
After do |scenario|
if scenario.failed?
encoded_img = @browser.screenshot.base64
embed("data:image/png;base64,#{encoded_img}",'image/png')
end
@browser.close
Cucumber.wants_to_quit = true if scenario.failed?
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment