question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"cucumber.features" is ignored from cucumber.properties file

See original GitHub issue

Describe 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:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mpkorstanjecommented, Sep 30, 2021

Packages are usually organized by reverse TLD. Something like com.example.projectname. So features should sit in the src/test/resources/com/example/projectname directory or a sub directory. For example see:

https://github.com/cucumber/cucumber-java-skeleton

0reactions
fslevcommented, Sep 30, 2021

Ok, Thanks for the feedback. I’ll close this issue now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cucumber tests not reading cucumber.properties file
When you are using Cucumber with JUnit5 through the cucumber-junit-platform-engine the tests are run by the JUnit platform.
Read more >
cucumber.features property completely ignored when running ...
I tried to put this cucumber.features property in src/test/resources/junit-platform.properties and pass it explicitly to mvn -Dcucumber.features ...
Read more >
Cucumber Reference - Cucumber Documentation
When Cucumber can't find a matching step definition, the step gets marked as undefined (yellow), and all subsequent steps in the scenario are...
Read more >
Why Is My Cucumber Test Ignored? - Sweetish Hill
You can ignore Cucumber Tests using tags. not word is used along with tags to ignore the test. This works both for the...
Read more >
Java How to ignore particular feature or scenario in cucumber?
One way of ignoring tag is mention only tags which you want to run in tags property of CucumberOptions but this is not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found