Requesting Enhancement for "Step_Definitions" location configuration in package.json to support glob patterns
See original GitHub issueFirst of all I want to say that I really love the work you guys have done here. I would, however, like to propose a small tweak to allow the “steps_definitions” location configuration property, configurable in package.json to allow glob patterns.
A potentially quick fix to make this happen would be to replace (in “index.js” at the root folder)
if (loaded && loaded.config && loaded.config.step_definitions) { return path.resolve(appRoot, loaded.config.step_definitions); }
with
if (loaded && loaded.config && loaded.config.step_definitions) { return `${appRoot}/loaded.config.step_definitions`; }
Getting rid of path.resolve, will allow the user to pass in a glob string without it ultimately resolving to something unintended (doesn’t say anywhere that glob patterns aren’t supported there yet).
I need this enhancement because i’m working on a project wherein all the step_definitions aren’t defined under one parent folder by design. This enhancement will give users more flexibility to structure their step_definition files as they see fit.
I can currently achieve my ask by using the “fileServerFolder” configuration property configurable in “cypress.json” but the comment in the aforementioned “index.js” file says it is deprecated but left for backwards compatibility. Not sure if it is going to remain there longterm though. However, ideally, it would be awesome to have that functionality in the “step_definitions” configuration property.
Thanks! I really appreciate your efforts so far!
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (1 by maintainers)
Top GitHub Comments
I am having a similar issue, I am trying to separate features from step_definitions so in my package.json :
"cypress-cucumber-preprocessor": { "step_definitions": "./cypress/integration/project/stepdefinitions/" }
and my file path for features is cypress/integration/project/features/file.feature
When I run the feature, it cannot find my step definitions.
Due to personal reasons, the previous maintainers of this package are stepping down and handing the reigns over to me, a long-time contributor to the project and a user of it myself. This is a responsibility I’m very excited about. Furthermore, I’d like to thank @lgandecki ++ for all the work that they’ve done so far.
Read more about the transfer of ownership here.
The repository has however moved and all outstanding issues are being closed. This is not a reflection of the perceived importance of your reported issue. However, if after upgrading to the new version, you still find there to be an issue, feel free to open up another ticket or comment below. Please make sure to read CONTRIBUTING.md before doing so.