'Mochawesome report is not opening in browser?
I'm doing unit testing using mocha chai. I want to see the reports in browser. Using mochawesome-report I'm able to generate test cases report in a folder mochawesome-report. In that I could see mochawesome.json and mochawesome.html. But unable to open the mochawesome.html file in browser. Kindly help.
Is there any other module to see the report generation in the browser or how can I see the test result in the browser which is displaying in console ?
Solution 1:[1]
I also faced a similar issue with respect to the cypress. When I debugged I found that my last suite running had 0 test cases or "it" blocks (which indicates each test cases). So, please check :
The last suite running, make sure it has test cases.
Do not merge the test reports for each suite, like in the
cypress.jsonwe have the options:"reporter": "mochawesome", "reporterOptions": { "charts": false, "html": false, "json": true, "reportDir": "cypress/reports", "reportFilename": "report", "overwrite": true }By default, the
overwriteoption is set totrue. Change it tofalse, and it will help you in getting the separate reports for each of the test suits. Later you can combine all the test suites to generate a single report.
Solution 2:[2]
Keep/generate mochawesome.html file in the same folder where you have "assets" folder. assets folder contains the supporting files for the html.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | fcdt |
| Solution 2 | user18177576 |
