Combining Multiple Describes in Test Reporter

394 views Asked by At

I'm using Cypress.IO (which supports Mocha Reporters, hence the inclusion of Mocha Tags).

Let's say I have multiple tests in multiple files:

test1.js:

describe('A', () => {
   describe('B', () => {
      it('Test1', () => {
         ...
      })
   })
})

test2.js:

describe('A', () => {
   describe('B', () => {
      it('Test2', () => {
         ...
      })
   })
})

When running in Cypress.IO, the runs look like this:

A
   B
      Test1

A
   B
      Test2

However, I'd like the runs to look like this:

A
   B
      Test1
      Test2

In short, anything that lives in the same describe hierarchy should be grouped together.

I tried looking for plug-ins, but found nothing that did this. I then looked at custom Mocha reporters, since Cypress.IO supports them, but also came up empty.

Do you know of any plug-ins, reporters, options or anything else that I can use to do this?

Thanks!

1

There are 1 answers

0
Kevin Old On

This may be achieved by generating a JSON report and transforming those results.

Details on this concept can be found in the Reporters Cypress Documentation