Skip to content

Instantly share code, notes, and snippets.

Created March 5, 2013 23:15
Embedded png screenshots in your Cucumber HTML output
After do |scenario|
if scenario.failed?
embed_screenshot
end
@browser.close
end
private
def embed_screenshot
encoded_img = @browser.driver.screenshot_as(:base64)
embed("data:image/png;base64,#{encoded_img}", 'image/png')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment