Environment - Cucumber V. 4.2.3 | Selenium V.3.8.1 | JUnit V.4.12 | cucumber-jvm- parallel-plugin V.5.0.0 | maven-surefire-plugin V.2.22.1 | maven-compiler- plugin v.3.3
Seems like Maven Surefire is trying to configure TestNG with created runners by Cucumber-JVM Parallel Plugin. I want to run via Junit not by TestNG. Not sure, why its connecting to TestNG.
[INFO] Running TestSuite
Configuring TestNG with: TestNG60Configurator
[TestNG] [ERROR] No test suite found. Nothing to run
Usage: <main class> [options] The XML suite files to run
Configuring TestNG with: TestNG60Configurator
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.573 s - in TestSuite
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.108 s
[INFO] Finished at: 2019-02-18T00:28:10+05:30
[INFO] ------------------------------------------------------------------------
I have mentioned useTestNg as false in cucumber jvm parallel plugin.
Maven Surefire Plugin Configuration
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<configuration>
<forkCount>2</forkCount>
<reuserForks>true</reuserForks>
<includes>
<include>**/Parallel*IT.class</include>
</includes>
</configuration>
</plugin>
Cucumber JVM Parallel Plugin -
<plugin>
<groupId>com.github.temyers</groupId>
<artifactId>cucumber-jvm-parallel-plugin</artifactId>
<version>5.0.0</version>
<executions>
<execution>
<id>generateRunners</id>
<phase>generate-test-sources</phase>
<goals>
<goal>generateRunners</goal>
</goals>
<configuration>
<glue>
<package>com.jacksparrow.automation.steps_definitions.functional</package>
</glue>
<outputDirectory>${project.build.directory}/generated-test-sources/cucumber</outputDirectory>
<featuresDirectory>src/test/resources/features/functional/</featuresDirectory>
<cucumberOutputDir>target/cucumber-parallel</cucumberOutputDir>
<plugins>
<plugin>
<name>json</name>
</plugin>
</plugins>
<useTestNG>false</useTestNG>
<namingScheme>simple</namingScheme>
<!-- The class naming pattern to use. Only required/used if naming scheme
is 'pattern'. -->
<namingPattern>Parallel{c}IT</namingPattern>
<!-- CucumberOptions.strict property -->
<strict>true</strict>
<!-- CucumberOptions.monochrome property -->
<monochrome>true</monochrome>
</configuration>
</execution>
</executions>
</plugin>
Can someone guide me why Surefire is trying to configure TestNG for running generated runners and at last it says Build Successful and No Test Case gets executed. Please guide.
Issue was because of Dependency on testNG causes Surefire to ignore JUnit wrapper class. I removed all the TestNG dependencies or you can take a call to 2 define 2 execution - For TestNG & JUnit and disable one as per your need.