Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To configure the path to your Cucumber features using cucumber-junit, follow these steps:

  1. Add the following dependency to your project:
<dependency>
  <groupId>io.cucumber</groupId>
  <artifactId>cucumber-junit</artifactId>
  <version>{version}</version>
  <scope>test</scope>
</dependency>
  1. In your test runner class, specify the path to your features using the following annotation:
@RunWith(Cucumber.class)
@CucumberOptions(features = "src/test/resources/features")
public class TestRunner {

}

In this example, the features are located in the "src/test/resources/features" directory. You can modify the path accordingly to match your project structure.

  1. Run your tests using JUnit as usual.

With these steps, you have configured the path to your Cucumber features and can now write and execute your tests.