How to pass rerunFailingTestsCount value to cucumber-junit-runner.java.vm retryCount

Viewed 12

Below is my pom where i am trying to rerun failed scenario from cucumber

<properties>
    <cucumber.scenario.execution.tag>@TestOne</cucumber.scenario.execution.tag>
    <automation.thread.count>18</automation.thread.count>
</properties>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.0.0-M7</version>
            <configuration>
                <forkCount>5</forkCount>
                <reuseForks>false</reuseForks>
                <includes>
                    <!--<include>**/RunCukes*.class</include>-->
                    <include>**/Parallel*.java</include>
                </includes>
                <rerunFailingTestsCount>1</rerunFailingTestsCount>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>1.8</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </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>xxx</package>                                
                        </glue>
                        <featuresDirectory>xxx/features</featuresDirectory>
                        <outputDirectory>${project.build.directory}/generated-test-sources/cucumber</outputDirectory>
                        <cucumberOutputDir>target/cucumber-parallel</cucumberOutputDir>
                        <format>json</format>
                        <plugins>
                            <plugin>
                                <name>json</name>
                            </plugin>
                        </plugins>
                        <strict>true</strict>
                        <monochrome>true</monochrome>
                        <tags>
                            <tag>${cucumber.scenario.execution.tag}</tag>
                        </tags>
                        <useTestNG>true</useTestNG>
                        <namingScheme>simple</namingScheme>
                        <namingPattern>Parallel{c}IT</namingPattern>
                        <parallelScheme>FEATURE</parallelScheme>
                        <customVmTemplate>src/test/resources/cucumber-junit-runner.java.vm</customVmTemplate>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        
    </plugins>
</build>
<dependencies>
    
   
This is my pom and below is the my cucumber-junit-runner.java.vm

@RunWith(ExtendedCucumber.class) @ExtendedCucumberOptions(retryCount = 0)

I want to pass retryCount value from rerunFailingTestsCount available in POM. How can i do this.

Basically I want to retry the failed test cases

0 Answers
Related