Class TestRetryAnalyzer
- java.lang.Object
-
- dev.aherscu.qa.jgiven.commons.utils.TestRetryAnalyzer
-
- All Implemented Interfaces:
org.testng.IAnnotationTransformer
,org.testng.IRetryAnalyzer
,org.testng.ITestNGListener
- Direct Known Subclasses:
IgnoreSeleniumInternalErrors
public class TestRetryAnalyzer extends Object implements org.testng.IRetryAnalyzer, org.testng.IAnnotationTransformer
Implements TestNG test retry mechanism. You have to ensure proper reset mechanism otherwise the test will be reattempted while the application is in same state as previous attempt left it.Had an issue with JGiven: https://github.com/TNG/JGiven/issues/312
Can be added as a listener, in this case the retry mechanism will get applied to all test methods covered by.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
TestRetryAnalyzer.Config
Configures the test retry mechanism.
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_INTERVAL_MS
The default retry interval in milliseconds.static int
DEFAULT_RETRIES
The default retries.static Map<String,Integer>
retryCounters
Retries per qualified method name<class>.<method>
.
-
Constructor Summary
Constructors Constructor Description TestRetryAnalyzer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
retry(org.testng.ITestResult result)
void
transform(org.testng.annotations.ITestAnnotation annotation, Class testClass, Constructor testConstructor, Method testMethod)
-
-
-
Field Detail
-
DEFAULT_INTERVAL_MS
public static final int DEFAULT_INTERVAL_MS
The default retry interval in milliseconds.- See Also:
- Constant Field Values
-
DEFAULT_RETRIES
public static final int DEFAULT_RETRIES
The default retries.- See Also:
- Constant Field Values
-
-
Method Detail
-
retry
public boolean retry(org.testng.ITestResult result)
- Specified by:
retry
in interfaceorg.testng.IRetryAnalyzer
-
transform
public void transform(org.testng.annotations.ITestAnnotation annotation, Class testClass, Constructor testConstructor, Method testMethod)
- Specified by:
transform
in interfaceorg.testng.IAnnotationTransformer
-
-