cypress-cucumber-preprocessor
cypress-cucumber-preprocessor copied to clipboard
Unexpected state in afterSpecHandler after an AssertionError and after each hook throws CypressError when trying to invoke cy.task()
Current behavior
This is similar to this previous issue
Chrome/Chroimum is not crashing, but the scenario fails with an AssertionError, which triggers the after each hook
We then see CypressError
CypressError: cy.task()
must only be invoked from the spec file or support file.
Because this error occurred during a after each
hook we are skipping the remaining tests in the current suite:
An error was thrown in your plugins file while executing the handler for the after:spec event. The error we received was: Error: Unexpected state in afterSpecHandler: step-started (this might be a bug, please report at https://github.com/badeball/cypress-cucumber-preprocessor)
Desired behavior
handle the unexpected state more gracefully, and allow any further scenarios in the feature file to continue
Test code to reproduce
Versions
- Cypress version: 13.7.3
- Preprocessor version: 20.0.3
- Node version: 20.5.1
Checklist
- [x] I've read the FAQ.
- [x] I've read instructions for logging issues.
- [x] I'm not using
[email protected]
(package name has changed and it is no longer the most recent version, see #689).
Hey, and thanks for reporting this issue. You need to provide a minimal, reproducible example that illustrates the issue.
Closing due to lack of a reproducible example. Feel free to open up another issue if anything changes in this regard.