Package core.apiCore.driver
Class ApiTestDriver
- java.lang.Object
-
- core.apiCore.driver.ApiTestDriver
-
public class ApiTestDriver extends Object
-
-
Constructor Summary
Constructors Constructor Description ApiTestDriver()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetClassName()static TestObjectgetParentTestObject()static 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 booleanisCsvTestComplete()returns true if all tests in current csv file are completedstatic booleanisCsvTestComplete(ServiceObject service)returns true if all tests in current csv file are completedstatic booleanisCsvTestStarted()returns true if tests in csv file are startingstatic booleanisCsvTestStarted(int index)returns true if tests in csv file are startingstatic booleanisRunningServiceTest()is service test runningstatic booleanisRunningServiceTest(Object[] testData)static booleanisRunningUITest()static voidparentTrackChildTests()store 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 voidtrackBatchTestLogs()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
-
-
-
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(ServiceObject serviceObject)
-
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-
-
-