Setup: I have a class that extends the IRetryAnalyzer and have implemented a simple retry logic overriding the following method: public boolean retry(IT
This is fixed without having to do any extra magic in your Retry Analyzer in the latest version of TestNG 7.1.0.
Tests that were retried will now be labeled as "retried" and you can see this in the
emailable-report.html
report that gets generated after runs.
If you'd still like to do some logic with the tests as they are being retried you can do this:
@AfterMethod(alwaysRun = true)
public void afterMethod( ITestResult result) throws Exception {
if (result.wasRetried()){
//your logic here
}