-
-
Notifications
You must be signed in to change notification settings - Fork 153
Description
Current behavior
When running tests with cypress + badeball/cypress-cucumber-preprocessor integrated, and run command, I get this error:
An error was thrown in your plugins file while executing the handler for the before:spec event.
The error we received was:
Error: Unexpected state in beforeSpecHandler: received-envelopes (this might be a bug, please report at https://github.com/badeball/cypress-cucumber-preprocessor)
at createError (C:\InvoiceAutomation\AutoTest\node_modules@badeball\cypress-cucumber-preprocessor\dist\helpers\error.js:9:12)
at beforeSpecHandler (C:\InvoiceAutomation\AutoTest\node_modules@badeball\cypress-cucumber-preprocessor\dist\plugin-event-handlers.js:190:43)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
Command:
node_modules.bin\cypress run -spec 'cypress/e2e/duckduckgo.feature' --headless --env fileConfig=stage
I have tried cypress-on-fix and it does not help.
I am using before and beforeEach in my test cases in which I am visiting the url.
Visiting the url outside before/beforeEach hooks works fine with run command.
Using cypress open works fine.

Desired behavior
No errors when running tests configured with before and beforeEach hooks with cypress run.
Test code to reproduce
Repository link: https://github.com/DianaPlesa92/AutoTest/tree/main
Versions
- Cypress version:13.6.2
- Preprocessor version:20.0.0
- Node version:v18.13.0
Checklist
- I've read the FAQ.
- I've read instructions for logging issues.
- I'm not using
[email protected](package name has changed and it is no longer the most recent version, see #689).