Closed GuillaumeMorinQc closed 1 year ago
Funny, was going to write a similar ticket today.
We are having the same issue. We want to share one steps folder, thus we need an option to set a relative path, where all steps are defined.
With the current "hack" from the example it is not possible to map the above folder structure.
Something like this:
bdd_widget_test|featureBuilder:
options:
stepFolderPath: tests/steps
Either that, an option to specify that this path is relative to the root of the project or an expression like "{cwd}" at the beginning to resolve the current directory
That would be a breaking change, but we probably may introduce the syntax @DerJojo11 mentioned. I will have a look at this on the weekend. Thanks for raising this issue!
This should work in 1.6.0
. If the step folder name starts with ./
or ../
- bdd_widget_test
will treat it as relative to the feature folder path (the behavior prior to 1.6.0
). If not - it will look for a folder under the test
folder.
So, if you want to have a single steps folder for the package, you may set it up like this:
stepFolderPath: steps
Would you please test the new feature?
Awesome! Thanks!
So I tried it out and it works good!
My Folder Structure looks like this:
With this structure, I wish to have a folder structure like this:
Right now, I can set the folderPath for it to:
stepFolderPath: steps
and remove the stepFolderName. Then, this solution won't work. We are creating then multiple step folder in each feature.
But if I use only the
stepFolderName: steps
Then we won't build new step folders. Instead only one Folder under the test fold has been created! This is great! And we can ow use our own folder structure!
Then, I tried testing to change the folder path to something like this:
stepFolderName: all_steps
stepFolderPath: steps/all_steps
This won't work. Because we know create one all_steps folder under the test folder.
Currently the way via stepFolderPath does not work. Or I did not understand it correctly. But my wish to create a step folder for all tests works fine! So thank you very much for that!
Sorry for the confusion, there is no stepFolderPath
parameter, I copy-pasted it from your comment and didn't notice that it is not stepFolderName
. My bad 🤦♂️
So, you may use the stepFolderName
parameter to set both the name and the path and inside the new folder you may use whatever structure you like - put everything in the root of the folder or create sub-folders to match the structure of your test folder.
Do you think we may close the issue?
Ah ok!
For my part, we can close this issue. 😃
It's exactly what we needed
In our project we would like to organize our feature files like this:
Since feature files does not share the same level hierarchically, multiple step folders are created even with a relative stepFolderName. Result :
Can we have an option, so we can use a path relative to the project folder to generate steps independently of the feature files hierarchy ?