I am facing an issue, unable to execute the my Run...
# community-support
r
I am facing an issue, unable to execute the my Runner file in the CMD mode Here is my Runner class package CFPlatform.runner; import io.cucumber.junit.CucumberOptions; import net.serenitybdd.cucumber.CucumberWithSerenity; import org.junit.runner.RunWith; @RunWith(CucumberWithSerenity.class) @CucumberOptions( features = "src/test/resources/features", glue = "CFPlatform.glue", plugin = {"pretty", "html:target/cucumber-reports"} ) public class CFPlatformRunner { } and my build.gradle file as plugins { id 'java-library' id 'eclipse' id 'idea' //id 'net.serenity-bdd.aggregator' version '2.4.24' // Serenity plugin } repositories { mavenCentral() } dependencies { // JUnit Jupiter for testing testImplementation 'org.junit.jupiterjunit jupiter5.8.1' // Serenity dependencies implementation 'net.serenity-bddserenity core4.1.15' implementation 'net.serenity-bddserenity cucumber4.1.15' implementation 'net.serenity-bddserenity screenplay4.1.15' implementation 'net.serenity-bddserenity screenplay webdriver4.1.15' implementation 'io.cucumbercucumber java6.15.0' implementation 'io.cucumbercucumber junit6.15.0' // Other dependencies as per your project requirements implementation 'org.seleniumhq.seleniumselenium java4.19.1' // Apache POI dependencies implementation 'org.apache.poipoi5.2.3' implementation 'org.apache.poipoi ooxml5.2.3' // Other dependencies implementation 'org.junit.jupiterjunit jupiter5.8.1' implementation 'com.google.guavaguava30.1.1' implementation 'org.apache.commonscommons math33.6.1' } test { testLogging.showStandardStreams = true useJUnitPlatform() // Use JUnit Platform for running tests } tasks.withType(Test) { testLogging { events "passed", "skipped", "failed" } } // Task for running Cucumber tests task cucumber() { dependsOn assemble, compileTestJava doLast { javaexec { main = "io.cucumber.core.cli.Main" classpath = sourceSets.test.runtimeClasspath args = ['--plugin', 'pretty', '--glue', 'com.yourpackage.stepdefinitions', 'src/test/resources/features'] } } } gradle.startParameter.continueOnFailure = true apply plugin: 'java' and getting the output as Working Directory: C:\workspace\CFPlatform.com\lib Gradle user home: C:\Users\rames\.gradle Gradle Distribution: Gradle wrapper from target build Gradle Version: 7.4.2 Java Home: C:\Eclipse2023-03\eclipse\plugins\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.6.v20230204-1729\jre JVM Arguments: None Program Arguments: None Build Scans Enabled: false Offline Mode Enabled: false Tests: CFPlatform.runner.CFPlatformRunner
Task libcompileJava
Task libprocessResources NO-SOURCE
Task libclasses
Task libcompileTestJava
Note: C:\workspace\CFPlatform.com\lib\src\test\java\CFPlatform\Steps\LoginSteps.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.
Task libprocessTestResources
Task libtestClasses
Task libtest
FAILURE: Build failed with an exception. * What went wrong: No matching tests found in any candidate test task. Requested tests: Test class CFPlatform.runner.CFPlatformRunner * Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
* Get more help at https://help.gradle.org BUILD FAILED in 2s 4 actionable tasks: 4 executed Please help me on this
v
@RunWith
is from JUnit 4. But you configure the test task to run JUnit 5 Jupiter tests, so your test class is not found. Either configure to use JUnit 4, or include the Vintage engine which can run JUnit 4 tests in JUnit 5 platform.
r
I will check it and let you know
👌 1