Im trying to use Cucumber 7.11.0 to run my feature files. But it doesn't seem to be able to find them. I am trying to run as part of the maven verify stage with maven-failsafe-plugin
Here is my test runner class:
@Suite
@IncludeEngines("cucumber")
@SelectClasspathResource("features")
@ConfigurationParameter(key = PLUGIN_PROPERTY_NAME, value = "pretty")
@ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "com.app.rs.api.cucumber")
public class TestRunner {}
My Project structure:
| /src
| - /test
| -- /java
| --- /com/app/rs/api/cucumber
| ---- /stepdefinition
| ----- StepDef.java
| ---- TestRunner.java
| -- /resources
| --- /features
| ---- test.feature
When I try to run my TestRunner I get the following error message
Internal Error occurred.
org.junit.platform.commons.JUnitException: TestEngine with ID 'junit-platform-suite' failed to discover tests
My pom.xml:
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>7.11.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit-platform-engine</artifactId>
<version>7.11.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.9.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite</artifactId>
<version>1.9.2</version>
<scope>test</scope>
</dependency>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.0.0-M8</version>
<configuration>
<forkCount>0</forkCount>
<useSystemClassLoader>false</useSystemClassLoader>
<skip>${release}</skip>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
Maybe try to specify the path like:
features="src/test/resources" in @SelectClasspathResource("features"), if it is possible, coz in the older versions of Cucumber we have to use it like: @CucumberOptions(features="src/test/resources") so maybe the new version expects smth similar to this