Skip to main content

HotTesterMochaSelenium

hotstaq / Modules / HotTesterMochaSelenium

Class: HotTesterMochaSelenium

The tester that uses Mocha to executes all tests.

Hierarchy​

Table of contents​

Constructors​

Properties​

Methods​

Constructors​

constructor​

• new HotTesterMochaSelenium(processor, name, baseUrl, testMaps?, onSetup?, beforeAll?, afterAll?)

Parameters​

NameTypeDefault value
processorHotStaqundefined
namestringundefined
baseUrlstringundefined
testMapsObject{}
onSetup(driver: WebDriver) => Promise<boolean>null
beforeAll() => Promise<void>null
afterAll() => Promise<void>null

Overrides​

HotTester.constructor

Defined in​

HotTesterMochaSelenium.ts:52

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​

HotTesterMochaSelenium.ts:39


baseUrl​

• baseUrl: string

The base url that will construct future urls.

Inherited from​

HotTester.baseUrl

Defined in​

HotTester.ts:74


beforeAll​

• beforeAll: () => Promise<void>

Type declaration​

â–¸ (): Promise<void>

The Mocha beforeAll event to call before any tests are executed.

Returns​

Promise<void>

Defined in​

HotTesterMochaSelenium.ts:35


driver​

• driver: HotTestSeleniumDriver

The driver to use when running tests.

Overrides​

HotTester.driver

Defined in​

HotTesterMochaSelenium.ts:19


finishedLoading​

• finishedLoading: boolean

Has this tester finished loading?

Inherited from​

HotTester.finishedLoading

Defined in​

HotTester.ts:90


hasBeenDestroyed​

• hasBeenDestroyed: boolean

Has this tester finished setting up?

Inherited from​

HotTester.hasBeenDestroyed

Defined in​

HotTester.ts:98


hasBeenSetup​

• hasBeenSetup: boolean

Has this tester finished setting up?

Inherited from​

HotTester.hasBeenSetup

Defined in​

HotTester.ts:94


mocha​

• mocha: Mocha

The mocha instance to run.

Defined in​

HotTesterMochaSelenium.ts:23


name​

• name: string

The tester name.

Inherited from​

HotTester.name

Defined in​

HotTester.ts:70


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​
NameType
driverWebDriver
urlstring
Returns​

Promise<boolean>

Defined in​

HotTesterMochaSelenium.ts:44


processor​

• processor: HotStaq

The associated processor.

Inherited from​

HotTester.processor

Defined in​

HotTester.ts:78


suite​

• suite: Suite

The suite to execute.

Defined in​

HotTesterMochaSelenium.ts:31


testMaps​

• testMaps: Object

The test maps to test.

Index signature​

â–ª [name: string]: HotTestMap

Inherited from​

HotTester.testMaps

Defined in​

HotTester.ts:82


timeout​

• timeout: number

The timeout for each test.

Defined in​

HotTesterMochaSelenium.ts:27


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​

HotTesterMochaSelenium.ts:50

Methods​

destroy​

â–¸ destroy(): Promise<void>

Executed when destroying this tester.

Returns​

Promise<void>

Overrides​

HotTester.destroy

Defined in​

HotTesterMochaSelenium.ts:112


execute​

â–¸ execute(mapName): Promise<void>

Execute the tests.

Parameters​

NameType
mapNamestring

Returns​

Promise<void>

Inherited from​

HotTester.execute

Defined in​

HotTester.ts:561


executeCommand​

â–¸ executeCommand(destination, page, stop, cmd): Promise<void>

Execute a command.

Parameters​

NameType
destinationHotDestination
pageHotTestPage
stopHotTestStop
cmdstring

Returns​

Promise<void>

Inherited from​

HotTester.executeCommand

Defined in​

HotTester.ts:380


executeTestAPIPath​

â–¸ executeTestAPIPath(destination, method, testName, skipEventCalls?, continueWhenTestIsComplete?): Promise<any>

Execute an API's test path.

Parameters​

NameTypeDefault value
destinationHotDestinationundefined
methodHotRouteMethodundefined
testNamestringundefined
skipEventCallsbooleanfalse
continueWhenTestIsCompletebooleanfalse

Returns​

Promise<any>

Inherited from​

HotTester.executeTestAPIPath

Defined in​

HotTester.ts:256


executeTestAPIPaths​

â–¸ executeTestAPIPaths(destination): Promise<any[]>

Execute all test paths in an API route.

fixme This needs a better implementation...

Parameters​

NameType
destinationHotDestination

Returns​

Promise<any[]>

Inherited from​

HotTester.executeTestAPIPaths

Defined in​

HotTester.ts:294


executeTestPagePath​

â–¸ executeTestPagePath(destination, stop, skipEventCalls?, continueWhenTestIsComplete?): Promise<any>

Execute a test page path.

Parameters​

NameTypeDefault value
destinationHotDestinationundefined
stopHotTestStopundefined
skipEventCallsbooleanfalse
continueWhenTestIsCompletebooleanfalse

Returns​

Promise<any>

Inherited from​

HotTester.executeTestPagePath

Defined in​

HotTester.ts:329


executeTestPagePaths​

â–¸ executeTestPagePaths(destination, continueWhenTestIsComplete?): Promise<any[]>

Execute all test paths in a page.

Parameters​

NameTypeDefault value
destinationHotDestinationundefined
continueWhenTestIsCompletebooleanfalse

Returns​

Promise<any[]>

Inherited from​

HotTester.executeTestPagePaths

Defined in​

HotTester.ts:515


getTestPage​

â–¸ getTestPage(destination): HotTestPage

Get a test page.

Parameters​

NameType
destinationHotDestination

Returns​

HotTestPage

Inherited from​

HotTester.getTestPage

Defined in​

HotTester.ts:181


getTestPath​

â–¸ getTestPath(destination, pathName): HotTestPath

Get a test path.

Parameters​

NameType
destinationHotDestination
pathNamestring

Returns​

HotTestPath

Inherited from​

HotTester.getTestPath

Defined in​

HotTester.ts:191


onCommand​

â–¸ onCommand(destination, page, stop, cmd, args, cmdFunc): Promise<void>

Executed when a command is executed.

Parameters​

NameType
destinationHotDestination
pageHotTestPage
stopHotTestStop
cmdstring
argsstring[]
cmdFunc(cmdArgs: string[]) => Promise<void>

Returns​

Promise<void>

Overrides​

HotTester.onCommand

Defined in​

HotTesterMochaSelenium.ts:167


onExecute​

â–¸ Optional onExecute(): Promise<void>

Executed when this tester has been executed from the API.

Returns​

Promise<void>

Inherited from​

HotTester.onExecute

Defined in​

HotTester.ts:163


onFinishedLoading​

â–¸ Optional onFinishedLoading(): Promise<void>

Executed when this tester has finished loading all data from the API.

Returns​

Promise<void>

Inherited from​

HotTester.onFinishedLoading

Defined in​

HotTester.ts:167


onTestAPIPathEnd​

â–¸ Optional onTestAPIPathEnd(destination, method, testName, result, continueWhenTestIsComplete?): Promise<void>

Executed when an API test path has ended.

Parameters​

NameType
destinationHotDestination
methodHotRouteMethod
testNamestring
resultany
continueWhenTestIsComplete?boolean

Returns​

Promise<void>

Inherited from​

HotTester.onTestAPIPathEnd

Defined in​

HotTester.ts:137


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​

NameType
destinationHotDestination
methodHotRouteMethod
testNamestring
continueWhenTestIsComplete?boolean

Returns​

Promise<boolean>

Inherited from​

HotTester.onTestAPIPathStart

Defined in​

HotTester.ts:132


onTestEnd​

â–¸ onTestEnd(destination): Promise<void>

Executed when tests are finished.

Parameters​

NameType
destinationHotDestination

Returns​

Promise<void>

Overrides​

HotTester.onTestEnd

Defined in​

HotTesterMochaSelenium.ts:176


onTestPagePathEnd​

â–¸ Optional onTestPagePathEnd(destination, testPath, result, continueWhenTestIsComplete?): Promise<void>

Executed when a page test has ended.

Parameters​

NameType
destinationHotDestination
testPathHotTestPath
resultany
continueWhenTestIsComplete?boolean

Returns​

Promise<void>

Inherited from​

HotTester.onTestPagePathEnd

Defined in​

HotTester.ts:148


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​

NameTypeDefault value
destinationHotDestinationundefined
pageHotTestPageundefined
stopHotTestStopundefined
continueWhenTestIsCompletebooleanfalse

Returns​

Promise<boolean>

Overrides​

HotTester.onTestPagePathStart

Defined in​

HotTesterMochaSelenium.ts:138


onTestStart​

â–¸ onTestStart(destination, url, destinationKey?): Promise<boolean>

Executed when tests are started.

Parameters​

NameTypeDefault value
destinationHotDestinationundefined
urlstringundefined
destinationKeystring""

Returns​

Promise<boolean>

Overrides​

HotTester.onTestStart

Defined in​

HotTesterMochaSelenium.ts:121


setup​

â–¸ setup(isWebRoute, url?, destinationKey?): Promise<void>

Setup the Mocha/Selenium frameworks.

Parameters​

NameTypeDefault valueDescription
isWebRoutebooleanundefined-
urlstring""If this is set, this url will be used instead of the url associated with this tester.
destinationKeystring""-

Returns​

Promise<void>

Overrides​

HotTester.setup

Defined in​

HotTesterMochaSelenium.ts:77


waitForData​

â–¸ waitForData(): Promise<void>

Waits for the API to finish loading all data.

Returns​

Promise<void>

Inherited from​

HotTester.waitForData

Defined in​

HotTester.ts:172


interpretDestination​

â–¸ Static interpretDestination(mapName, testDest): HotDestination

Get a destination JSON object to use.

Parameters​

NameType
mapNamestring
testDestHotTestDestination

Returns​

HotDestination

Inherited from​

HotTester.interpretDestination

Defined in​

HotTester.ts:201