Screenshot not attaching to the gauge report #2202
ravikiranhebbar88
started this conversation in
General
Replies: 1 comment 2 replies
-
You need to call |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In gauge after running the scenario captures the screenshot and doesn't attach to the report. Below code is used in a hook to capture the screenshot.
gauge.customScreenshotWriter = async function () { const screenshotFilePath = path.join(process.env['gauge_screenshots_dir'],
screenshot-${process.hrtime.bigint()}.png`);await screenshot({ path: screenshotFilePath });
return path.basename(screenshotFilePath);
};
afterScenario(async function(context) {
if(context.currentScenario.isFailed) {
gauge.customScreenshotWriter();
}
await closeBrowser();
});
`
Do I need to add any code to attach to the report or does it add automatically?
Can anyone help me out resolving this issue. Thanks in Advance
Beta Was this translation helpful? Give feedback.
All reactions