forked from Klaveness-Digital/cypress-cucumber-preprocessor
-
-
Notifications
You must be signed in to change notification settings - Fork 153
Closed
Description
Current behavior
Upon running npx cypress-cucumber-diagnostics, I am met with the error:
TypeError: Cypress.env is not a function
at cypress/support/appOne/pages.ts (C:\Users\JessicaJorgenson\Repos\CypressExample\.output-7bedd1.cjs:15748:22)
at __init (C:\Users\JessicaJorgenson\Repos\CypressExample\.output-7bedd1.cjs:10:58)
at cypress/support/appOne/step-definitions/preconditions.steps.ts (C:\Users\JessicaJorgenson\Repos\CypressExample\.output-7bedd1.cjs:15762:7)
at __init (C:\Users\JessicaJorgenson\Repos\CypressExample\.output-7bedd1.cjs:10:58)
at C:\Users\JessicaJorgenson\Repos\CypressExample\.output-7bedd1.cjs:15770:3
at Object.<anonymous> (C:\Users\JessicaJorgenson\Repos\CypressExample\.output-7bedd1.cjs:15771:3)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
Error: Failed to evaluate step definitions, with errors shown above...
at C:\Users\JessicaJorgenson\Repos\CypressExample\node_modules\@badeball\cypress-cucumber-preprocessor\dist\diagnostics\diagnose.js:110:27
at withRegistry (C:\Users\JessicaJorgenson\Repos\CypressExample\node_modules\@badeball\cypress-cucumber-preprocessor\dist\registry.js:188:5)
at diagnose (C:\Users\JessicaJorgenson\Repos\CypressExample\node_modules\@badeball\cypress-cucumber-preprocessor\dist\diagnostics\diagnose.js:103:52)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async execute (C:\Users\JessicaJorgenson\Repos\CypressExample\node_modules\@badeball\cypress-cucumber-preprocessor\dist\diagnostics\index.js:189:20)
When I have a constant equal to a Cypress.env value.
See here: https://github.com/jessica-jorgenson/cucumber-preprocessor-error/blob/main/cypress/support/appOne/pages.ts
When referring to the env like so: return Cypress.env("urls").main.replace("bing", "google"), the error doesn't occur.
Desired behavior
Cypress behaves as usual, so this shouldn't raise an error on cypress-cucumber-preprocessor...riiight?
Test code to reproduce
Repo: https://github.com/jessica-jorgenson/cucumber-preprocessor-error
Versions
- Cypress version: ^13.3.0
- Preprocessor version: ^19.0.1
- Node version: 18.18.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).
Metadata
Metadata
Assignees
Labels
No labels