adamgruber / mochawesome-report-generator

Standalone mochawesome report generator. Just add test data.
MIT License
231 stars 90 forks source link

Support token replacements in `reportFilename` option #192

Closed adamgruber closed 2 years ago

adamgruber commented 2 years ago

Adds support for the following token replacements to the reportFilename option:

For example, given the spec cypress/integration/sample.spec.js and the following config:

{
  reporter: "mochawesome",
  reporterOptions: {
    reportFilename: "[status]_[datetime]-[name]-report",
    timestamp: "longDate"
  }
}

The resulting report file will be named pass_February_23_2022-sample-report.html

Note: The [name] replacement only occurs when mocha is running one spec file per process and outputting a separate report for each spec OR when using the CLI. When this is not the case, the "[name]" string will instead be replaced by the default report filename ("mochawesome").

185

https://github.com/adamgruber/mochawesome/issues/293 https://github.com/adamgruber/mochawesome/issues/345