-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Option cucumber.features does not work in cucumber.properties file #2245
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
Comments
/**
* Either a URI or path to a directory of features or a URI or path to a
* single feature optionally followed by a colon and line numbers.
* <p>
* When no feature path is provided, Cucumber will use the package of the
* annotated class. For example, if the annotated class is
* {@code com.example.RunCucumber} then features are assumed to be located
* in {@code classpath:com/example}.
*
* @return list of files or directories
* @see io.cucumber.core.feature.FeatureWithLines
*/
String[] features() default {}; |
@mpkorstanje if that is the solution to my problem, i did not understand you. can you explain it to me in more detail please? |
When using So you can not use a properties file to provide the location of features. Instead consider putting them in the same package as the runner. So if the runner class is located in |
https://github.com/cucumber/cucumber-jvm/blob/main/junit-platform-engine/src/main/java/io/cucumber/junit/platform/engine/Constants.java The cucumber.publish.quiet option works in the cucumber.properties file
cucumber.glue does not work
cucumber.features does not work |
Yes, that is working as expected. cucumber-jvm/core/src/main/java/io/cucumber/core/options/CucumberOptionsAnnotationParser.java Lines 52 to 53 in 6c23c0e
But I feel there is some information missing. What are you trying to accomplish? Providing context helps us come up with a solution. |
My test suite has different packgages e.g.:
We have multiple test classes to filter features with the tag option. Therefore every CucumberTest file has the following entry: I would like to move this option to the cucumber.properties file so I understand now that this does not work since the annotation always falls back to the current package path. We moved the @CucumberOptions plugin and publish from the CucumberTest files Regarding cucumber.glue: |
Yes.
You are using
That would make sense. Unfortunately this quirk has been around since v1, changing it now could have its own surprising results. And now that Junit 5 exists I don't think its will be worth while to spend too much time improving on JUnit 4. So I would suggest the following options:
|
My test class is:
My cucumber.properties file is:
This works fine.
Then I move the "features" and the "glue" option from the test class to the cucumber.properties file:
New test class:
New cucumber.properties file:
It does NOT work.
java jdk 14
cucumber-junit 6.8.1
cucumber-java 6.8.1
cucumber-picocontainer 6.8.1
I couldn't find anything in internet documentation that helped me.
There are very few examples of the cucumber.properties file.
On the other hand, I found the class io.cucumber.core.options.Constants and believe that I have found the possible options in the cucumber.properties.
Is that right?
Many thanks for your help
The text was updated successfully, but these errors were encountered: