public class TestObject extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TestObject.testState |
static class |
TestObject.testType |
| Constructor and Description |
|---|
TestObject() |
| Modifier and Type | Method and Description |
|---|---|
static ServiceObject |
getApiDef(String key)
gets api object from api keywords each keyword is associated with a api call
use api keywords csv files for definitions
|
String |
getClassName() |
static TestObject |
getDefaultTestInfo()
gets default test object
if not exist, create default test object
|
static String |
getDefaultTestObjectId() |
static String |
getTestId() |
static TestObject |
getTestInfo()
testInfo is a static list containing hashmap of test objects with test name
as key if testObject is empty for testId, Then default test is initialized
And used
|
static TestObject |
getTestInfo(String testId) |
static int |
getTestInvocationCount(String testname)
returns the invocation count for the data provider test
format class-testname-test1
|
String |
getTestName()
* testname is grabbed from test id test id is in format of "class - testname"
if is before class And no testname exists, empty string is returned
|
static TestObject |
getTestObjectInheritence(DriverObject driver,
String testId)
Inheritance structure for test object
before suite -> before class -> test method
before suite -> before class -> after class
before suite -> after suite
|
String |
getTestStartTime() |
static TestObject.testState |
getTestState(String testName)
get the state of the test object
can be suite, testClass, testMethod
|
static boolean |
hasTestStarted()
TODO: Remove is test runner returns true if test is running, not before
class, or after class based on testid: classname - testname
|
TestObject |
incremenetRunCount() |
static TestObject |
inheritParent(DriverObject driver,
String testId)
Inheritance structure for test object
before suite -> before class -> test method
before suite -> before class -> after class
before suite -> after suite
Service test hierarchy:
before suite -> before class -> csv file name object -> csv tests
before suite -> before class -> after class
before suite -> after suite
note: before method inheritance not supported
|
static void |
initializeTest(DriverObject driver,
String testId)
once per test, initialize test object maps driver with the test associates
current driver with test
|
static void |
initializeTest(String testId)
once per test, initialize test object maps driver with the test associates
current driver with test
|
static boolean |
isBeforeTest(String testId) |
static boolean |
isFirstRun()
returns true if webdriver has not started else returns true if isFirstRun is
set to true
|
static boolean |
isTestcomplete()
returns true if test is complete for csv api tests, if tests in csv file are
complete
|
static boolean |
isTestObjectSet() |
static boolean |
isTestObjectSet(String testId)
return true if testId is registered
|
void |
resetTestObject()
resets test object after a test is complete with csv files, test is complete
When all tests in csv files have finished for api csv tests, we're reseting
the test count per csv file.
|
static void |
setLogging() |
static void |
setTestId(String testId) |
static void |
setTestId(String testclass,
String testname) |
static void |
setTestName(String testName) |
static void |
setupDefaultDriver() |
static void |
updateAppName(DriverObject driver)
updates default test app name to driver app name default test object tracks
the test run app name used for report name
|
TestObject |
withApp(String app) |
TestObject |
withCaughtThrowable(Throwable caughtThrowable) |
TestObject |
withClassName(String className) |
TestObject |
withCurrentDriver(DriverObject currentDriver) |
TestObject |
withDescription(org.junit.runner.Description description) |
TestObject |
withFailTrace(ArrayList<String> failTrace) |
TestObject |
withIsFirstRun(Boolean isFirstRun) |
TestObject |
withIsForcedRestart(Boolean isForcedRestart) |
TestObject |
withIsTestComplete(boolean isTestComplete) |
TestObject |
withIsTestPass(Boolean isTestPass) |
TestObject |
withLog(org.apache.log4j.Logger log) |
TestObject |
withRandomStringIdentifier() |
TestObject |
withRunCount(int rerunCount) |
TestObject |
withTestFileClassName(String testFileClassName) |
TestObject |
withTestId(String testId) |
TestObject |
withTestName(String testName) |
TestObject |
withTestScenario(com.aventstack.extentreports.ExtentTest testScenerio) |
TestObject |
withTestStartTime(String time) |
TestObject |
withWebDriver(org.openqa.selenium.WebDriver webdriver) |
TestObject |
withWebDriverList(List<org.openqa.selenium.WebDriver> webDriverList) |
public static String BEFORE_SUITE_PREFIX
public static String AFTER_SUITE_PREFIX
public static String BEFORE_CLASS_PREFIX
public static String AFTER_CLASS_PREFIX
public static String BEFORE_METHOD_PREFIX
public static String DATAPROVIDER_TEST_SUFFIX
public static final String DEFAULT_TEST
public static final String DEFAULT_TEST_THREAD_PREFIX
public static final String DEFAULT_APP
public static String SUITE_NAME
public static String APP_IDENTIFIER
public static final String TEST_APP_API
public List<org.openqa.selenium.WebDriver> webDriverList
public String app
public TestObject.testType type
public String testId
public String testName
public String className
public String deviceName
public String testFileClassName
public DriverObject currentDriver
public Boolean isFirstRun
public Boolean isForcedRestart
public LoginObject login
public int runCount
public Boolean isTestPass
public Boolean isTestComplete
public org.apache.log4j.Logger log
public int currentTestIndex
public int testCountInCsvFile
public String testCsvFileName
public org.junit.runner.Description description
public Throwable caughtThrowable
public com.aventstack.extentreports.ExtentTest testFeature
public com.aventstack.extentreports.ExtentTest testScenerio
public List<com.aventstack.extentreports.ExtentTest> testSteps
public org.monte.screenrecorder.ScreenRecorder screenRecorder
public String startTime
public String randStringIdentifier
public Map<String,ServiceObject> apiMap
public static ThreadLocal<String> currentTestName
public static ThreadLocal<String> currentTestId
public String language
public static Map<String,TestObject> testInfo
public TestObject withWebDriver(org.openqa.selenium.WebDriver webdriver)
public static void initializeTest(String testId)
public static void initializeTest(DriverObject driver, String testId)
public static TestObject inheritParent(DriverObject driver, String testId)
public static TestObject getTestObjectInheritence(DriverObject driver, String testId)
public static boolean isFirstRun()
public static TestObject getTestInfo()
public static TestObject getDefaultTestInfo()
public static void setupDefaultDriver()
public static void updateAppName(DriverObject driver)
driver - public static TestObject.testState getTestState(String testName)
testName - public static void setTestName(String testName)
public static void setTestId(String testId)
public static String getTestId()
public static boolean isTestObjectSet(String testId)
testId - public static boolean isTestObjectSet()
public static boolean hasTestStarted()
public static void setLogging()
public static TestObject getTestInfo(String testId)
public static boolean isBeforeTest(String testId)
public void resetTestObject()
public static int getTestInvocationCount(String testname)
testname - public static boolean isTestcomplete()
public static ServiceObject getApiDef(String key)
key - public TestObject withIsFirstRun(Boolean isFirstRun)
public TestObject withIsForcedRestart(Boolean isForcedRestart)
public TestObject withCurrentDriver(DriverObject currentDriver)
public TestObject withTestId(String testId)
public TestObject withTestStartTime(String time)
public TestObject withRandomStringIdentifier()
public TestObject withTestName(String testName)
public TestObject withClassName(String className)
public TestObject withIsTestComplete(boolean isTestComplete)
public TestObject withTestFileClassName(String testFileClassName)
public TestObject withWebDriverList(List<org.openqa.selenium.WebDriver> webDriverList)
public String getTestName()
public String getClassName()
public String getTestStartTime()
public TestObject withRunCount(int rerunCount)
public TestObject withLog(org.apache.log4j.Logger log)
public TestObject incremenetRunCount()
public TestObject withIsTestPass(Boolean isTestPass)
public TestObject withDescription(org.junit.runner.Description description)
public TestObject withCaughtThrowable(Throwable caughtThrowable)
public TestObject withFailTrace(ArrayList<String> failTrace)
public TestObject withTestScenario(com.aventstack.extentreports.ExtentTest testScenerio)
public TestObject withApp(String app)
public static String getDefaultTestObjectId()
Copyright © 2019. All rights reserved.