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

After hook does not run when the scenario fails #916

Closed
3 tasks done
mysticdevx opened this issue Jan 4, 2023 · 1 comment
Closed
3 tasks done

After hook does not run when the scenario fails #916

mysticdevx opened this issue Jan 4, 2023 · 1 comment

Comments

@mysticdevx
Copy link

Current behavior

After hook does not run when a scenario fails

Desired behavior

After hook should run even if the scenario fails.

Test code to reproduce

// my hooks
Before({ tags: '@my-tag' }, () => {
  cy.log('this is my before hook with a tag')
});

After({ tags: '@my-tag' }, () => {
  cy.log('this is my after hook with a tag')
});

// here is my scenario
  @my-tag
  Scenario: my passing scenario
    Given visit google.com pass
  
  @my-tag
  Scenario: my failing scenario
    Given visit google.com fail

My result:

hooks

Versions

  • Cypress version: 12.1.0
  • Preprocessor version: 15.0.0
  • Node version: 14.20.1

Checklist

@badeball
Copy link
Owner

badeball commented Jan 4, 2023

#824 (comment)

@badeball badeball closed this as completed Jan 4, 2023
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