Skip to content

Latest commit

 

History

History
95 lines (62 loc) · 6.13 KB

File metadata and controls

95 lines (62 loc) · 6.13 KB

← Back to documentation

Frequently asked questions

I get fs_1.promises.rm is not a function

Upgrade your node version to at least v14.14.0.

I get state.messages.findLastIndex is not a function

Upgrade your node version to at least v18.0.0. This only applies to users of any kind of reports (messages, json and html).

--env / tags isn't picked up

This might be because you're trying to specify -e / --env multiple times, but multiple values should be comma-separated.

Negated tags / complex tag expressions aren't working as expected

Windows / CMD.EXE users must be aware that single-quotes bear no special meaning and should not be used to group words in your shell. For these users, only double-quotes should be used for this purpose. What this means is that, for these users, running cypress run --env tags='not @foo' is not going to behave and double-quotes must be used. Furthermore, similar scripts contained in package.json should also use double-quotes (escaped necessarily, as that is JSON).

JSON reports aren't generated in open / interactive mode

JSON reports aren't generated in open / interactive mode. They rely on some events that aren't available in open-mode, at least not without experimentalInteractiveRunEvents: true. However, this experimental flag broke some time ago, ref. cypress-io/cypress#18955, cypress-io/cypress#26634. There's unfortunately little indication that these issues will be fixed and meanwhile reports will not be available in open / interactive mode.

I get cypress_esbuild_preprocessor_1.createBundler is not a function

This can happen if you have a TypeScript Cypress configuration (IE. cypress.config.ts as opposed to cypress.config.js) similar to one of our examples and have a tsconfig.json without { "compilerOptions": { "esModuleInterop": true } }.

If you're really adamant about not using esModuleInterop: true, you can change

import createBundler from "@bahmutov/cypress-esbuild-preprocessor";

.. to

import * as createBundler from "@bahmutov/cypress-esbuild-preprocessor";

However, I recommend just using esModuleInterop: true if you don't fully understand the implications of disabling it.

I get cypress_esbuild_preprocessor_1.default is not a function

See answer above.

I get Cannot find module '@badeball/cypress-cucumber-preprocessor/esbuild'

Set compilerOptions.moduleResolution to node16 in your tsconfig.json. Users that are unable to upgrade moduleResolution to node16, can use the paths property as a workaround, like shown below.

{
  "compilerOptions": {
    "paths": {
      "@badeball/cypress-cucumber-preprocessor/*": ["./node_modules/@badeball/cypress-cucumber-preprocessor/dist/subpath-entrypoints/*"]
    }
  }
}

My JSON report isn't generated

You may have stumbled upon a configuration caveat (see docs/configuration.md: Caveats / Debugging) or are overriding some of the plugin's own event handlers (see docs/event-handlers.md: On event handlers).

I get Unexpected state in <state-handler>: <state>

You might be overriding some of the plugin's own event handlers (see docs/event-handlers.md: On event handlers).

Why is cypress-tags missing?

The cypress-tags executable has been removed and made redundant. Specs containing no matching scenarios are automatically filtered, provided that filterSpecs is set to true.

Function members And(..) and But(..) are missing

These have been deprecated to reflect cucumber-js' behavior. You can still however use the And keyword in .feature files. As explained on SO,

And is only used in scenarios, not as step definition methods. Semantically it means "same keyword as in previous step"; technically it is just another step. In fact, you can use Given(), When() and Then() interchangeably in your step definitions, Cucumber will not enforce a match between the step keyword and the step definition function.