Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

RerunFailedTests

Szymon Nowak edited this page Oct 5, 2016 · 3 revisions

Rerun failed tests

Recording information about failed tests

To record information about failed test use annotation @StoreFailedResults.

@RunWith(Bobcumber.class)
@StoreFailedResults("target/failedTests.properties")
@CucumberOptions(
    features = "src/test/resources/",
    plugin = {"pretty", "html:target/cucumber-html-report/aem-checkbox",
        "json:target/aemCheckboxTest.json"},
    tags = {"@aemCheckbox", "~@disabled"},
    glue = "com.cognifide.qa"
)
public class AemCheckboxTest {
}

After this, information about failed tests will be stored in provided file. You can use the same file to more than one test suite.

Rerun failed tests

To rerun failed tests use standard Bobcumber runner. In cucumber features options indicate where is file with filed tests.

@RunWith(Bobcumber.class)
@CucumberOptions(
    features = {"@target/failedTests.properties"},
    plugin = {"pretty", "html:target/cucumber-html-report/rerun",
        "json:target/rerun.json"},
    glue = "com.cognifide.qa"
)
public class RerunFailedTests {
}

You can also specify, whether tests should rerun or not. Bobcumber saves statistics about failed tests, so you can specify percentage value of maximum tests to rerun. It prevents from triggering tests that works, but failed on e.g. infrastructure issue.

By default, Bobcumber stores statistics in target/testsStatisticFile.properties file, and RerunFailedTests runner allows maximum 10% of failed test that can be rerun. When there's too many test failures, TooManyTestsToRerunException exception is thrown.

To increase percentage value of maximum failed tests, simply override bobcat.report.statistics.retryPercentage property, or pass that parameter with maven -Dbobcat.report.statistics.retryPercentage=25.

Feature files should be stored in project resources.

Getting started with Bobcat

  1. Getting started

AEM Related Features

  1. Authoring tutorial - Classic
  1. AEM Classic Authoring Advanced usage
  1. Authoring tutorial - Touch UI
Clone this wiki locally