0

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 ?

Rob
  • 14,746
  • 28
  • 47
  • 65
Priyanka
  • 117
  • 1
  • 5
  • 19

2 Answers2

2

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 :

  1. The last suite running, make sure it has test cases.

  2. Do not merge the test reports for each suite, like in the cypress.json we have the options:

    "reporter": "mochawesome",
    "reporterOptions": {
        "charts": false,
        "html": false,
        "json": true,
        "reportDir": "cypress/reports",
        "reportFilename": "report",
        "overwrite": true 
    }
    

    By default, the overwrite option is set to true. Change it to false, 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.

fcdt
  • 2,371
  • 5
  • 14
  • 26
Neha Rane
  • 21
  • 2
1

Keep/generate mochawesome.html file in the same folder where you have "assets" folder. assets folder contains the supporting files for the html.