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

Error handling is not working #348

Closed
averri opened this issue Mar 25, 2020 · 1 comment
Closed

Error handling is not working #348

averri opened this issue Mar 25, 2020 · 1 comment

Comments

@averri
Copy link

averri commented Mar 25, 2020

Current behavior:

The fail event is not being captured when a test fails. This is a violation of the Cypress specification.

image

Desired behavior:

The fail event should be captured when a test fails, giving the opportunity to ignore the failure.

Test code to reproduce

error_handling.feature:

Feature: Error handling

  Scenario: Error should not fail the test
    Given I want to ignore any error
    When I execute an action that generate an error
    Then The test should pass

steps.js:

const {Given, When, Then} = require("cypress-cucumber-preprocessor/steps")

Given('I want to ignore any error', () => {
  cy.on('fail', () => {
    console.log('Ignoring this error.')
    return false
  })
})

When('I execute an action that generate an error', () => {
  cy.wrap({}).click({timeout: 1000})
})

Then('The test should pass', () => {
  // Do nothing.
})

Versions

  • Windows 10
  • package.json:
  "devDependencies": {
    "cucumber": "^6.0.5",
    "cypress": "^4.2.0",
    "cypress-pipe": "^1.7.0",
    "mochawesome": "^5.0.0",
    "cypress-log-to-output": "^1.0.8",
    "cypress-shadow-dom": "^1.3.0",
    "cypress-cucumber-preprocessor": "^2.0.1"
  }
@badeball
Copy link
Owner

Due to personal reasons, the previous maintainers of this package are stepping down and handing the reigns over to me, a long-time contributor to the project and a user of it myself. This is a responsibility I'm very excited about. Furthermore, I'd like to thank @lgandecki ++ for all the work that they've done so far.

Read more about the transfer of ownership here.

The repository has however moved and all outstanding issues are being closed. This is not a reflection of the perceived importance of your reported issue. However, if after upgrading to the new version, you still find there to be an issue, feel free to open up another ticket or comment below. Please make sure to read CONTRIBUTING.md before doing so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants