0

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

2
  • You're using Cucumber v6. The current documentation is for v7. Try starting from scratch with github.com/cucumber/cucumber-java-skeleton Commented Aug 16, 2023 at 12:00
  • I used the template that passed and it worked, thank you! Commented Aug 16, 2023 at 17:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.