I want to run my cucumber JVM test parallel in different browsers (Firefox and chrome) for that I have runner file as below for each browser followed by my pom.xml settings.
@RunWith(Cucumber.class) @CucumberOptions( format = {"pretty", "html:target/cucumber-report", "json:target/cucumber-report.json"}, features = {"classpath:acceptance/feature"}, glue = {""}, tags = {"@chrome"}, strict = true)
public class AcceptanceITCaseTest2 {
@AfterClass
public static void afterClass() {
if(getDriver()!=null) {
getDriver().manage().deleteAllCookies();
getDriver().quit();
}
}
}
pom.xml
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-integration-test-sources</id>
<phase>generate-test-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>src/test/ac/java/acceptance</source>
<source>src/test/ac/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>enter code here
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.19.1</version>
<executions>
<execution>
<id>acceptance-tests</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<parallel>classes</parallel>
<forkCount>2</forkCount>
<reuseForks>false</reuseForks>
<useFile>false</useFile>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</execution>
</executions>
</plugin>
command:
mvn test -Dit.test=AcceptanceITCaseTest1,AcceptanceITCaseTest2 -P test
output-
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.002s
[INFO] Finished at: Tue Jun 21 13:43:59 BST 2016
[INFO] Final Memory: 27M/260M
Can anyone please let me know what I'm missing here? Why I'm not able to kick the 2 separate runners in parallel here?
Any help is appreciated.
Thanks.