HotTesterMochaSelenium
hotstaq / Modules / HotTesterMochaSelenium
Class: HotTesterMochaSelenium
The tester that uses Mocha to executes all tests.
Hierarchy​
↳
HotTesterMochaSelenium
Table of contents​
Constructors​
Properties​
- afterAll
- baseUrl
- beforeAll
- driver
- finishedLoading
- hasBeenDestroyed
- hasBeenSetup
- mocha
- name
- onSetup
- processor
- suite
- testMaps
- timeout
- waitForTesterData
Methods​
- destroy
- execute
- executeCommand
- executeTestAPIPath
- executeTestAPIPaths
- executeTestPagePath
- executeTestPagePaths
- getTestPage
- getTestPath
- onCommand
- onExecute
- onFinishedLoading
- onTestAPIPathEnd
- onTestAPIPathStart
- onTestEnd
- onTestPagePathEnd
- onTestPagePathStart
- onTestStart
- setup
- waitForData
- interpretDestination
Constructors​
constructor​
• new HotTesterMochaSelenium(processor
, name
, baseUrl
, testMaps?
, onSetup?
, beforeAll?
, afterAll?
)
Parameters​
Name | Type | Default value |
---|---|---|
processor | HotStaq | undefined |
name | string | undefined |
baseUrl | string | undefined |
testMaps | Object | {} |
onSetup | (driver : WebDriver ) => Promise <boolean > | null |
beforeAll | () => Promise <void > | null |
afterAll | () => Promise <void > | null |
Overrides​
Defined in​
Properties​
afterAll​
• afterAll: () => Promise
<void
>
Type declaration​
â–¸ (): Promise
<void
>
The Mocha afterAll event to call before any tests are executed.
Returns​
Promise
<void
>
Defined in​
baseUrl​
• baseUrl: string
The base url that will construct future urls.
Inherited from​
Defined in​
beforeAll​
• beforeAll: () => Promise
<void
>
Type declaration​
â–¸ (): Promise
<void
>
The Mocha beforeAll event to call before any tests are executed.
Returns​
Promise
<void
>
Defined in​
driver​
• driver: HotTestSeleniumDriver
The driver to use when running tests.
Overrides​
Defined in​
finishedLoading​
• finishedLoading: boolean
Has this tester finished loading?
Inherited from​
Defined in​
hasBeenDestroyed​
• hasBeenDestroyed: boolean
Has this tester finished setting up?
Inherited from​
Defined in​
hasBeenSetup​
• hasBeenSetup: boolean
Has this tester finished setting up?
Inherited from​
Defined in​
mocha​
• mocha: Mocha
The mocha instance to run.
Defined in​
name​
• name: string
The tester name.
Inherited from​
Defined in​
onSetup​
• onSetup: (driver
: WebDriver
, url
: string
) => Promise
<boolean
>
Type declaration​
â–¸ (driver
, url
): Promise
<boolean
>
This event is executed after the Selenium driver and url have been loaded. If this returns true, Selenium will load the url.
Parameters​
Name | Type |
---|---|
driver | WebDriver |
url | string |
Returns​
Promise
<boolean
>
Defined in​
processor​
• processor: HotStaq
The associated processor.
Inherited from​
Defined in​
suite​
• suite: Suite
The suite to execute.
Defined in​
testMaps​
• testMaps: Object
The test maps to test.
Index signature​
â–ª [name: string
]: HotTestMap
Inherited from​
Defined in​
timeout​
• timeout: number
The timeout for each test.
Defined in​
waitForTesterData​
• waitForTesterData: boolean
If set to true, this will wait for the tester API data. If onSetup is used, it will have to return true in order to wait for the tester data.
Defined in​
Methods​
destroy​
â–¸ destroy(): Promise
<void
>
Executed when destroying this tester.
Returns​
Promise
<void
>
Overrides​
Defined in​
execute​
â–¸ execute(mapName
): Promise
<void
>
Execute the tests.
Parameters​
Name | Type |
---|---|
mapName | string |
Returns​
Promise
<void
>
Inherited from​
Defined in​
executeCommand​
â–¸ executeCommand(destination
, page
, stop
, cmd
): Promise
<void
>
Execute a command.
Parameters​
Name | Type |
---|---|
destination | HotDestination |
page | HotTestPage |
stop | HotTestStop |
cmd | string |
Returns​
Promise
<void
>
Inherited from​
Defined in​
executeTestAPIPath​
â–¸ executeTestAPIPath(destination
, method
, testName
, skipEventCalls?
, continueWhenTestIsComplete?
): Promise
<any
>
Execute an API's test path.
Parameters​
Name | Type | Default value |
---|---|---|
destination | HotDestination | undefined |
method | HotRouteMethod | undefined |
testName | string | undefined |
skipEventCalls | boolean | false |
continueWhenTestIsComplete | boolean | false |
Returns​
Promise
<any
>
Inherited from​
Defined in​
executeTestAPIPaths​
â–¸ executeTestAPIPaths(destination
): Promise
<any
[]>
Execute all test paths in an API route.
fixme
This needs a better implementation...
Parameters​
Name | Type |
---|---|
destination | HotDestination |
Returns​
Promise
<any
[]>
Inherited from​
Defined in​
executeTestPagePath​
â–¸ executeTestPagePath(destination
, stop
, skipEventCalls?
, continueWhenTestIsComplete?
): Promise
<any
>
Execute a test page path.
Parameters​
Name | Type | Default value |
---|---|---|
destination | HotDestination | undefined |
stop | HotTestStop | undefined |
skipEventCalls | boolean | false |
continueWhenTestIsComplete | boolean | false |
Returns​
Promise
<any
>
Inherited from​
Defined in​
executeTestPagePaths​
â–¸ executeTestPagePaths(destination
, continueWhenTestIsComplete?
): Promise
<any
[]>
Execute all test paths in a page.
Parameters​
Name | Type | Default value |
---|---|---|
destination | HotDestination | undefined |
continueWhenTestIsComplete | boolean | false |
Returns​
Promise
<any
[]>
Inherited from​
HotTester.executeTestPagePaths
Defined in​
getTestPage​
â–¸ getTestPage(destination
): HotTestPage
Get a test page.
Parameters​
Name | Type |
---|---|
destination | HotDestination |
Returns​
Inherited from​
Defined in​
getTestPath​
â–¸ getTestPath(destination
, pathName
): HotTestPath
Get a test path.
Parameters​
Name | Type |
---|---|
destination | HotDestination |
pathName | string |
Returns​
Inherited from​
Defined in​
onCommand​
â–¸ onCommand(destination
, page
, stop
, cmd
, args
, cmdFunc
): Promise
<void
>
Executed when a command is executed.
Parameters​
Name | Type |
---|---|
destination | HotDestination |
page | HotTestPage |
stop | HotTestStop |
cmd | string |
args | string [] |
cmdFunc | (cmdArgs : string []) => Promise <void > |
Returns​
Promise
<void
>
Overrides​
Defined in​
onExecute​
â–¸ Optional
onExecute(): Promise
<void
>
Executed when this tester has been executed from the API.
Returns​
Promise
<void
>
Inherited from​
Defined in​
onFinishedLoading​
â–¸ Optional
onFinishedLoading(): Promise
<void
>
Executed when this tester has finished loading all data from the API.
Returns​
Promise
<void
>
Inherited from​
Defined in​
onTestAPIPathEnd​
â–¸ Optional
onTestAPIPathEnd(destination
, method
, testName
, result
, continueWhenTestIsComplete?
): Promise
<void
>
Executed when an API test path has ended.
Parameters​
Name | Type |
---|---|
destination | HotDestination |
method | HotRouteMethod |
testName | string |
result | any |
continueWhenTestIsComplete? | boolean |
Returns​
Promise
<void
>
Inherited from​
Defined in​
onTestAPIPathStart​
â–¸ Optional
onTestAPIPathStart(destination
, method
, testName
, continueWhenTestIsComplete?
): Promise
<boolean
>
Executed when an API test path has started. If this returns false, the testPath will not be immediately executed afterwards.
Parameters​
Name | Type |
---|---|
destination | HotDestination |
method | HotRouteMethod |
testName | string |
continueWhenTestIsComplete? | boolean |
Returns​
Promise
<boolean
>
Inherited from​
Defined in​
onTestEnd​
â–¸ onTestEnd(destination
): Promise
<void
>
Executed when tests are finished.
Parameters​
Name | Type |
---|---|
destination | HotDestination |
Returns​
Promise
<void
>
Overrides​
Defined in​
onTestPagePathEnd​
â–¸ Optional
onTestPagePathEnd(destination
, testPath
, result
, continueWhenTestIsComplete?
): Promise
<void
>
Executed when a page test has ended.
Parameters​
Name | Type |
---|---|
destination | HotDestination |
testPath | HotTestPath |
result | any |
continueWhenTestIsComplete? | boolean |
Returns​
Promise
<void
>
Inherited from​
Defined in​
onTestPagePathStart​
â–¸ onTestPagePathStart(destination
, page
, stop
, continueWhenTestIsComplete?
): Promise
<boolean
>
Executed when page tests are started. If this returns false, the testPath will not be immediately executed afterwards.
Parameters​
Name | Type | Default value |
---|---|---|
destination | HotDestination | undefined |
page | HotTestPage | undefined |
stop | HotTestStop | undefined |
continueWhenTestIsComplete | boolean | false |
Returns​
Promise
<boolean
>
Overrides​
Defined in​
onTestStart​
â–¸ onTestStart(destination
, url
, destinationKey?
): Promise
<boolean
>
Executed when tests are started.
Parameters​
Name | Type | Default value |
---|---|---|
destination | HotDestination | undefined |
url | string | undefined |
destinationKey | string | "" |
Returns​
Promise
<boolean
>
Overrides​
Defined in​
setup​
â–¸ setup(isWebRoute
, url?
, destinationKey?
): Promise
<void
>
Setup the Mocha/Selenium frameworks.
Parameters​
Name | Type | Default value | Description |
---|---|---|---|
isWebRoute | boolean | undefined | - |
url | string | "" | If this is set, this url will be used instead of the url associated with this tester. |
destinationKey | string | "" | - |
Returns​
Promise
<void
>
Overrides​
Defined in​
waitForData​
â–¸ waitForData(): Promise
<void
>
Waits for the API to finish loading all data.
Returns​
Promise
<void
>
Inherited from​
Defined in​
interpretDestination​
â–¸ Static
interpretDestination(mapName
, testDest
): HotDestination
Get a destination JSON object to use.
Parameters​
Name | Type |
---|---|
mapName | string |
testDest | HotTestDestination |
Returns​
Inherited from​
HotTester.interpretDestination