Xceptance / neodymium-library

A test automation library based on common other best practice open source libraries. It adds missing functionalities but does not reinvent the wheel. Just glues stuff together nicely and adds some sprinkles.
MIT License
80 stars 11 forks source link

Repeat on failure #53

Open occupant23 opened 6 years ago

occupant23 commented 6 years ago

Add an annotation on test case and test function level that leads to another execution if the test case fails. If the test runs successful no further execution is required.

An optional parameter should be the number of retries (default 1).

@RepeatOnFailure(3)
@Test 
public void test()
{
    // test something 
}

Add documentation and test cases for this feature.

Possible hint for implementation with jUnit: https://stackoverflow.com/questions/8295100/how-to-re-run-failed-junit-tests-immediately.

occupant23 commented 5 years ago

A temporary solution for this is to use a Surefire feature when executing the test in a CI environment. -Dsurefire.rerunFailingTestsCount=1 Can also be set in pom.xml