I have two runners in my automation project as follows:
Main runner - Executes all the
@ui-test
tagged test cases and if a scenario is failedtarget/rerun.txt
will be populated with the scenario location (e.g.features/Dummy.feature:22
):@RunWith(Cucumber.class) @CucumberOptions( features = "classpath:features", plugin = {"pretty", "html:target/cucumber-html-report", "json:target/cucumber.json", "rerun:target/rerun.txt"}, tags = {"@ui-test", "~@ignore"} ) public class RunCukesTest { }
Secondary runner - Re-executes the scenarios from
target/rerun.txt
:@RunWith(Cucumber.class) @CucumberOptions( features = "@target/rerun.txt", plugin = {"pretty", "html:target/cucumber-html-report-rerun", "json:target/cucumber_rerun.json"} ) public class ReRunFailedCukesTest { }
When the execution is performed two result json files are created:
cucumber.json
cucumber_rerun.json
Jenkins will collect the results via Cucumber-JVM Reports
plugin and will create a combined report.
The problem is, even if all the target/rerun.txt
tests are passed in the second run, the report status will remain failed because of the cucumber.json
.
Is there a way (to set up Cucumber-JVM Reports
plugin or modify the upper presented runners) to overwrite cucumber.json
with the results from cucumber_rerun.json
and to publish only the modified cucumber.json
?
Another sub-keywords: maven
, java
, cucumber-java8
, cucumber-junit
, junit