-1

I have configured Mochaawsome report in cypress. There are 2 .js files in my project. each file have 2 testcases. I am running both .js file through command on command terminal. Below is the command that i am using:

cypress run --reporter mochawesome \ --reporter-options reportDir=reporter-config.json,overwrite=false,henter code heretml=false,json=true

My Terminal show execution results of both js files both when i go and check html report then it is only showing results of second js file.

My HTML report is generating at Path: cypress/reporter-config.json overwrite=false html=false json=true/mochawesome.html

My First js file

describe('First Test Suite', function() {

    it('First Test Case', function() {  
        cy.log("-------1st Suite 1st Testcase-----");
    })

})

My Second js file

describe('My Second Test Suite', function() {

    it('My Second Test Case', function() {
        cy.log("-------2nd Suite 2nd Testcase-----");
    })


    it('My Third Test Case', function() {
        cy.log("-------2nd Suite 3rd Testcase-----");
        })

})

HTML Report Screenshot

Cypress json file

package json file

reporter-config json file

halfer
  • 19,824
  • 17
  • 99
  • 186

1 Answers1

0

I believe this is because thats the functionality.

There is an additional npm module that merges reports together so you get a collective rather than the last run test.

https://www.npmjs.com/package/mochawesome-merge

You could then have an npm script that merges the report.

Like this:

"merge_reports": "mochawesome-merge --reportDir mochawesome-report > mochawesome-report/output.json",

And run this after the tests with:

npm run merge_reports
mvoase
  • 544
  • 1
  • 6
  • 20