Closed Saif4 closed 2 years ago
When I run all 3 files together
Can you provide more details on how you are running your tests? What options are you passing to the reporter? Based on your comment I would expect a single report to be output, not 3.
"reporter": "mochawesome", "reporterOptions": { "charts": true, "overwrite": false, "html": true, "json": true, "reportDir": "cypress/reports/", },
It become 3 reports because I have 3 spec files with each describe command inside them, and that's why I'm getting 3 reports after each describe has finished. So the html reports become as the follow: mochawesome.html mochawesome_001.html mochawesome_002.html
But what I want is to inherit the name of my describe or the spec file it self.
In my case I have 3 spec files with each describe command inside with those those names
accounts.spec.js --> describe name (Accounts)
members.spec.js --> describe name (Members)
admins.spec.js --> describe name (Admins)
For my case I want the mochawesome reports to be: accounts.html members.html admins.html
instead of the default name.
@adamgruber
The functionality you are looking for is not currently available. There are some differences with how standalone mocha works and how it works when using cypress. These differences make adding this feature non-trivial but I am trying to find a solution that will work for the majority of cases.
With v7.1.0 this is now possible. See https://github.com/adamgruber/mochawesome#reportfilename-replacement-tokens
Let's say I have 3 spec files that each one of them has its own describe. When I run all 3 files together mochawesome report will be generated as mochawesome.html mochawesome_001.html mochawesome_002.html
Is it a way to inherit the spec file name or even the descripe name of the spec file into the reports?