Unable to run cucumber tests parallelly with Maven failsafe plugin

Viewed 43

Have 2 feature files Abc.feature and xyz.feature to run them paralley below is the configuration have done.

However when running tests through command prompt using below command 2 browser window does not open

mvn verify -Denvironment=dev

Can anyone suggest what is missing here?..

mvn verify -Denvironment=dev

POM.XML

<plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>3.0.0-M7</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>E2ETest</goal>
                                <goal>verify</goal>
                            </goals>
                            <configuration>
                                <includes>
                                    <include>**/TestRunner.java</include>
                                </includes>
                                <parallel>methods</parallel>
                                <threadCount>4</threadCount>
                                <perCoreTgreadCount>true</perCoreTgreadCount>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
<plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.1</version>
                    <configuration>
                        <encoding>UTF-8</encoding>
                        <source>1.8</source>
                        <target>1.8</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.0.0-M5</version>
                    <configuration>
                        <systemPropertyVariables>
                            <!--suppress UnresolvedMavenProperty ->
                            <environment.code>${environment}</environment.code>
                        </systemPropertyVariables>
                        <includes>
                            <include>**/TestRunner.java</include>
                        </includes>
                    </configuration>
                </plugin>

enter image description here

1 Answers

There is a typo in <perCoreTgreadCount>true</perCoreTgreadCount>, you want perCoreThreadCount in both tags.

Fix that and retry. If that doesn't sort it, I wasn't 100% sure from your question what "features" means but double check that it's definitely methods that you want running in parallel. You could try updating it to <parallel>all</parallel>, which will change how granular your parallelization can be.

Related