how to re run failed test using jvm-cucumber-parallel-plugin how to re run failed test using jvm-cucumber-parallel-plugin selenium selenium

how to re run failed test using jvm-cucumber-parallel-plugin


You can try to rerun failed tests using maven-surefire-plugin like this:

<configuration>    <rerunFailingTestsCount>3</rerunFailingTestsCount></configuration>

and add a plugin as following:

<plugin>    <groupId>org.apache.maven.plugins</groupId>    <artifactId>maven-surefire-plugin</artifactId>    <version>2.21.0</version></plugin>

The whole .pom file would look like this:

<plugin>    <groupId>com.github.temyers</groupId>    <artifactId>cucumber-jvm-parallel-plugin</artifactId>    <version>4.2.0</version>    <executions>        <execution>            <id>generateRunners</id>            <phase>generate-test-sources</phase>            <goals>                <goal>generateRunners</goal>            </goals>            <configuration>                <outputDirectory>${basedir}/target/runner</outputDirectory>                <glue>                    <package>com.xxx.stepdefs</package>                    <package>com.xxx.cucumber.hooks</package>                </glue>                <featuresDirectory>src/test/resources/feature</featuresDirectory>                <cucumberOutputDir>${basedir}/target/cucumberreport/json</cucumberOutputDir>                <format>json</format>                <strict>true</strict>                <plugins>                    <plugin>                        <name>json</name>                    </plugin>                </plugins>                <useTestNG>true</useTestNG>                <namingScheme>pattern</namingScheme>                <namingPattern>Parallel{c}TestRunner</namingPattern>                <parallelScheme>FEATURE</parallelScheme>            </configuration>        </execution>    </executions></plugin><plugin>    <artifactId>maven-surefire-plugin</artifactId>    <version>2.20.1</version>    <configuration>        <surefire.rerunFailingTestsCount>3</surefire.rerunFailingTestsCount>    </configuration></plugin>

NOTE: This feature is supported only for JUnit 4.x.

More information can be found in the official documentation here.

Also there is a custom gitHub project, which extends Cucumber options and allows to set re-run failed tests count and even conditional re-run. You can check it here:

PS: you can check also answers here.