Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onEnd(payload) {
const jsonFolder = this.options.jsonFolder;
// Generate the jsons
generateJson(jsonFolder, this.results);
// generate the report
generate({
// Required
jsonDir: jsonFolder,
reportPath: this.options.reportFolder,
// Optional
...(this.options.customData ? { customData: this.options.customData } : {}),
...(this.options.customStyle ? { customStyle: this.options.customStyle } : {}),
disableLog: this.options.disableLog || false,
displayDuration: this.options.displayDuration || false,
durationInMS: this.options.durationInMS || false,
openReportInBrowser: this.options.openReportInBrowser || false,
...(this.options.overrideStyle ? { overrideStyle: this.options.overrideStyle } : {}),
...(this.options.pageFooter ? { pageFooter: this.options.pageFooter } : {}),
...(this.options.pageTitle ? { pageTitle: this.options.pageTitle } : {}),
...(this.options.reportName ? { reportName: this.options.reportName } : {}),
saveCollectedJSON: this.options.saveCollectedJSON || false,
});
/**
* Add the pageTitle if needed
*/
if (PLUGIN_CONFIG.pageTitle) {
multiCucumberHTLMReporterConfig.pageTitle = PLUGIN_CONFIG.pageTitle;
}
/**
* Add the custom report name if needed
*/
if (PLUGIN_CONFIG.reportName) {
multiCucumberHTLMReporterConfig.reportName = PLUGIN_CONFIG.reportName;
}
multiCucumberHTLMReporter.generate(multiCucumberHTLMReporterConfig);
}
} else {
console.warn(`\n### File: '${reportPath}' or '${pidReportPath}' is not present! ###\n`);
}
}
}
browser.pause(DELAY_2s).then(async() => {
await reporter.generate(reportOptions);
await browser.pause(DELAY_1s);
});
}