public final class Controller extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Controller.Builder
Enables construction of a Controller instance via a multi-step
process.
|
Modifier and Type | Field and Description |
---|---|
private String |
additionalArgsDescription
Additional command line arguments for custom test.
|
private ResultBuilder |
resultBuilder
Accumulates all information relevant to test.
|
private WebDriverWrapper |
systemUnderTestWebDriverWrapper
Selenium WebDriver wrapper.
|
private UrlWrapper |
targetUrl
Variable to hold target URL.
|
Modifier | Constructor and Description |
---|---|
private |
Controller(UrlWrapper targetUrlParam,
WebDriverWrapper systemParam)
Private constructor for factory usage.
|
Modifier and Type | Method and Description |
---|---|
static String |
getBaseCommandLineParameters()
Returns base command line parameters.
|
String |
getBuildName()
Provides build name.
|
UrlWrapper |
getTargetUrl()
Provides the URL that the test is to target.
|
String |
getTargetUrlString()
Provides URL in string form.
|
ResultBuilder |
getTestResultBuilder()
Returns ResultBuilder.
|
static String |
getUrlParamErrorString()
Returns missing URL parameter error string.
|
WebDriverWrapper |
getWebDriverWrapper()
Returns Selenium WebDriver.
|
static Controller.Builder |
newTestBuilder()
Returns test builder with no data.
|
static Controller.Builder |
newTestBuilder(String[] argsParam)
Processeses command line arguments to create
test builder.
|
static Controller.Builder |
newTestBuilder(String[] argsParam,
String additionalArgsDescripParam)
Processeses command line arguments to create
test builder, with option of specifying additional
controller arguments.
|
static Controller.Builder |
newTestBuilder(UrlWrapper urlParam,
String buildNameParam)
Returns a test builder instance based on all parameters.
|
static Controller.Builder |
newTestBuilder(UrlWrapper urlParam,
WebDriverWrapper driverWrapperParam,
String buildNameParam)
Returns a test builder instance based on driver wrapper.
|
static void |
printCommandLineParameters(String additionalArgsDescriptionParam)
Prints appropriate command line parameters to the
the console, including any parameters specific
to the test controller.
|
String |
toString()
Returns information about the test.
|
private String additionalArgsDescription
private WebDriverWrapper systemUnderTestWebDriverWrapper
private ResultBuilder resultBuilder
private UrlWrapper targetUrl
private Controller(UrlWrapper targetUrlParam, WebDriverWrapper systemParam)
targetUrlParam
- URL to testsystemParam
- webdriver of system under testpublic static Controller.Builder newTestBuilder()
public static Controller.Builder newTestBuilder(String[] argsParam)
argsParam
- command line args from testNullPointerException
- if no command line args passedpublic static Controller.Builder newTestBuilder(String[] argsParam, String additionalArgsDescripParam)
argsParam
- command line argsadditionalArgsDescripParam
- additional args specific to calling
test class in format '[arg1] [arg2]... etc.'public static Controller.Builder newTestBuilder(UrlWrapper urlParam, String buildNameParam)
urlParam
- pre-validated URL to test.buildNameParam
- build name that is used by Browserstack to organize test resultspublic static Controller.Builder newTestBuilder(UrlWrapper urlParam, WebDriverWrapper driverWrapperParam, String buildNameParam)
urlParam
- pre-validated URL to test.driverWrapperParam
- initialized webdriver.buildNameParam
- build name that is used by Browserstack to organize test resultsIllegalArgumentException
- if the driverWrapper is not initialized
to match the provided build name.NullPointerException
- if any input value is nullpublic static String getUrlParamErrorString()
public static String getBaseCommandLineParameters()
public static void printCommandLineParameters(String additionalArgsDescriptionParam)
additionalArgsDescriptionParam
- Description of any
command line parameters beyond first two, e.g., third
and beyond.public String toString()
public ResultBuilder getTestResultBuilder()
public WebDriverWrapper getWebDriverWrapper()
public UrlWrapper getTargetUrl()
public String getTargetUrlString()
public String getBuildName()
Copyright © 2018. All rights reserved.