HotTester
Class: HotTester
Executes tests.
Hierarchy​
HotTester
↳
HotTesterMocha
Table of contents​
Constructors​
Properties​
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 HotTester(processor
, name
, baseUrl
, driver
, testMaps?
)
Parameters​
Name | Type |
---|---|
processor | HotStaq |
name | string |
baseUrl | string |
driver | HotTestDriver |
testMaps | Object |
Defined in​
Properties​
baseUrl​
• baseUrl: string
The base url that will construct future urls.
Defined in​
driver​
• driver: HotTestDriver
The driver to use when running tests.
Defined in​
finishedLoading​
• finishedLoading: boolean
Has this tester finished loading?
Defined in​
hasBeenDestroyed​
• hasBeenDestroyed: boolean
Has this tester finished setting up?
Defined in​
hasBeenSetup​
• hasBeenSetup: boolean
Has this tester finished setting up?
Defined in​
name​
• name: string
The tester name.
Defined in​
processor​
• processor: HotStaq
The associated processor.
Defined in​
testMaps​
• testMaps: Object
The test maps to test.
Index signature​
â–ª [name: string
]: HotTestMap
Defined in​
Methods​
destroy​
â–¸ Abstract
destroy(): Promise
<void
>
Executed when destroying up the tester.
Returns​
Promise
<void
>
Defined in​
execute​
â–¸ execute(mapName
): Promise
<void
>
Execute the tests.
Parameters​
Name | Type |
---|---|
mapName | string |
Returns​
Promise
<void
>
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
>
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
>
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
[]>
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
>
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
[]>
Defined in​
getTestPage​
â–¸ getTestPage(destination
): HotTestPage
Get a test page.
Parameters​
Name | Type |
---|---|
destination | HotDestination |
Returns​
Defined in​
getTestPath​
â–¸ getTestPath(destination
, pathName
): HotTestPath
Get a test path.
Parameters​
Name | Type |
---|---|
destination | HotDestination |
pathName | string |
Returns​
Defined in​
onCommand​
â–¸ Optional
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
>
Defined in​
onExecute​
â–¸ Optional
onExecute(): Promise
<void
>
Executed when this tester has been executed from the API.
Returns​
Promise
<void
>
Defined in​
onFinishedLoading​
â–¸ Optional
onFinishedLoading(): Promise
<void
>
Executed when this tester has finished loading all data from the API.
Returns​
Promise
<void
>
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
>
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
>
Defined in​
onTestEnd​
â–¸ Optional
onTestEnd(destination
): Promise
<void
>
Executed when tests are finished.
Parameters​
Name | Type |
---|---|
destination | HotDestination |
Returns​
Promise
<void
>
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
>
Defined in​
onTestPagePathStart​
â–¸ Optional
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 |
---|---|
destination | HotDestination |
page | HotTestPage |
stop | HotTestStop |
continueWhenTestIsComplete? | boolean |
Returns​
Promise
<boolean
>
Defined in​
onTestStart​
â–¸ Optional
onTestStart(destination
, url
, destinationKey?
): Promise
<boolean
>
Executed when tests are started. If this returns true, it will continue and execute all test paths. If this returns it will skip all test paths and execute onTestEnd instead.
Parameters​
Name | Type |
---|---|
destination | HotDestination |
url | string |
destinationKey? | string |
Returns​
Promise
<boolean
>
Defined in​
setup​
â–¸ Abstract
setup(isWebRoute
, url
, destinationKey?
): Promise
<void
>
Executed when setting up the tester.
Parameters​
Name | Type |
---|---|
isWebRoute | boolean |
url | string |
destinationKey? | string |
Returns​
Promise
<void
>
Defined in​
waitForData​
â–¸ waitForData(): Promise
<void
>
Waits for the API to finish loading all data.
Returns​
Promise
<void
>
Defined in​
interpretDestination​
â–¸ Static
interpretDestination(mapName
, testDest
): HotDestination
Get a destination JSON object to use.
Parameters​
Name | Type |
---|---|
mapName | string |
testDest | HotTestDestination |