Skip to main content

HotTestSeleniumDriver

hotstaq / Modules / HotTestSeleniumDriver

Class: HotTestSeleniumDriver

Runs and executes tests using Selenium.

Hierarchy​

Table of contents​

Constructors​

Properties​

Methods​

Constructors​

constructor​

• new HotTestSeleniumDriver(page?)

Parameters​

NameTypeDefault value
pageHotTestPagenull

Overrides​

HotTestDriver.constructor

Defined in​

HotTestSeleniumDriver.ts:58

Properties​

browser​

• browser: string

The browser to use.

Defined in​

HotTestSeleniumDriver.ts:27


disableGPUAndSandbox​

• disableGPUAndSandbox: boolean

Disable GPU usage and the Chrome Sandbox. Mostly for usage within Docker.

Defined in​

HotTestSeleniumDriver.ts:35


driver​

• driver: WebDriver

The selenium webdriver.

Defined in​

HotTestSeleniumDriver.ts:23


headless​

• headless: boolean

Run the tests headless.

Defined in​

HotTestSeleniumDriver.ts:31


openDevTools​

• openDevTools: boolean

Automatically open the developer tools on start.

Defined in​

HotTestSeleniumDriver.ts:39


page​

• page: HotTestPage

The current page.

Inherited from​

HotTestDriver.page

Defined in​

HotTestDriver.ts:12


remoteServer​

• remoteServer: string

Set the remote server to use for testing.

Defined in​

HotTestSeleniumDriver.ts:43


session​

• session: Session

The current selenium session running.

Defined in​

HotTestSeleniumDriver.ts:19


windowSize​

• windowSize: Object

Set the window size on start.

Type declaration​

NameTypeDescription
heightnumberThe height of the window.
widthnumberThe width of the window.

Defined in​

HotTestSeleniumDriver.ts:47

Methods​

assert​

â–¸ assert(value, errorMessage?): Promise<any>

An expression to test.

Parameters​

NameTypeDefault value
valueanyundefined
errorMessagestring""

Returns​

Promise<any>

Inherited from​

HotTestDriver.assert

Defined in​

HotTestDriver.ts:106


assertElementValue​

â–¸ assertElementValue(name, value, errorMessage?, options?): Promise<any>

An expression to test.

Parameters​

NameTypeDefault value
namestring | HotTestElementundefined
valueanyundefined
errorMessagestring""
optionsHotTestElementOptionsundefined

Returns​

Promise<any>

Overrides​

HotTestDriver.assertElementValue

Defined in​

HotTestSeleniumDriver.ts:330


destroy​

â–¸ destroy(): Promise<void>

Disconnect this server or destroy anything associated with this HotTestDriver.

Returns​

Promise<void>

Overrides​

HotTestDriver.destroy

Defined in​

HotTestSeleniumDriver.ts:75


findTestElement​

â–¸ findTestElement(name, options?): Promise<WebElement>

Get a test element using selenium webdriver.

Parameters​

NameType
namestring | HotTestElement
optionsHotTestElementOptions

Returns​

Promise<WebElement>

Overrides​

HotTestDriver.findTestElement

Defined in​

HotTestSeleniumDriver.ts:233


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​

NameType
namestring

Returns​

By

Defined in​

HotTestSeleniumDriver.ts:178


loadSeleniumDriver​

â–¸ loadSeleniumDriver(): Promise<void>

Load the selenium driver.

Returns​

Promise<void>

Defined in​

HotTestSeleniumDriver.ts:89


â–¸ navigateToUrl(url): Promise<void>

Navigate to a url.

Parameters​

NameType
urlstring

Returns​

Promise<void>

Overrides​

HotTestDriver.navigateToUrl

Defined in​

HotTestSeleniumDriver.ts:188


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​

NameType
namestring

Returns​

string

Inherited from​

HotTestDriver.parseTestObject

Defined in​

HotTestDriver.ts:24


print​

â–¸ print(message): Promise<void>

Print a message.

Parameters​

NameType
messagestring

Returns​

Promise<void>

Inherited from​

HotTestDriver.print

Defined in​

HotTestDriver.ts:64


println​

â–¸ println(message): Promise<void>

Print a message line.

Parameters​

NameType
messagestring

Returns​

Promise<void>

Inherited from​

HotTestDriver.println

Defined in​

HotTestDriver.ts:72


run​

â–¸ run(executions): Promise<any[]>

Run a series of test elements.

Parameters​

NameType
executionsstring[] | string[][]

Returns​

Promise<any[]>

Inherited from​

HotTestDriver.run

Defined in​

HotTestDriver.ts:115


runCommand​

â–¸ runCommand(testElm, funcName?, valueStr?, options?): Promise<any>

Run a command using Selenium Webdriver.

Parameters​

NameTypeDefault value
testElmstring | HotTestElementundefined
funcNamestring""
valueStrstring""
optionsHotTestElementOptionsundefined

Returns​

Promise<any>

Overrides​

HotTestDriver.runCommand

Defined in​

HotTestSeleniumDriver.ts:275


wait​

â–¸ wait(numMilliseconds): Promise<void>

Wait for a number of milliseconds.

Parameters​

NameType
numMillisecondsnumber

Returns​

Promise<void>

Inherited from​

HotTestDriver.wait

Defined in​

HotTestDriver.ts:50


waitForTestElement​

â–¸ waitForTestElement(name, options?): Promise<WebElement>

Wait for a test element using Selenium Webdriver.

Parameters​

NameType
namestring | HotTestElement
optionsHotTestElementOptions

Returns​

Promise<WebElement>

Overrides​

HotTestDriver.waitForTestElement

Defined in​

HotTestSeleniumDriver.ts:196