You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thanks for you job and I have an issue with gathering screenshots in async mode. Them are made usually in next test. I already rised it as a question in your enhancement thread.
I use wdio 6 + mocha + async mode. So at the moment I has to write my own screenshots util and put it in after test.
node_modules/wdio-timeline-reporter/lib/timeline-service.ts
async beforeCommand(commandName) {
const { screenshotStrategy } = this.reporterOptions;
if (screenshotStrategy === BEFORE_CLICK && 'click' === commandName) {
await browser.takeScreenshot();
}
}
async afterTest(test) {
const { screenshotStrategy } = this.reporterOptions;
if (screenshotStrategy === BEFORE_CLICK) {
await browser.takeScreenshot();
}
if (screenshotStrategy === ON_ERROR && !test.passed) {
await browser.takeScreenshot();
}
}
This way it takes it should take it at the right moment.
The text was updated successfully, but these errors were encountered:
Hi guys,
thanks for you job and I have an issue with gathering screenshots in async mode. Them are made usually in next test. I already rised it as a question in your enhancement thread.
I use wdio 6 + mocha + async mode. So at the moment I has to write my own screenshots util and put it in after test.
afterTest: async function (test, context, { error, result, duration, passed, retries }) {
const file_name =
${error}_${Date.now()}.png
;await browser.saveScreenshot(
${__dirname}/../reports/${file_name}
);TimelineReporter.addContext({
title:
${name}
,value:
<a href="${file_name}">Page Screen</a>
});
}
I think fix is something like:
node_modules/wdio-timeline-reporter/lib/timeline-service.ts
async beforeCommand(commandName) {
const { screenshotStrategy } = this.reporterOptions;
if (screenshotStrategy === BEFORE_CLICK && 'click' === commandName) {
await browser.takeScreenshot();
}
}
async afterTest(test) {
const { screenshotStrategy } = this.reporterOptions;
if (screenshotStrategy === BEFORE_CLICK) {
await browser.takeScreenshot();
}
if (screenshotStrategy === ON_ERROR && !test.passed) {
await browser.takeScreenshot();
}
}
This way it takes it should take it at the right moment.
The text was updated successfully, but these errors were encountered: