diff --git a/index.js b/index.js index b20bdef..b615cc8 100644 --- a/index.js +++ b/index.js @@ -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, + }); } } }