cucumber-ruby: Attaching screenshots doesn't work for html reports
Describe the bug
The standard method of attaching screenshots embed (and its new alias attach) doesn’t work anymore.
Both:
# 1
browser.screenshot.save path
attach path, 'image/png'
#2
encoded_img = browser.screenshot.base64
attach encoded_img, 'image/png;base64'
are showing the same results: label Embedded image without actual content
To Reproduce Steps to reproduce the behavior:
- Embed screenshot in your code
- Run the test with HTML formatter
- Observe results
Expected behavior Image is attached in HTML report
Screenshots
If applicable, add screenshots to help explain your problem.

Your Environment
- cucumber (4.1.0)
- macOS Catalina 10.15.4
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (11 by maintainers)
Ok, thanks.
The workaround for this is to not encode the screenshot to base64. Cucumber will encode the data itself. Unfortunately there is no other workaround yet for this 😦
At least for cucumber-ruby. As you are using cucumber-jvm, there may be some differences.
May I suggest to continue the discussion here: https://github.com/cucumber/common/issues/1116?