I'm facing an issue with setting up Cucumber tests using JUnit. I have followed the steps mentioned in the documentation, but the Cucumber runner is not finding my feature files.
Here's a brief overview of my setup:
- IDE: Eclipse IDE for Java Developers - 2023-06
- Dependencies: Cucumber 6.10.4, JUnit 4.13 and jnit.jupiter 5.6.2
- Project structure: src/test/resources/features/vendor_group.feature
My Cucumber runner class looks like this:
package br.com.winn.acceptances;
import org.junit.runner.RunWith;
import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;
@RunWith(Cucumber.class)
@CucumberOptions(features = "src/test/resources/features")
public class CucumberRunner {
}
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version> <!-- Use a versão mais recente do Selenium 3 -->
</dependency>
<!-- Cucumber -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>6.10.4</version> <!-- Use a versão mais recente do Cucumber 6 -->
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>6.10.4</version> <!-- Use a versão mais recente do Cucumber JUnit 6 -->
</dependency>
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.6.2</version>
<scope>test</scope>
</dependency>
Feature: Edit vendor group
Scenario: Access the application
Given that navigate to the URL
When fill in the field username
And fill in the field password
Then get access to the home app
When running my Cucumber runner class with JUnit, JUnit runs but doesn't locate the Cucumber feature. I've inserted the complete repository path as well, and the issue persists. No errors are displayed during the execution. enter image description here