lundi 26 octobre 2020

Rerun Failed test Cases in Cucumber Automatically using Maven Command

I am not using TestNG. I wanna rerun failed test scenarios using Maven automatically.

When I trigger mvn should run test and create rerun.txt for all the failed scenarios. I am able to create rerun.txt on runtime but can't run failed scenarios automatically.

testrunner.java

@CucumberOptions(
    features = "src/main/features/",
    plugin = {"pretty", "html:target/cucumber-report", "json:target/cucumber- 
    report/report.json", "rerun:target/rerun/rerun.txt"},
    tags = {"@test"},

pom.xml

       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
           <includes>
                 <include>**/*testrunner*.java</include>
           </includes>
         </configuration>
       </plugin>

Also, I am aware that I can create another test runner for a rerun and run it manually. When I do that and add it on pom.xml. testReRunner sometime runs without failed test cases create in rerun.txt file.

Aucun commentaire:

Enregistrer un commentaire