How to attach screenshot to json output?
I have requirement to show cucumber report and display screenshot for failed scenarios. Is there any option in chimp to attach the screenshot to scenario.
not yet, but we'll add it soon, thanks for the suggestion
if the screenshot is in the json report as base64, is this enough for you to get going?
Note to self, this would need to go into the failure capture step
var png = global.browser.screenshotSync();
var decodedImage = new Buffer(png, 'base64').toString('binary');
scenario.attach(decodedImage, 'image/png');
Yes, base64 in JSON report would help. Thanks
@ashokdudhade you can now use either --captureAllStepScreenshots or --screenshotsOnError to get the all/failed steps in the scenario inside the JSON report.
I'm working on a html report next
@ashokdudhade just a heads up, this is no longer default behavior. you need to set --attachScreenshotsToReport for screenshots to be added to the json report
Was just playing around with this and the screenshots have to be saved to the same directory as the report or else the cucumber json becomes null when setting the attachScreenshotsToReport flag