cypress icon indicating copy to clipboard operation
cypress copied to clipboard

after:spec result does not match specification

Open alexplischke opened this issue 2 years ago • 1 comments

Current behavior

My plugin listens to the after:spec event and reports on the results it receives. The stats property of results has the following properties:

{
  suites: 1,
  tests: 1,
  passes: 1,
  pending: 0,
  skipped: 0,
  failures: 0,
  wallClockStartedAt: '2022-09-13T15:47:03.696Z',
  wallClockEndedAt: '2022-09-13T15:47:05.123Z',
  wallClockDuration: 1427
}

Desired behavior

According to https://github.com/cypress-io/cypress/blob/566a1a208cb51d193fd1838a4c35ab872a729fe7/cli/types/cypress.d.ts#L5565, the results type is CypressCommandLine.RunResult.

The RunResult interface describes stats as:

    stats: {
      suites: number
      tests: number
      passes: number
      pending: number
      skipped: number
      failures: number
      startedAt: dateTimeISO
      endedAt: dateTimeISO
      duration: ms
    }

This does not match the actual object's properties that I'm receiving.

In particular:

  • startedAt vs wallClockStartedAt
  • endedAt vs wallClockEndedAt
  • duration vs wallClockDuration

Test code to reproduce

Simply listen to the after:spec event and inspect the results.

Cypress Version

10.7.0

Node version

v16.13.0

Operating System

macOS 12.4

Debug Logs

No response

Other

No response

alexplischke avatar Sep 13 '22 16:09 alexplischke

@alexplischke thanks for submitting this issue. I can confirm that these properties are not returning as expected:

Screen Shot 2022-09-19 at 2 26 18 PM

Expected from cypress-npm-api.d.ts:

Screen Shot 2022-09-19 at 2 41 04 PM

admah avatar Sep 19 '22 19:09 admah

Hi, I would like contribute new issues. @admah @nagash77 this is a good issue to contribute?

luis-furtado avatar May 23 '23 11:05 luis-furtado

Hi, I see that another person is assigned to this issue, but their pull request doesn't pass the tests. Can I make another pull request too?

JohnKalan avatar Jun 12 '23 13:06 JohnKalan

The code for this is done, but this has yet to be released. We'll update this issue and reference the changelog when it's released.

jennifer-shehane avatar Aug 29 '23 15:08 jennifer-shehane

Released in Cypress 13.0.0.

jennifer-shehane avatar Aug 29 '23 17:08 jennifer-shehane