Class AbstractDriverTestNG

java.lang.Object
core.uiCore.drivers.AbstractDriverTestNG
All Implemented Interfaces:
org.testng.ITest

public class AbstractDriverTestNG
extends Object
implements org.testng.ITest
  • Field Details

    • extent

      public static com.aventstack.extentreports.ExtentReports extent
    • step

      public static ThreadLocal<com.aventstack.extentreports.ExtentTest> step
    • testClassname

      public static ThreadLocal<String> testClassname
    • testName

      public static ThreadLocal<String> testName
    • retry

      public RetryTest retry
  • Constructor Details

    • AbstractDriverTestNG

      public AbstractDriverTestNG()
  • Method Details

    • setupApiDriver

      public void setupApiDriver​(ServiceObject apiObject) throws Exception
      Throws:
      Exception
    • setupWebDriver

      public static org.openqa.selenium.WebDriver setupWebDriver​(DriverObject driverObject) throws Exception
      setup driver for web and mobile testing if single sign in is enabled, we try to reuse the existing drivers if available
      Parameters:
      driverObject -
      Returns:
      Throws:
      Exception
    • setupWebDriver

      public void setupWebDriver​(String testId, DriverObject driver)
      initialize test based on testId
      Parameters:
      testId -
      driver -
    • initTest

      public static void initTest​(DriverObject driverObject)
      initialized testInfo with testId as key runs before test adds current driver info to test object
      Parameters:
      driverObject -
    • setWebDriver

      public static void setWebDriver​(org.openqa.selenium.WebDriver webDriver)
    • handleTestMethodName

      @BeforeMethod(alwaysRun=true) public void handleTestMethodName​(Method method, org.testng.ITestResult iTestResult, Object[] testData)
      generates new testId from class name And test name if already generated, Then return existing
    • setResultTestName

      public void setResultTestName​(Object[] testData, org.testng.ITestResult result)
      // set test name for reports. eg. junit report
      Parameters:
      result -
    • getWebDriver

      public static org.openqa.selenium.WebDriver getWebDriver()
    • getUri

      public static String getUri​(String uri)
    • shutdown

      @AfterMethod public void shutdown​(org.testng.ITestResult iTestResult)
    • afterClassMethod

      @AfterClass public void afterClassMethod​(org.testng.ITestContext iTestContext)
      After class batch log print is called here, cause this after class method is called after all other after class methods
      Parameters:
      iTestContext -
    • getTestName

      public String getTestName()
      Specified by:
      getTestName in interface org.testng.ITest