Package core.support.listeners
Class RetryTest
java.lang.Object
core.support.listeners.RetryTest
- All Implemented Interfaces:
org.testng.IRetryAnalyzer
public class RetryTest extends Object implements org.testng.IRetryAnalyzer
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRetryTest.ReportType -
Field Summary
Fields Modifier and Type Field Description static booleanenableRetrystatic List<String>errorListstatic List<ExcelObject>exceListstatic intlogin_success_withErrorstatic String[]PageErrorsintretryCountstatic intuserIndex -
Constructor Summary
Constructors Constructor Description RetryTest() -
Method Summary
Modifier and Type Method Description interrorHandling(Throwable t)error handling When test fails if any of the defined errors specified by PageErrors exists, Then the test will be retriedcom.aventstack.extentreports.ExtentTestgetStep()com.aventstack.extentreports.ExtentTestgetTest()StringgetTestId(org.testng.ITestResult iTestResult)voidlogError(String error)voidlogReport(RetryTest.ReportType type, String value, Throwable t)voidlogReportResult(int maxRetryCount)if failed rerun option is enabled, do not log failures until fails after suitebooleanpageHasError(Throwable t)returns true if any of the error types specified is caughtintprocessTestResult()if the max retry has not been reached, log the failure And quite the browservoidrandomFailStack(ArrayList<String> FailTrace)booleanretry(org.testng.ITestResult iTestResult)voidsetExtendReport()voidsetExtendReport(com.aventstack.extentreports.ExtentTest test, com.aventstack.extentreports.ExtentTest step)
-
Field Details
-
PageErrors
-
userIndex
public static int userIndex -
login_success_withError
public static int login_success_withError -
exceList
-
errorList
-
retryCount
public int retryCount -
enableRetry
public static boolean enableRetry
-
-
Constructor Details
-
RetryTest
public RetryTest()
-
-
Method Details
-
setExtendReport
public void setExtendReport(com.aventstack.extentreports.ExtentTest test, com.aventstack.extentreports.ExtentTest step) -
setExtendReport
public void setExtendReport() -
getTest
public com.aventstack.extentreports.ExtentTest getTest() -
getStep
public com.aventstack.extentreports.ExtentTest getStep() -
retry
public boolean retry(org.testng.ITestResult iTestResult)- Specified by:
retryin interfaceorg.testng.IRetryAnalyzer
-
getTestId
-
processTestResult
public int processTestResult()if the max retry has not been reached, log the failure And quite the browser- Returns:
-
logReportResult
public void logReportResult(int maxRetryCount)if failed rerun option is enabled, do not log failures until fails after suite- Parameters:
maxRetryCount-
-
logReport
-
logError
-
pageHasError
returns true if any of the error types specified is caught- Parameters:
t-- Returns:
-
errorHandling
error handling When test fails if any of the defined errors specified by PageErrors exists, Then the test will be retried- Parameters:
t-- Returns:
-
randomFailStack
-