wdio-cucumberjs-json-reporter
wdio-cucumberjs-json-reporter copied to clipboard
Timestamp reports
Is your feature request related to a problem? Please describe. Currently reports are named according to the Feature file, and overwritten each time the Feature file is run.
Describe the solution you'd like It would be nice to have a timestamp added to the file name to keep a record of prior reports.
Describe alternatives you've considered Something like the following
onRunnerEnd() {
const jsonFolder = (0, path_1.resolve)(process.cwd(), this.options.jsonFolder);
const date = new Date().getTime()
const jsonFile = (0, path_1.resolve)(jsonFolder, `${this.report.feature.id}_${date}.json`);
const json = [this.report.feature];
const output = (0, fs_extra_1.existsSync)(jsonFile) ? json.concat((0, fs_extra_1.readJsonSync)(jsonFile)) : json;
(0, fs_extra_1.outputJsonSync)(jsonFile, output);
}
Additional context
If acceptable, will submit a PR for this.
Thanks for the Feature Request, if you want to can start with a PR
Submitted pull request https://github.com/webdriverio-community/wdio-cucumberjs-json-reporter/pull/80