Closed badeball closed 1 year ago
For reference, cucumber-json-formatter will take attachments with IDENTITY
encoding and base64-encode them before outputting a JSON report, thus generating a different one, where both embeddings are identical.
For reference, cucumber-json-formatter will take attachments with IDENTITY encoding and base64-encode them before outputting a JSON report, thus generating a different one, where both embeddings are identical.
Okay, that seems like the canonical behaviour we should follow then.
Excellent, I'll attempt to create a PR :+1:
This would however mean that string attachments, as they were attached pre #1552, would suddenly appear as base64-encoded data in JSON reports. Thus making this seem like a breaking change. Is that relevant in any way?
Yep, I think it's a breaking change. We have the end of life for Node.js 14 coming up at the end of April so we could do a major release then with both in.
Note that this was actually a breaking change. We attach Playwright screenshots to the JSON for our HTML reports, base64 encoding before attaching. Very confused when there appeared to be a double Base64 encode going on! lol
@v-mwalk, you’re right that it’s a breaking change. The previous conversation also supports this. I think the only mistake made is that it wasn’t mentioned as such in the release notes.
👓 What did you see?
Consider the following code adding two string attachments:
This will create two envelopes (messages) with different
contentEncoding
(IDENTITY
andBASE64
respectively). However, this information (content encoding) is lost in the JSON report and the original data cannot be reproduced with certainty.Below is the JSON report:
✅ What did you expect to see?
I guess for JSON reports to either only ever contain base64 encoded data or for content encoding to be propagated to the report.
📦 Which tool/library version are you using?
🔬 How could we reproduce it?
Steps to reproduce the behavior:
git clone https://github.com/badeball/cucumber-reproducible-issues.git
cd cucumber-reproducible-issues/string-attachment-ambiguity
npm install
npx cucumber-js