cypress-cucumber-preprocessor icon indicating copy to clipboard operation
cypress-cucumber-preprocessor copied to clipboard

I'm getting "Error: Step implementation missing for: I open Bing homepage"

Open tvutx opened this issue 6 years ago • 6 comments

I'm sure my settings are incorrect somewhere but I just can't seem to track it down. image

Below is my git and I appreciate if you could help me solve this. https://github.com/tvutx/cypress-bing

Thanks

tvutx avatar Feb 27 '20 22:02 tvutx

as far as I understood, when you put the steps next to the feature file, the folder containing the JS that will implement the feature needs to have the same name as the feature file. try to rename this folder https://github.com/vutai/cypress-bing/tree/master/cypress/integration/step-definitions to https://github.com/vutai/cypress-bing/tree/master/cypress/integration/bing and try again.

fredicious avatar Feb 28 '20 14:02 fredicious

@fredicious Thanks Fred! That works but the feature file wasn't able to recognize my step definitions. Also, that's not how I want to structure my folders so I removed the following "stepDefinitions": "cypress/integration/step-definitions", "commonPath": "cypress/integration/common" from the package.json file and it didn't seem to work. Somehow it started to work without me having to do anything differently besides removing the code above from the package.json file. It didn't work before but it does now. Weird...

tvutx avatar Feb 28 '20 15:02 tvutx

It was working but it stopped so I changed the folder back to bing and now it's working. Is there a way to keep all test steps in a folder without having to name the test steps folder the same as feature file?

tvutx avatar Feb 28 '20 16:02 tvutx

@tvutx have you seen this ? https://github.com/TheBrainFamily/cypress-cucumber-preprocessor#oldschoollegacy-cucumber-style

That will allow you to put all .js and .feature files in the same folder, if that's what you want to do.

Set your "nonGlobalStepDefinitions" to false or just remove it from your configuration

lgandecki avatar Mar 02 '20 11:03 lgandecki

@lgandecki I don't want them in the same folder but I want to put the step definitions in a folder itself but don't want the folder to have the same name as the feature file.

I want: step-definitions folder to have the test files and feature folder to have all the feature files.

tvutx avatar Mar 02 '20 12:03 tvutx

same answer, set nonGlobalStepDefinitions to true, or remove that setting alltogether. To be honest, this is how this particular repo is setup:

https://github.com/TheBrainFamily/cypress-cucumber-preprocessor/tree/master/cypress/support/step_definitions

https://github.com/TheBrainFamily/cypress-cucumber-preprocessor/tree/master/cypress/integration

So please look at the plugin configuration, and try to replicate. This is not an issue per se, so I'm closing it.

lgandecki avatar Mar 02 '20 13:03 lgandecki