Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run step definition.js file after new update #596

Closed
fypnlp opened this issue Jul 9, 2021 · 15 comments
Closed

Can't run step definition.js file after new update #596

fypnlp opened this issue Jul 9, 2021 · 15 comments

Comments

@fypnlp
Copy link

fypnlp commented Jul 9, 2021

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
@lgandecki
Copy link
Collaborator

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)

@fypnlp
Copy link
Author

fypnlp commented Jul 9, 2021

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

@lgandecki
Copy link
Collaborator

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

@fypnlp
Copy link
Author

fypnlp commented Jul 9, 2021

let me try it and let me get back to you

@fypnlp
Copy link
Author

fypnlp commented Jul 9, 2021

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

@stevenlafl
Copy link

@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.

@fypnlp
Copy link
Author

fypnlp commented Jul 14, 2021

@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!

@fypnlp fypnlp closed this as completed Jul 14, 2021
@Thetestport
Copy link

Thetestport commented Apr 27, 2024

Hello, can someone please help me? I am experiencing the same issue as reported above "Step Implementation Missing " I have

  1. included the following in my package.json

"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": false,
"stepDefinitions": "cypress/e2e/BDD/"

  1. I have added the .feature file directly into "BDD folder"
  2. I have added a folder "repLogin" to the "BDD folder" and added step file to it

but I still get the error

@badeball
Copy link
Owner

@Thetestport, assuming your using @badeball/cypress-cucumber-preprocessor, you need to configure stepDefinitions with a pattern matching files, EG. cypress/e2e/BDD/*.js.

@Thetestport
Copy link

Thetestport commented May 1, 2024

@badeball thanks for the response. i have done that and still get "step implementation missing

1

@badeball
Copy link
Owner

badeball commented May 1, 2024

Then you need to provide a minimal, reproducible example that illustrates the issue.

@Thetestport
Copy link

Thetestport commented May 2, 2024

@badeball Thanks for the response. I have reproduced my codes and step missing error using a facebook login flow.

@badeball
Copy link
Owner

badeball commented May 2, 2024

I have reproduced my codes and step missing error using a facebook login flow.

You haven't quite though. You omitted to provide file names and locations, which are crucial parts.

Given that you're importing And and doing so from cypress-cucumber-preprocessor/steps - I'm guessing you've been reading some outdated blog post. Stop doing that and instead look through any of the many examples, which all work. The package lives under a new name and no support is provided for cypress-cucumber-preprocessor. Everything you need to know about resolving "Step implementation missing" can be found in the documentation.

@Thetestport
Copy link

Thetestport commented May 2, 2024

@badeball thanks a lot for the help. I am pretty much new to this and confused much, Nevertheless, I will go read up on the documentations you have provided

@Thetestport
Copy link

Thetestport commented May 2, 2024

@badeball Thank you. I have read the documents in the links you provided and the error has been resolved
1

I have also implemented in my real codes and they work perfectly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants