Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couldn't display base64:image/png attachment because the media type is unsupported #1574

Closed
saurabh-deep opened this issue Feb 9, 2021 · 3 comments

Comments

@saurabh-deep
Copy link

With Cucumber v7.0 built-in HTML reporter, I am able to attach the screenshots but the generated HTML fails to load the screenshots with the below mentioned errors.

If I provide the mime type as image/png, it shows error # 1 in the HTML output.
Couldn't display image/png image because it wasn't base64 encoded

If I provide mime type asa base64:image/png, it shows error # 2 in the HTML output.
Couldn't display base64:image/png attachment because the media type is unsupported.

I am using Selenium Webdriver to capture the screenshot and it returns the screenshot with base64 encoding. Therefore, the second approach above should work correctly. I tried examples as shown in this documentation page which was last updated a week ago, but it doesn't help at all.

Can someone please help me get past this blocker issue?

Thanks in advance!
Saurabh

@davidjgoss
Copy link
Contributor

The issue was fixed in #1552 and we should have a release out soon including that change - sorry for the delay.

As a temporary workaround, you could decode your base64-encoded string into a buffer and pass that to the attach function, which should work correctly.

@saurabh-deep
Copy link
Author

Thank you again @davidjgoss!

@davidjgoss davidjgoss assigned davidjgoss and unassigned davidjgoss Apr 2, 2021
@davidjgoss
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants