Skip to content

option for Cypress.stop to not fail the test #33465

@alexsch01

Description

@alexsch01

What would you like?

In cases where the test can exit early but still want to be marked as a passing test

I currently get the error message in cypress run mode (with output in the terminal)

CypressError: Cypress test was stopped while running this command.
      at cypressErr (http://localhost:51256/__cypress/runner/cypress_runner.js:78375:18)
      at Object.errByPath (http://localhost:51256/__cypress/runner/cypress_runner.js:78443:10)
      at http://localhost:51256/__cypress/runner/cypress_runner.js:153873:72

Why is this needed?

it("", () => {
  if (SHOULD_SKIP_THE_REST) {
    cy.task("log", "Rest of the test has been skipped")
    cy.then(() => { Cypress.stop() })
    cy.task("log", "Should not be shown")
  }
})

cypress@14.5.0 and above - failed test
cypress@14.4.1 and below - passed test


I would like an option for Cypress.stop such as...

Cypress.stop({ fail: false })

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions