Class RetryTest

  • All Implemented Interfaces:
    org.junit.rules.TestRule

    public class RetryTest
    extends Object
    implements org.junit.rules.TestRule
    • Field Detail

      • PageErrors

        public static final String[] PageErrors
      • RETRYCOUNTER

        public static final int RETRYCOUNTER
      • enableRetry

        public static boolean enableRetry
      • webDriver

        public org.openqa.selenium.WebDriver webDriver
    • Constructor Detail

      • RetryTest

        public RetryTest​(int retryCount)
    • Method Detail

      • setRetryCount

        public void setRetryCount​(int retryCount)
      • getRetryCount

        public int getRetryCount()
      • getCurrentTestRun

        public int getCurrentTestRun()
      • setExtendReport

        public void setExtendReport​(com.aventstack.extentreports.ExtentTest test,
                                    com.aventstack.extentreports.ExtentTest step,
                                    com.aventstack.extentreports.ExtentReports extent)
      • getTest

        public com.aventstack.extentreports.ExtentTest getTest()
      • getStep

        public com.aventstack.extentreports.ExtentTest getStep()
      • setWebDriver

        public void setWebDriver​(org.openqa.selenium.WebDriver driver)
      • apply

        public org.junit.runners.model.Statement apply​(org.junit.runners.model.Statement base,
                                                       org.junit.runner.Description description)
        Specified by:
        apply in interface org.junit.rules.TestRule
      • getPageSource

        public void getPageSource()
        print page source
      • setTestId

        public void setTestId​(org.junit.runner.Description description)
      • takeAppcenterScreenshot

        public void takeAppcenterScreenshot​(String label)
      • processTestResult

        public void processTestResult​(org.junit.runner.Description description)
                               throws Throwable
        Throws:
        Throwable
      • writeToTestReport

        public void writeToTestReport()
      • pageHasError

        public boolean pageHasError​(Throwable t)
        returns true if any of the error types specified is caught
        Parameters:
        t -
        Returns:
      • errorHandling

        public void 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 -
      • randomFailStack

        public void randomFailStack​(ArrayList<String> FailTrace,
                                    org.junit.runner.Description description)
      • getStackTrace

        public static String getStackTrace​(Throwable throwable)
        gets the stack trace of the failure
        Parameters:
        throwable -
        Returns: