-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Cannot attach non string data to report #249
Comments
Hi @struankl. The base64 encoding of everything is by design and follows the way attachments work in other Cucumber ports. You should be able to attach an image by passing it in as a Buffer or a Stream if you're using node.js. See #225 for some examples. Are you using node.js or running cucumber-js in a browser? |
Hi @struankl, see my comment above. Also there's some executable examples in https://github.com/cucumber/cucumber-js/blob/master/features/attachments.feature |
Thanks @simondean, I had tried this, but toString() gets called on the buffer, which corrupts any binary data. I think the examples you've linked to only work because they actually attach the string 'data', not real image data. |
Sorry, should have said, I'm running through node.js |
@struankl
|
Thanks @jlin412 that worked for me. |
Seems to be ok now? Please reopen if needed. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I think because of the fix for #233 the scenario.attach now only supports string data. If you try to pass it any other type it will have toString() called on it (previously toString('base64')) and if you try to pass data which is already base64 encoded then it gets it gets based64 encoded again at the formatting stage in the json formatter. @simondean mentioning you as instructed.
The text was updated successfully, but these errors were encountered: