0

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!

R. Barzell
  • 666
  • 5
  • 24
  • This might be what you are looking for - https://stackoverflow.com/questions/48110258/how-can-i-execute-code-before-all-tests-suite-with-cypress – Alapan Das Oct 01 '20 at 05:49
  • @AlapanDas actually it's not what I'm looking for. I need a way to merge tests under the same describe blocks in the reporter, the link you referenced was just about hooks and setup files, which is unrelated. – R. Barzell Oct 01 '20 at 12:48

1 Answers1

0

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

Kevin Old
  • 969
  • 1
  • 9
  • 20