Package core.apiCore.driver
Class ApiTestDriver
java.lang.Object
core.apiCore.driver.ApiTestDriver
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TestObjectstatic TestObjectgetParentTestObject(ServiceObject serviceObject) static TestObjectgetParentTestObject(String parentId) static StringgetTestClass(ServiceObject serviceObject) gets the test class based on the csv file name eg.static StringgetTestClass(String csvFilename) get test class name based on csv file namestatic 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 arrayvoidinitTest(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 namestatic booleanreturns true if all tests in current csv file are completedstatic booleanisCsvTestComplete(ServiceObject service) returns true if all tests in current csv file are completedstatic booleanreturns true if tests in csv file are startingstatic booleanisCsvTestStarted(int index) returns true if tests in csv file are startingstatic booleanis service test runningstatic booleanisRunningServiceTest(Object[] testData) static booleanstatic voidstore all child tests objects in parent object as liststatic voidsetServiceTestName(Object[] testData) set service test name based on test name specified in test datastatic voidsetTestId(ServiceObject serviceObject) static voidtracks 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
-
Constructor Details
-
ApiTestDriver
public ApiTestDriver()
-
-
Method Details
-
setTestId
-
getTestClass
gets the test class based on the csv file name eg. TestCases_company has testId = company- Parameters:
serviceObject-- Returns:
-
getTestClass
get test class name based on csv file name- Parameters:
csvFilename-- Returns:
-
initTest
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
-
getParentTestObject
-
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
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
-
isRunningServiceTest
public static boolean isRunningServiceTest()is service test running- Returns:
-
isRunningUITest
public static boolean isRunningUITest() -
isRunningServiceTest
-
setServiceTestName
set service test name based on test name specified in test data- Parameters:
testData-
-
getTestData
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:
-