Implemented (Junit5+ Cucumber7) parallelism on local machine using @Suite in RunCucumberTest
How do we run a single scenario @tag? (getting below error) @Suite @IncludeTags("@Tag") added in runner file
mvn test -Dcucumber.filter.tags="@tag" Can anyone please advise for same
`<cucumber. Version>7.6.0</cucumber. Version>
<versions.selenium>3.141.59</versions.selenium>
<webdrivermanager.version>5.2.1</webdrivermanager.version>
<junit.jupiter.version>5.9.2</junit.jupiter.version>`
<apache.common.version>2.4</apache.common.version>
<projectlombok.version>1.18.24</projectlombok.version>
<maven.compiler.plugin.version>3.9.0</maven.compiler.plugin.version>
<maven.surefire.plugin.version>3.0.0-M5</maven.surefire.plugin.version>
<maven.compiler.source.version>11</maven.compiler.source.version>
<maven.compiler.target.version>11</maven.compiler.target.version>
<extentreports.cucumber7.adapter.version>1.7.0</extentreports.cucumber7.adapter.version
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running testrunners.RunCucumberTest
Mar 28, 2023 4:10:58 PM org.junit.platform.launcher.core.CompositeTestExecutionListener lambda$notifyEach$19
WARNING: TestExecutionListener [org.apache.maven.surefire.junitplatform.RunListenerAdapter] threw exception for method: executionFinished(TestIdentifier [uniqueId = [engine:junit-platform-suite]/[suite:testrunners.RunCucumberTest]/[engine:cucumber], parentId = [engine:junit-platform-suite]/[suite:testrunners.RunCucumberTest], displayName = 'Cucumber', legacyReportingName = 'Cucumber', source = null, tags = [], type = CONTAINER], TestExecutionResult [status = FAILED, throwable = java.lang.RuntimeException: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target])
java.lang.IncompatibleClassChangeError: Class org.apache.maven.surefire.report.PojoStackTraceWriter does not implement the requested interface org.apache.maven.surefire.api.report.StackTraceWriter
at org.apache.maven.surefire.booter.spi.LegacyMasterProcessChannelEncoder.encode(LegacyMasterProcessChannelEncoder.java:354)
at org.apache.maven.surefire.booter.spi.LegacyMasterProcessChannelEncoder.encode(LegacyMasterProcessChannelEncoder.java:402)
at org.apache.maven.surefire.booter.spi.LegacyMasterProcessChannelEncoder.encode(LegacyMasterProcessChannelEncoder.java:289)
at org.apache.maven.surefire.booter.spi.LegacyMasterProcessChannelEncoder.testError(LegacyMasterProcessChannelEncoder.java:175)
at org.apache.maven.surefire.api.booter.ForkingRunListener.testError(ForkingRunListener.java:99)
at org.apache.maven.surefire.junitplatform.RunListenerAdapter.executionFinished(RunListenerAdapter.java:133)
at org.junit.platform.launcher.core.CompositeTestExecutionListener.lambda$executionFinished$10(CompositeTestExecutionListener.java:69)
at org.junit.platform.launcher.core.CompositeTestExecutionListener.lambda$notifyEach$19(CompositeTestExecutionListener.java:95)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
Cucumber tags are mapped to JUnit tags. Note that the @ symbol is not part of the JUnit tag. So the scenarios below are tagged with Smoke and Sanity.
@Smoke @Ignore Scenario: A tagged scenario Given I tag a scenario When I select tests with that tag for execution Then my tagged scenario is executed @Sanity Scenario: Another tagged scenario Given I tag a scenario When I select tests with that tag for execution Then my tagged scenario is executed
So to select the smoke test you would use
@Suite
@IncludeEngines("cucumber")
@IncludeTags("smoke")
public class RunCucumberTest {
}
This is unrelated to your exception. But should you get that fixed, this is the next step.