Skip to content

after:spec result does not match specification #23805

Description

@alexplischke

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

(action: 'after:spec', fn: (spec: Spec, results: CypressCommandLine.RunResult) => void | Promise<void>): void
, 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

Activity

  1. admah commented on Sep 19, 2022

    @admah
    Contributor

    @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

  2. added
    E2EIssue related to end-to-end testing
    TriagedIssue has been routed to backlog. This is not a commitment to have it prioritized by the team.
    and removed on Apr 19, 2023
  3. luis-furtado commented on May 23, 2023

    @luis-furtado
    Contributor

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

  4. JohnKalan commented on Jun 12, 2023

    @JohnKalan

    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?

  5. jennifer-shehane commented on Aug 29, 2023

    @jennifer-shehane
    Member

    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.

  6. jennifer-shehane commented on Aug 29, 2023

    @jennifer-shehane
    Member

    Released in Cypress 13.0.0.

  7. locked as resolved and limited conversation to collaborators on Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    E2EIssue related to end-to-end testingTriagedIssue has been routed to backlog. This is not a commitment to have it prioritized by the team.good first issueGood for newcomerstype: typingsIssue related to Cypress types (for TypeScript)type: unexpected behaviorUser expected result, but got another

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions