Skip to content

Screenshots end up being base64 encoded twice #18

Description

@tfnico

It seems cucumber.js is now doing the encoding themselves when attaching pngs. I therefore had to decode twice to get the screenshot ending up viewable in the report:

browser.takeScreenshot().then(function (stream) {
        //double decode the image to workaround the double encoding that cucumber.js+report does
        scenario.attach(new Buffer(new Buffer(stream, 'base64'), 'base64'), 'image/png', function (err) {
          callback(err);
        });
      });

More discussion on this here: cucumber/cucumber-js#275

Here are the relevant packages I'm using:

"cucumber": "^1.2.1",
"gulp-protractor": "^2.4.0",
"gulp-protractor-cucumber-html-report": "^0.1.2",
"protractor": "^4.0.0",
"protractor-cucumber-framework": "^0.6.0",

I'm not sure which tool is doing the wrong thing here, as I don't understand Cucumber's conventions on how to encode embeddings...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions