Cypress-cucumber-preprocessor: Can't run step definition.js file after new update

Created on 9 Jul 2021  路  7Comments  路  Source: TheBrainFamily/cypress-cucumber-preprocessor

I honestly feel really about doing this, but the problem in the new release does not appear to be resolved


I updated the dependency with the new release. I opened cypress runner and and ran the test file


Expected Result

E2E test with BDD

However this is what I got, watch this video

Screen shot of testing

Screenshot 2021-07-09 at 17 26 21

Versions

  • Cypress version: 7.4.0
  • Preprocessor version: Mac Big Sur
  • Node version: 14.17.1

Most helpful comment

@stevenlafl I was able to FINALLY fix it

  1. adding ANOTHER folder in the under BDD called shoppingCart
  2. In the package.json I added the following
"cypress-cucumber-preprocessor": {
    "nonGlobalStepDefinitions": false,
    "stepDefinitions": "cypress/integration/BDD/"

Notice, I was forced to change the nonGlobalStepDefinitions to false opposed to the default 'true'. I tried to 'true'. The test failed.

It was able to read the Feature file and start running the test .

I now have a data issues. But this problem appears to be resolved!

All 7 comments

Try putting the shoppingCart.js file into integration/BDD/shoppingCart/shoppingCart.js (there is supposed to be a folder matching the feature file next to the feature file)

Hi thanks for getting back to me so quickly. I really appreciate it. All my files are in the same folder.
Screenshot 2021-07-09 at 17 33 08

yeah that's not correct, try to do what I said please. ./integration/BDD/shoppingCart.feature ./integration/BDD/shoppingCart/shoppingCart.js . if you want to have the files in the same folder make nonGlobalStepDefinitions: false , that will have the side-effect of having all steps available to all feature files

let me try it and let me get back to you

watch the video. I have misunderstood something let me know and break down step by step how I should rectify it.

@fypnlp I had to use regex instead. Did you try /^I am on the Ecommerce page$/ ? Sad that I can't use it with {string} as it shows in the documentation either.

@stevenlafl I was able to FINALLY fix it

  1. adding ANOTHER folder in the under BDD called shoppingCart
  2. In the package.json I added the following
"cypress-cucumber-preprocessor": {
    "nonGlobalStepDefinitions": false,
    "stepDefinitions": "cypress/integration/BDD/"

Notice, I was forced to change the nonGlobalStepDefinitions to false opposed to the default 'true'. I tried to 'true'. The test failed.

It was able to read the Feature file and start running the test .

I now have a data issues. But this problem appears to be resolved!

Was this page helpful?
0 / 5 - 0 ratings