Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specs json-reported 'pending' in Cypress 10.10.0 are now json-reported 'pending AND skipped' in Cypress 10.11.0 #24477

Closed
RolandBurrows opened this issue Oct 31, 2022 · 3 comments · Fixed by #25264
Assignees
Labels
E2E Issue related to end-to-end testing type: bug

Comments

@RolandBurrows
Copy link

RolandBurrows commented Oct 31, 2022

Current behavior

CONTEXT

CURRENT CYPRESS 10.11.0 BEHAVIOR

  • json reporter output shows pending tests as also skipped.

Desired behavior

Json reporter output behavior from Cypress v10.10.0, which shows pending tests as NOT ALSO skipped.

Test code to reproduce

$ npm install [email protected]

// cypress.config.js
const { defineConfig } = require("cypress");

module.exports = defineConfig({
  e2e: {
    setupNodeEvents(on, config) {
      // implement node event listeners here
    },
    specPattern: '**/*.cy.js',
  },
  reporter: 'mochawesome',
  reporterOptions: {
    reportDir: 'cypress/results',
    overwrite: false,
    html: false,
    json: true
  }
});
// cypress/e2e/pass.cy.js
describe('pass', () => {
  it('pass', () => {
    cy.visit('https://example.cypress.io')
  })
})
// cypress/e2e/pending.cy.js
describe('pending', () => {
  it.skip('pending', () => {
    cy.visit('https://example.cypress.io')
  })
})

$ npm install [email protected]
$ ./node_modules/.bin/cypress run

       Spec                                              Tests  Passing  Failing  Pending  Skipped
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ √  pass.cy.js                               00:03        1        1        -        -        - │
  ├────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ √  pending.cy.js                             27ms        1        -        -        1        - │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    √  All specs passed!                        00:03        2        1        -        1        -
// cypress/e2e/pass.cy.js
  "stats": {
    "passes": 1,
    "pending": 0,
    "failures": 0,
    "passPercent": 100,
    "pendingPercent": 0,
    "skipped": 0,
    "hasSkipped": false
  }
// cypress/e2e/pending.cy.js
"stats": {
    "passes": 0,
    "pending": 1,
    "failures": 0,
    "passPercent": null,
    "pendingPercent": 100,
    "skipped": 0,
    "hasSkipped": false
  }

$ npm install [email protected]
$ ./node_modules/.bin/cypress run

       Spec                                              Tests  Passing  Failing  Pending  Skipped
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ √  pass.cy.js                               00:02        1        1        -        -        - │
  ├────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ √  pending.cy.js                             21ms        1        -        -        1        - │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    √  All specs passed!                        00:02        2        1        -        1        -
// cypress/e2e/pass.cy.js
"stats": {
    "passes": 1,
    "pending": 0,
    "failures": 0,
    "passPercent": 100,
    "pendingPercent": 0,
    "skipped": 0,
    "hasSkipped": false
  }
"stats": {
    "passes": 0,
    "pending": 1,
    "failures": 0,
    "passPercent": null,
    "pendingPercent": 100,
    "skipped": 1,           // UNEXPECTED BEHAVIOR
    "hasSkipped": true      // UNEXPECTED BEHAVIOR
  }

Cypress Version

10.11.0

Node version

v18.12.0

Operating System

Windows 10 Home 21H1

Debug Logs

No response

Other

No response

@nagash77 nagash77 added E2E Issue related to end-to-end testing and removed E2E-core labels Nov 8, 2022
@emilyrohrbough emilyrohrbough self-assigned this Dec 21, 2022
@emilyrohrbough emilyrohrbough added type: bug routed-to-e2e and removed type: feature New feature that does not currently exist labels Dec 23, 2022
@emilyrohrbough
Copy link
Member

emilyrohrbough commented Dec 23, 2022

@RolandBurrows Thank you for the detailed issue and reproducible example. I confirmed this behavior has changed from 10.10.0 to 10.11.0 and is still an issue in the latest v12 release.

I'm not really sure what change caused this problem, I assume my changes here: #24217. I opened a PR to fixed this behavior.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 29, 2022

The code for this is done in cypress-io/cypress#25264, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot cypress-bot bot removed the stage: needs review The PR code is done & tested, needs review label Dec 29, 2022
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 3, 2023

Released in 12.3.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v12.3.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jan 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
E2E Issue related to end-to-end testing type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants