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
All Methods Instance Methods Concrete Methods 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 Detail
-
PageErrors
public static final String[] PageErrors
-
userIndex
public static int userIndex
-
login_success_withError
public static int login_success_withError
-
exceList
public static List<ExcelObject> exceList
-
retryCount
public int retryCount
-
enableRetry
public static boolean enableRetry
-
-
Method Detail
-
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
public String getTestId(org.testng.ITestResult iTestResult)
-
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
public void logReport(RetryTest.ReportType type, String value, Throwable t)
-
logError
public void logError(String error)
-
pageHasError
public boolean pageHasError(Throwable t)
returns true if any of the error types specified is caught- Parameters:
t-- Returns:
-
errorHandling
public int errorHandling(Throwable t)
error handling When test fails if any of the defined errors specified by PageErrors exists, Then the test will be retried- Parameters:
t-- Returns:
-
-