I am using protractor-cucumber-framework and I wanted to create an html report for the tests I wrote. I decided to use the cucumber-html reporter to achieve this. In my hooks.js, I wrote this.After object to take a screenshot of a testing error:
this.After(function(scenario, callback) {
if (scenario.isFailed()) {
browser.takeScreenshot().then(function(buffer) {
return scenario.attach(new Buffer(buffer, 'base64'), function(err) {
callback(err);
});
});
}
else {
callback();
}
});
Everything works very well, a report is created and screenshots are taken and attached only with a testing error. But I also got an error message when after the step continues (therefore, when there are some glitches):
function expires in 5000 milliseconds
I would like to get rid of this post as it also appears in my html report. Can someone provide me a solution for this?