The "save screenshot" code needs changing. Node conversion from image to base64 was getting corrupted. Not entirely sure why, but it's related to newer version of Node. If you remove the mime type prior to base64 conversion, and omit the conversion to binary, it works fine. The following code works (tested!).
this.After(function (scenario, callback) {
if (scenario.isFailed()) {
browser.takeScreenshot().then(function (png) {
var decodedImage = new Buffer(png.replace(/^data:image\/(png|gif|jpeg);base64,/,''), 'base64');
scenario.attach(decodedImage, 'image/png');
callback();
});
}
else {
callback();
}
});