HotTestSeleniumDriver
hotstaq / Modules / HotTestSeleniumDriver
Class: HotTestSeleniumDriver
Runs and executes tests using Selenium.
Hierarchy​
↳
HotTestSeleniumDriver
Table of contents​
Constructors​
Properties​
Methods​
- assert
- assertElementValue
- destroy
- findTestElement
- getTestObjectByName
- loadSeleniumDriver
- navigateToUrl
- parseTestObject
- println
- run
- runCommand
- wait
- waitForTestElement
Constructors​
constructor​
• new HotTestSeleniumDriver(page?
)
Parameters​
Name | Type | Default value |
---|---|---|
page | HotTestPage | null |
Overrides​
Defined in​
Properties​
browser​
• browser: string
The browser to use.
Defined in​
disableGPUAndSandbox​
• disableGPUAndSandbox: boolean
Disable GPU usage and the Chrome Sandbox. Mostly for usage within Docker.
Defined in​
driver​
• driver: WebDriver
The selenium webdriver.
Defined in​
headless​
• headless: boolean
Run the tests headless.
Defined in​
openDevTools​
• openDevTools: boolean
Automatically open the developer tools on start.
Defined in​
page​
• page: HotTestPage
The current page.
Inherited from​
Defined in​
remoteServer​
• remoteServer: string
Set the remote server to use for testing.
Defined in​
session​
• session: Session
The current selenium session running.
Defined in​
windowSize​
• windowSize: Object
Set the window size on start.
Type declaration​
Name | Type | Description |
---|---|---|
height | number | The height of the window. |
width | number | The width of the window. |
Defined in​
Methods​
assert​
â–¸ assert(value
, errorMessage?
): Promise
<any
>
An expression to test.
Parameters​
Name | Type | Default value |
---|---|---|
value | any | undefined |
errorMessage | string | "" |
Returns​
Promise
<any
>
Inherited from​
Defined in​
assertElementValue​
â–¸ assertElementValue(name
, value
, errorMessage?
, options?
): Promise
<any
>
An expression to test.
Parameters​
Name | Type | Default value |
---|---|---|
name | string | HotTestElement | undefined |
value | any | undefined |
errorMessage | string | "" |
options | HotTestElementOptions | undefined |
Returns​
Promise
<any
>
Overrides​
HotTestDriver.assertElementValue
Defined in​
destroy​
â–¸ destroy(): Promise
<void
>
Disconnect this server or destroy anything associated with this HotTestDriver.
Returns​
Promise
<void
>
Overrides​
Defined in​
findTestElement​
â–¸ findTestElement(name
, options?
): Promise
<WebElement
>
Get a test element using selenium webdriver.
Parameters​
Name | Type |
---|---|
name | string | HotTestElement |
options | HotTestElementOptions |
Returns​
Promise
<WebElement
>
Overrides​
Defined in​
getTestObjectByName​
â–¸ getTestObjectByName(name
): By
Get a test object by it's name. If a * is used, it will be used as a wildcard for the object's name. If a > is used, then the name will be treated as a CSS selector.
Parameters​
Name | Type |
---|---|
name | string |
Returns​
By
Defined in​
loadSeleniumDriver​
â–¸ loadSeleniumDriver(): Promise
<void
>
Load the selenium driver.
Returns​
Promise
<void
>
Defined in​
navigateToUrl​
â–¸ navigateToUrl(url
): Promise
<void
>
Navigate to a url.
Parameters​
Name | Type |
---|---|
url | string |
Returns​
Promise
<void
>
Overrides​
Defined in​
parseTestObject​
â–¸ parseTestObject(name
): string
Get a test object by it's name. If a * is used, it will be used as a wildcard for the object's name. If a > is used, then the name will be treated as a CSS selector.
Parameters​
Name | Type |
---|---|
name | string |
Returns​
string
Inherited from​
Defined in​
print​
â–¸ print(message
): Promise
<void
>
Print a message.
Parameters​
Name | Type |
---|---|
message | string |
Returns​
Promise
<void
>
Inherited from​
Defined in​
println​
â–¸ println(message
): Promise
<void
>
Print a message line.
Parameters​
Name | Type |
---|---|
message | string |
Returns​
Promise
<void
>
Inherited from​
Defined in​
run​
â–¸ run(executions
): Promise
<any
[]>
Run a series of test elements.
Parameters​
Name | Type |
---|---|
executions | string [] | string [][] |
Returns​
Promise
<any
[]>
Inherited from​
Defined in​
runCommand​
â–¸ runCommand(testElm
, funcName?
, valueStr?
, options?
): Promise
<any
>
Run a command using Selenium Webdriver.
Parameters​
Name | Type | Default value |
---|---|---|
testElm | string | HotTestElement | undefined |
funcName | string | "" |
valueStr | string | "" |
options | HotTestElementOptions | undefined |
Returns​
Promise
<any
>
Overrides​
Defined in​
wait​
â–¸ wait(numMilliseconds
): Promise
<void
>
Wait for a number of milliseconds.
Parameters​
Name | Type |
---|---|
numMilliseconds | number |
Returns​
Promise
<void
>
Inherited from​
Defined in​
waitForTestElement​
â–¸ waitForTestElement(name
, options?
): Promise
<WebElement
>
Wait for a test element using Selenium Webdriver.
Parameters​
Name | Type |
---|---|
name | string | HotTestElement |
options | HotTestElementOptions |
Returns​
Promise
<WebElement
>
Overrides​
HotTestDriver.waitForTestElement