wdio-cucumberjs-json-reporter icon indicating copy to clipboard operation
wdio-cucumberjs-json-reporter copied to clipboard

Timestamp reports

Open osmolyar opened this issue 4 years ago • 3 comments

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

osmolyar avatar Sep 30 '21 20:09 osmolyar

If acceptable, will submit a PR for this.

osmolyar avatar Jan 31 '22 13:01 osmolyar

Thanks for the Feature Request, if you want to can start with a PR

wswebcreation avatar Jan 31 '22 13:01 wswebcreation

Submitted pull request https://github.com/webdriverio-community/wdio-cucumberjs-json-reporter/pull/80

osmolyar avatar Jan 31 '22 15:01 osmolyar