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 String |
getDefaultTestObjectId() |
static TestObject |
getGlobalTestInfo()
gets default test object if not exist, create default test object
|
static TestObject |
getParentTestInfo(ServiceObject serviceObject)
get parent test object parent id is unique for each csv test file in service
tests user for inheritance of config and log files
|
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
|
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 |
isTestObjectSet() |
static boolean |
isTestObjectSet(String testId)
return true if testId is registered
|
static boolean |
isValidTestId(String testId) |
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 |
withRunCount(int rerunCount) |
TestObject |
withTestFileClassName(String testFileClassName) |
TestObject |
withTestId(String testId) |
TestObject |
withTestName(String testName) |
TestObject |
withTestScenario(com.aventstack.extentreports.ExtentTest testScenerio) |
TestObject |
withWebDriver(org.openqa.selenium.WebDriver webdriver) |
TestObject |
withWebDriverList(List<org.openqa.selenium.WebDriver> webDriverList) |
public static final String PROXY_ENABLED
public static final String PROXY_HOST
public static final String PROXY_PORT
public static final String PROXY_USER
public static final String PROXY_PASS
public static final String PROXY_PROTOCOL
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 BEFORE_TEST_FILE_PREFIX
public static String AFTER_TEST_FILE_PREFIX
public static String PARENT_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 RANDOM_STRING
public static final String START_TIME_STRING
public static final String UUID_STATIC_STRING
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 isTestFail
public Boolean isTestComplete
public org.apache.log4j.Logger log
public int currentTestIndex
public int testCountInCsvFile
public String testCsvFileName
public ServiceObject serviceObject
public ServiceObject activeServiceObject
public org.junit.runner.Description description
public Throwable caughtThrowable
public ArrayList<org.testng.ITestResult> failedTests
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 boolean isScreenRecorderInitiated
public Map<String,ServiceObject> apiMap
public List<TestObject> testObjects
public static ThreadLocal<String> currentTestName
public static ThreadLocal<String> currentTestId
public String language
public org.testng.asserts.SoftAssert softAssert
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 getGlobalTestInfo()
public static TestObject getParentTestInfo(ServiceObject serviceObject)
serviceObject - 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 static boolean isValidTestId(String testId)
public static int getTestInvocationCount(String testname)
testname - 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 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 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 © 2020. All rights reserved.