Class ApiTestDriver


  • public class ApiTestDriver
    extends Object
    • Constructor Detail

      • ApiTestDriver

        public ApiTestDriver()
    • Method Detail

      • setTestId

        public static void setTestId​(ServiceObject serviceObject)
      • getTestClass

        public static String getTestClass​(ServiceObject serviceObject)
        gets the test class based on the csv file name eg. TestCases_company has testId = company
        Parameters:
        serviceObject -
        Returns:
      • getTestClass

        public static String getTestClass​(String csvFilename)
        get test class name based on csv file name
        Parameters:
        csvFilename -
        Returns:
      • initTest

        public void initTest​(ServiceObject serviceObject)
        initialized testInfo with testId as key runs before test adds current driver info to test object note: each row in csv is treated as separate test, with separate test object test logs And config are shared by test class object, which is the csv file name
        Parameters:
        driverObject -
      • getParentTestObject

        public static TestObject getParentTestObject​(String parentId)
      • getParentTestObject

        public static TestObject getParentTestObject()
      • parentTrackChildTests

        public static void parentTrackChildTests()
        store all child tests objects in parent object as list
      • trackBatchTestLogs

        public static void trackBatchTestLogs()
        tracks test logs getTestInfo().testLog: tracks logs of individual service tests on test success or failure, contains all the logs of all tests for batch logging
      • isCsvTestComplete

        public static boolean isCsvTestComplete()
        returns true if all tests in current csv file are completed
        Returns:
      • isCsvTestComplete

        public static boolean isCsvTestComplete​(ServiceObject service)
        returns true if all tests in current csv file are completed
        Returns:
      • isCsvTestStarted

        public static boolean isCsvTestStarted()
        returns true if tests in csv file are starting
        Returns:
      • isCsvTestStarted

        public static boolean isCsvTestStarted​(int index)
        returns true if tests in csv file are starting
        Returns:
      • getClassName

        public String getClassName()
      • isRunningServiceTest

        public static boolean isRunningServiceTest()
        is service test running
        Returns:
      • isRunningUITest

        public static boolean isRunningUITest()
      • isRunningServiceTest

        public static boolean isRunningServiceTest​(Object[] testData)
      • setServiceTestName

        public static void setServiceTestName​(Object[] testData)
        set service test name based on test name specified in test data
        Parameters:
        testData -
      • getTestData

        public static Object[] getTestData​(Object[] testData)
        get test data if from data provider, then it will be the first item in object array else it will be object array
        Parameters:
        testData -
        Returns: