cucumber / cucumber-js

Cucumber for JavaScript
https://cucumber.io
MIT License
5.02k stars 1.09k forks source link

Attachments: Text attached is not saved as a real text #2350

Closed joao-motork closed 8 months ago

joao-motork commented 8 months ago

👓 What did you see?

During a run with cucumberjs 10, I attach some text, like: image

Checking the json report created, the attachment is not really saved as text, but as: image

Generating an HTML report: image

✅ What did you expect to see?

The same result I get with cucumberjs 9

image

image

davidjgoss commented 8 months ago

From the 10.0.0 release notes:

Previously, string attachments were included as plain text in the JSON formatter output, where other attachments were Base64 encoded. This meant for consumers, it was ambiguous whether any attachment was Base64 encoded or not. Now, all attachments are Base64 encoded regardless of how they were initially attached.

(https://github.com/cucumber/cucumber-js/pull/2261)

The code that produces your HTML report from the JSON output will need to Base64 decode the attachment body.