Closed simondean closed 9 years ago
Just noticed the embeddings()
function actually is private. That means there is no way to attach a text-based embedding without it being base64 encoded.
Thinking about it, I realise that the Cucumber JSON format only supports base64 encoded embeddings/attachments. Otherwise anything consuming the reports wouldn't know whether to base64 decode or not.
Hi. The
js/lib/gherkin/formatter/json_formatter.js
provides aembedding(mime_type, data)
function for adding an embedding to a step. The function always base64 encodes the data. There's no way to create an embedding without base64 encoding. This means that a text-base embedding (e.g. plain text, JSON etc) cannot not be created without base64 encoding which means you can't read them in the JSON report without first base64 decoding. I'd like to use this embedding function to fix https://github.com/cucumber/cucumber-js/issues/233 but the mandatory base64 encoding makes it difficult. I could use theembeddings()
function instead but that's marked as a "private function" and that would be a bit of a hack.