Forum Discussion

vaibhavsharma81's avatar
vaibhavsharma81
Occasional Visitor
2 years ago

@IncludeTag Cucumber7 + Junit5

Hello Team,

 

Need advise, I am using Junit5+Cucumer7 for parallel execution and I am able to perform the same.

However I am unclear as how do we run a scenario via @Tag and same to run via maven

@Suite
@IncludeTags("@tag")

 

Maven command > mvn test -Dcucumber.filter.tags="@tag"

When executed I get below error 

 

[INFO] --- maven-surefire-plugin:3.0.0-M5:test (default-test) @ MTH_SF_CRM ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running testrunners.RunCucumberTest
Mar 28, 2023 4:20:05 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)

 

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>11</java.version>
<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.10.1</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>
<extentreports.version>5.0.9</extentreports.version>
</properties>

No RepliesBe the first to reply