TestNG retrying failed tests doesn't output the correct test results

后端 未结 5 1191
别那么骄傲
别那么骄傲 2020-12-13 07:41

Setup: I have a class that extends the IRetryAnalyzer and have implemented a simple retry logic overriding the following method: public boolean retry(IT

5条回答
  •  -上瘾入骨i
    2020-12-13 08:03

    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
                }
    

提交回复
热议问题