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...
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:
More discussion on this here: cucumber/cucumber-js#275
Here are the relevant packages I'm using:
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...