Skip to content

Commit

Permalink
fix: enable screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
kobenguyent authored Dec 26, 2023
1 parent b4483b4 commit 08df2be
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,14 +369,20 @@ module.exports = (config) => {

if (stepObj.status === 'failed' && step.err) {
await sendLogToRP({ tempId: stepObj.tempId, level: 'ERROR', message: `[FAILED STEP] - ${(step.err.stack ? step.err.stack : JSON.stringify(step.err))}` });
//await sendLogToRP({
//tempId: stepObj.tempId, level: 'debug', message: 'Last seen screenshot', screenshotData: await attachScreenshot(`${clearString(test.testTitle)}.failed.png`),
//});
debug(`Attaching screenshot & error to failed step`);

const screenshot = await attachScreenshot();
await sendLogToRP({
tempId: stepObj.tempId, level: 'debug', message: 'Last seen screenshot', screenshotData: screenshot,
});
} else if (stepObj.status === 'failed' && step.helper.currentRunningTest.err) {
await sendLogToRP({ tempId: stepObj.tempId, level: 'ERROR', message: `[FAILED STEP] - ${step.helper.currentRunningTest.err}` });
//await sendLogToRP({
//tempId: stepObj.tempId, level: 'debug', message: 'Last seen screenshot', screenshotData: await attachScreenshot(`${clearString(test.testTitle)}.failed.png`),
//});
debug(`Attaching screenshot & error to failed step`);

const screenshot = await attachScreenshot();
await sendLogToRP({
tempId: stepObj.tempId, level: 'debug', message: 'Last seen screenshot', screenshotData: screenshot,
});
}
}
}
Expand Down

0 comments on commit 08df2be

Please sign in to comment.