"cucumber.features" is ignored from cucumber.properties file
See original GitHub issueDescribe the bug It seems that Cucumber ignores the “cucumber.features” property defined inside the cucumber.properties file
To Reproduce I have the following light project which can be used for reproducing this issue: https://github.com/fslev/cucumber-showcase
It contains one feature file defined inside “src/test/resources/features” directory:
Feature: Calculator feature
@happy
Scenario: Add two numbers (happy)
* Check 3 + 2 = 5
@negative
Scenario: Add two numbers (negative)
* Check 3 + 2 != 4
Inside “src/test/resources” I have the following cucumber.properties file:
cucumber.filter.tags=not @negative
cucumber.features=src/test/resources/features
And I’ve also defined the following test class (TestNG):
public class CalculatorTest extends AbstractTestNGCucumberTests {
}
1.) Run tests via Maven command:
mvn clean test
Actual:
WARNING: No features found at classpath:/io/example
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
2.) Add the features option on CalculatorTest class:
@CucumberOptions(features = "src/test/resources/features")
public class CalculatorTest extends AbstractTestNGCucumberTests {
}
3.) Run tests again: Actual:
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
As you can see, now Cucumber was able to find the feature files, since I defined the path directly inside the @CucumberOptions Also, It seems that “cucumber.filter.tags” was read from cucumber.properties file, since only one test was executed. However, the “cucumber.features” is always ignored from cucumber.properties.
Reproduced issue with the following versions of Cucumber for Java: 7.0.0-RC1, 6.10.4
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Packages are usually organized by reverse TLD. Something like
com.example.projectname
. So features should sit in thesrc/test/resources/com/example/projectname
directory or a sub directory. For example see:https://github.com/cucumber/cucumber-java-skeleton
Ok, Thanks for the feedback. I’ll close this issue now.