I want to create simply selenium project for Jenkins. When I run my test with Runner.java then output show me 0 scenarios. When I run my test with mvn, e.g.mvn clean verify -Dcucumber.options="--tags @smoke" output show me BUILD SUCCESS
All my classes is in src/test/java/package
Runner: src/test/java/runner/Runner.java
Glue: src/test/java/glue/login/LoginDef.java src/test/java/glue/dashboard/DashboardDef.java
cucumber's file src/test/resources/login/login.feature src/test/resources/smoke/page.feature
Below is screenshot my folders structure https://prnt.sc/nwov73
I have no idea where is problem ;/ I used google before I asked and I not found solution...
@RunWith(Cucumber.class)
@CucumberOptions(
strict = true,
features = {"src/test/resources/features"},
plugin = {"json:build/reports/cucumberRunner.json", "html:build/reports/html", "pretty"},
monochrome = true,
tags = {"not @ignore", "not @wip", "@login", "@smoke"},
glue = {"src/test/java/glue", "hooks"}
)
public class Runner {
}
<properties>
<io.cucumber.gherkin>5.1.0</io.cucumber.gherkin>
<io.cucumber.common>4.3.1</io.cucumber.common>
<selenide>5.2.3</selenide>
<lombok>1.18.4</lombok>
<junit>4.12</junit>
</properties>
<dependencies>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>gherkin</artifactId>
<version>${io.cucumber.gherkin}</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java8</artifactId>
<version>${io.cucumber.common}</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>${io.cucumber.common}</version>
</dependency>
<!--<dependency>-->
<!--<groupId>io.cucumber</groupId>-->
<!--<artifactId>cucumber-jvm</artifactId>-->
<!--<version>${io.cucumber.common}</version>-->
<!--</dependency>-->
<!-- junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit}</version>
</dependency>
<!-- lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok}</version>
<scope>provided</scope>
</dependency>
<!-- selenide -->
<dependency>
<groupId>com.codeborne</groupId>
<artifactId>selenide</artifactId>
<version>${selenide}</version>
<!-- <scope>test</scope>-->
</dependency>
</dependencies>
<build>
<!--<testSourceDirectory>src/test/resources/features/</testSourceDirectory>-->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
</plugin>
</plugins>
</build>
</project>
Edit: I change Runner.java to RunnerTest.java. Mvn execute tests but all tests fail. All steps has "You can implement missing steps with the snippets below:" ;/
Edit2: I remove "@" from tags in RunnerTest.java and currently I have always "0 Scenarios 0 Steps 0m0.093s"
Edit 3 - problem solved. I don't have path in glue to class where I have driver config. actually my glue - glue = {"glue", "config/browser"}. Before I had only {"glue"}.