Created
March 5, 2013 23:15
Embedded png screenshots in your Cucumber HTML output
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? | |
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