RetryTest

annotation class RetryTest(val times: Int = 1)

Annotates either a test class or a test method with a retry request of times.

If this annotation is used in the same class and test methods, the annotation of the method takes precedence

Example:

@RetryTest(times = 5)
class SampleTest() {

@get:Rule
val retryRule = RetryTestRule()

@RetryTest(times = 2)
@Test
fun testSomething() {
// This test will be retried 2x if it fails
}

@Test
fun testAnotherThing() {
// This test will be retried 5x if it fails,
// because of the class configuration
}
}

Properties

Link copied to clipboard
val times: Int = 1

The number of times a test should be retried. Minimum should be one