hotstaq 0.5.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +17 -0
- package/.eslintrc.js +11 -0
- package/.vscode/launch.json +199 -0
- package/.vscode/settings.json +2 -0
- package/.vscode/tasks.json +78 -0
- package/CONTRIBUTING.md +157 -0
- package/README.md +126 -0
- package/bin/hotstaq +3 -0
- package/bin/hotstaq.cmd +1 -0
- package/build/src/Hot.d.ts +167 -0
- package/build/src/Hot.d.ts.map +1 -0
- package/build/src/Hot.js +365 -0
- package/build/src/Hot.js.map +1 -0
- package/build/src/HotAPI.d.ts +130 -0
- package/build/src/HotAPI.d.ts.map +1 -0
- package/build/src/HotAPI.js +353 -0
- package/build/src/HotAPI.js.map +1 -0
- package/build/src/HotAgentAPI.d.ts +22 -0
- package/build/src/HotAgentAPI.d.ts.map +1 -0
- package/build/src/HotAgentAPI.js +85 -0
- package/build/src/HotAgentAPI.js.map +1 -0
- package/build/src/HotAgentRoute.d.ts +17 -0
- package/build/src/HotAgentRoute.d.ts.map +1 -0
- package/build/src/HotAgentRoute.js +109 -0
- package/build/src/HotAgentRoute.js.map +1 -0
- package/build/src/HotBuilder.d.ts +52 -0
- package/build/src/HotBuilder.d.ts.map +1 -0
- package/build/src/HotBuilder.js +239 -0
- package/build/src/HotBuilder.js.map +1 -0
- package/build/src/HotClient.d.ts +31 -0
- package/build/src/HotClient.d.ts.map +1 -0
- package/build/src/HotClient.js +19 -0
- package/build/src/HotClient.js.map +1 -0
- package/build/src/HotComponent.d.ts +118 -0
- package/build/src/HotComponent.d.ts.map +1 -0
- package/build/src/HotComponent.js +89 -0
- package/build/src/HotComponent.js.map +1 -0
- package/build/src/HotCreator.d.ts +92 -0
- package/build/src/HotCreator.d.ts.map +1 -0
- package/build/src/HotCreator.js +465 -0
- package/build/src/HotCreator.js.map +1 -0
- package/build/src/HotDB.d.ts +69 -0
- package/build/src/HotDB.d.ts.map +1 -0
- package/build/src/HotDB.js +29 -0
- package/build/src/HotDB.js.map +1 -0
- package/build/src/HotDBConnectionInterface.d.ts +40 -0
- package/build/src/HotDBConnectionInterface.d.ts.map +1 -0
- package/build/src/HotDBConnectionInterface.js +3 -0
- package/build/src/HotDBConnectionInterface.js.map +1 -0
- package/build/src/HotFile.d.ts +134 -0
- package/build/src/HotFile.d.ts.map +1 -0
- package/build/src/HotFile.js +454 -0
- package/build/src/HotFile.js.map +1 -0
- package/build/src/HotHTTPServer.d.ts +162 -0
- package/build/src/HotHTTPServer.d.ts.map +1 -0
- package/build/src/HotHTTPServer.js +863 -0
- package/build/src/HotHTTPServer.js.map +1 -0
- package/build/src/HotIO.d.ts +39 -0
- package/build/src/HotIO.d.ts.map +1 -0
- package/build/src/HotIO.js +195 -0
- package/build/src/HotIO.js.map +1 -0
- package/build/src/HotLog.d.ts +60 -0
- package/build/src/HotLog.d.ts.map +1 -0
- package/build/src/HotLog.js +126 -0
- package/build/src/HotLog.js.map +1 -0
- package/build/src/HotPage.d.ts +125 -0
- package/build/src/HotPage.d.ts.map +1 -0
- package/build/src/HotPage.js +178 -0
- package/build/src/HotPage.js.map +1 -0
- package/build/src/HotRoute.d.ts +82 -0
- package/build/src/HotRoute.d.ts.map +1 -0
- package/build/src/HotRoute.js +83 -0
- package/build/src/HotRoute.js.map +1 -0
- package/build/src/HotRouteMethod.d.ts +129 -0
- package/build/src/HotRouteMethod.d.ts.map +1 -0
- package/build/src/HotRouteMethod.js +84 -0
- package/build/src/HotRouteMethod.js.map +1 -0
- package/build/src/HotServer.d.ts +152 -0
- package/build/src/HotServer.d.ts.map +1 -0
- package/build/src/HotServer.js +109 -0
- package/build/src/HotServer.js.map +1 -0
- package/build/src/HotSetAsWeb.d.ts +2 -0
- package/build/src/HotSetAsWeb.d.ts.map +1 -0
- package/build/src/HotSetAsWeb.js +5 -0
- package/build/src/HotSetAsWeb.js.map +1 -0
- package/build/src/HotStaq.d.ts +601 -0
- package/build/src/HotStaq.d.ts.map +1 -0
- package/build/src/HotStaq.js +1258 -0
- package/build/src/HotStaq.js.map +1 -0
- package/build/src/HotStaqWeb.d.ts +18 -0
- package/build/src/HotStaqWeb.d.ts.map +1 -0
- package/build/src/HotStaqWeb.js +44 -0
- package/build/src/HotStaqWeb.js.map +1 -0
- package/build/src/HotTestDriver.d.ts +63 -0
- package/build/src/HotTestDriver.d.ts.map +1 -0
- package/build/src/HotTestDriver.js +187 -0
- package/build/src/HotTestDriver.js.map +1 -0
- package/build/src/HotTestElement.d.ts +71 -0
- package/build/src/HotTestElement.d.ts.map +1 -0
- package/build/src/HotTestElement.js +37 -0
- package/build/src/HotTestElement.js.map +1 -0
- package/build/src/HotTestMap.d.ts +83 -0
- package/build/src/HotTestMap.d.ts.map +1 -0
- package/build/src/HotTestMap.js +58 -0
- package/build/src/HotTestMap.js.map +1 -0
- package/build/src/HotTestSeleniumDriver.d.ts +82 -0
- package/build/src/HotTestSeleniumDriver.d.ts.map +1 -0
- package/build/src/HotTestSeleniumDriver.js +398 -0
- package/build/src/HotTestSeleniumDriver.js.map +1 -0
- package/build/src/HotTester.d.ts +188 -0
- package/build/src/HotTester.d.ts.map +1 -0
- package/build/src/HotTester.js +623 -0
- package/build/src/HotTester.js.map +1 -0
- package/build/src/HotTesterAPI.d.ts +15 -0
- package/build/src/HotTesterAPI.d.ts.map +1 -0
- package/build/src/HotTesterAPI.js +161 -0
- package/build/src/HotTesterAPI.js.map +1 -0
- package/build/src/HotTesterMocha.d.ts +50 -0
- package/build/src/HotTesterMocha.d.ts.map +1 -0
- package/build/src/HotTesterMocha.js +205 -0
- package/build/src/HotTesterMocha.js.map +1 -0
- package/build/src/HotTesterMochaSelenium.d.ts +70 -0
- package/build/src/HotTesterMochaSelenium.d.ts.map +1 -0
- package/build/src/HotTesterMochaSelenium.js +257 -0
- package/build/src/HotTesterMochaSelenium.js.map +1 -0
- package/build/src/HotTesterServer.d.ts +114 -0
- package/build/src/HotTesterServer.d.ts.map +1 -0
- package/build/src/HotTesterServer.js +575 -0
- package/build/src/HotTesterServer.js.map +1 -0
- package/build/src/api.d.ts +33 -0
- package/build/src/api.d.ts.map +1 -0
- package/build/src/api.js +78 -0
- package/build/src/api.js.map +1 -0
- package/build/src/cli.d.ts +2 -0
- package/build/src/cli.d.ts.map +1 -0
- package/build/src/cli.js +935 -0
- package/build/src/cli.js.map +1 -0
- package/build/src/schemas/HotDBInflux.d.ts +63 -0
- package/build/src/schemas/HotDBInflux.d.ts.map +1 -0
- package/build/src/schemas/HotDBInflux.js +239 -0
- package/build/src/schemas/HotDBInflux.js.map +1 -0
- package/build/src/schemas/HotDBMigration.d.ts +19 -0
- package/build/src/schemas/HotDBMigration.d.ts.map +1 -0
- package/build/src/schemas/HotDBMigration.js +15 -0
- package/build/src/schemas/HotDBMigration.js.map +1 -0
- package/build/src/schemas/HotDBMySQL.d.ts +65 -0
- package/build/src/schemas/HotDBMySQL.d.ts.map +1 -0
- package/build/src/schemas/HotDBMySQL.js +387 -0
- package/build/src/schemas/HotDBMySQL.js.map +1 -0
- package/build/src/schemas/HotDBSchema.d.ts +15 -0
- package/build/src/schemas/HotDBSchema.d.ts.map +1 -0
- package/build/src/schemas/HotDBSchema.js +19 -0
- package/build/src/schemas/HotDBSchema.js.map +1 -0
- package/build/src/schemas/influx/InfluxSchema.d.ts +14 -0
- package/build/src/schemas/influx/InfluxSchema.d.ts.map +1 -0
- package/build/src/schemas/influx/InfluxSchema.js +33 -0
- package/build/src/schemas/influx/InfluxSchema.js.map +1 -0
- package/build/src/schemas/mysql/MySQLSchema.d.ts +39 -0
- package/build/src/schemas/mysql/MySQLSchema.d.ts.map +1 -0
- package/build/src/schemas/mysql/MySQLSchema.js +151 -0
- package/build/src/schemas/mysql/MySQLSchema.js.map +1 -0
- package/build/src/schemas/mysql/MySQLSchemaField.d.ts +168 -0
- package/build/src/schemas/mysql/MySQLSchemaField.d.ts.map +1 -0
- package/build/src/schemas/mysql/MySQLSchemaField.js +260 -0
- package/build/src/schemas/mysql/MySQLSchemaField.js.map +1 -0
- package/build/src/schemas/mysql/MySQLSchemaTable.d.ts +49 -0
- package/build/src/schemas/mysql/MySQLSchemaTable.d.ts.map +1 -0
- package/build/src/schemas/mysql/MySQLSchemaTable.js +310 -0
- package/build/src/schemas/mysql/MySQLSchemaTable.js.map +1 -0
- package/build-web/HotStaq.js +2 -0
- package/build-web/HotStaq.min.js +125 -0
- package/builder/docker/Dockerfile.linux.gen +42 -0
- package/builder/docker/README.md +36 -0
- package/builder/docker/app/start.sh +8 -0
- package/builder/docker/dockerignore +3 -0
- package/builder/docker/scripts/build.bat +11 -0
- package/builder/docker/scripts/build.sh +11 -0
- package/builder/docker/scripts/start-app.bat +7 -0
- package/builder/docker/scripts/start-app.sh +7 -0
- package/builder/docker/scripts/stop-app.bat +5 -0
- package/builder/docker/scripts/stop-app.sh +5 -0
- package/builder/docker-compose/docker-compose.gen.yaml +41 -0
- package/builder/docker-compose/env-skeleton +4 -0
- package/creator/project/.vscode/launch.json +59 -0
- package/creator/project/README.md +20 -0
- package/creator/project/gitignore +118 -0
- package/creator/project/npmignore +118 -0
- package/creator/public/api-test.hott +28 -0
- package/creator/public/index.hott +12 -0
- package/creator/ts/src/AppAPI.ts +30 -0
- package/creator/ts/src/HelloWorld.ts +39 -0
- package/creator/ts/src/WebExport.ts +7 -0
- package/creator/ts/tsconfig-web.json +73 -0
- package/creator/ts/tsconfig.json +73 -0
- package/creator/ts/webpack-api.config.js +57 -0
- package/dbstart.sh +19 -0
- package/dbstop.sh +4 -0
- package/docs/.nojekyll +1 -0
- package/docs/README.md +128 -0
- package/docs/classes/Hot.md +477 -0
- package/docs/classes/HotAPI.md +369 -0
- package/docs/classes/HotClient.md +95 -0
- package/docs/classes/HotComponent.md +279 -0
- package/docs/classes/HotDB.md +247 -0
- package/docs/classes/HotDBInflux.md +404 -0
- package/docs/classes/HotDBMigration.md +80 -0
- package/docs/classes/HotDBMySQL.md +310 -0
- package/docs/classes/HotDBSchema.md +51 -0
- package/docs/classes/HotFile.md +353 -0
- package/docs/classes/HotHTTPServer.md +700 -0
- package/docs/classes/HotLog.md +162 -0
- package/docs/classes/HotPage.md +357 -0
- package/docs/classes/HotRoute.md +312 -0
- package/docs/classes/HotRouteMethod.md +271 -0
- package/docs/classes/HotServer.md +311 -0
- package/docs/classes/HotStaq.md +1153 -0
- package/docs/classes/HotTestDestination.md +58 -0
- package/docs/classes/HotTestDriver.md +332 -0
- package/docs/classes/HotTestElement.md +88 -0
- package/docs/classes/HotTestElementOptions.md +71 -0
- package/docs/classes/HotTestMap.md +92 -0
- package/docs/classes/HotTestSeleniumDriver.md +529 -0
- package/docs/classes/HotTester.md +653 -0
- package/docs/classes/HotTesterAPI.md +493 -0
- package/docs/classes/HotTesterMocha.md +843 -0
- package/docs/classes/HotTesterMochaSelenium.md +896 -0
- package/docs/classes/HotTesterServer.md +633 -0
- package/docs/classes/InfluxSchema.md +74 -0
- package/docs/classes/MySQLSchema.md +199 -0
- package/docs/classes/MySQLSchemaField.md +330 -0
- package/docs/classes/MySQLSchemaTable.md +176 -0
- package/docs/enums/ConnectionStatus.md +43 -0
- package/docs/enums/DeveloperMode.md +38 -0
- package/docs/enums/EventExecutionType.md +43 -0
- package/docs/enums/HTTPMethod.md +32 -0
- package/docs/enums/HotDBGenerationType.md +30 -0
- package/docs/enums/HotLogLevel.md +88 -0
- package/docs/interfaces/HotDBConnectionInterface.md +116 -0
- package/docs/interfaces/HotDestination.md +62 -0
- package/docs/interfaces/HotSite.md +187 -0
- package/docs/interfaces/HotSiteMapPath.md +37 -0
- package/docs/interfaces/HotSiteRoute.md +79 -0
- package/docs/interfaces/HotStartOptions.md +115 -0
- package/docs/interfaces/HotTestPage.md +44 -0
- package/docs/interfaces/HotTestStop.md +62 -0
- package/docs/interfaces/IHotComponent.md +135 -0
- package/docs/interfaces/IHotStaq.md +118 -0
- package/docs/interfaces/IHotTestElement.md +54 -0
- package/docs/interfaces/IHotTestElementOptions.md +43 -0
- package/docs/interfaces/MySQLResults.md +43 -0
- package/docs/interfaces/MySQLSchemaFieldResult.md +75 -0
- package/docs/modules.md +162 -0
- package/package.json +65 -0
- package/selenium-start.sh +7 -0
- package/selenium-stop.sh +3 -0
- package/src/Hot.ts +319 -0
- package/src/HotAPI.ts +378 -0
- package/src/HotAgentAPI.ts +43 -0
- package/src/HotAgentRoute.ts +44 -0
- package/src/HotBuilder.ts +221 -0
- package/src/HotClient.ts +40 -0
- package/src/HotComponent.ts +158 -0
- package/src/HotCreator.ts +482 -0
- package/src/HotDB.ts +79 -0
- package/src/HotDBConnectionInterface.ts +40 -0
- package/src/HotFile.ts +617 -0
- package/src/HotHTTPServer.ts +954 -0
- package/src/HotIO.ts +128 -0
- package/src/HotLog.ts +158 -0
- package/src/HotPage.ts +206 -0
- package/src/HotRoute.ts +137 -0
- package/src/HotRouteMethod.ts +216 -0
- package/src/HotServer.ts +211 -0
- package/src/HotSetAsWeb.ts +3 -0
- package/src/HotStaq.ts +1877 -0
- package/src/HotStaqWeb.ts +59 -0
- package/src/HotTestDriver.ts +172 -0
- package/src/HotTestElement.ts +97 -0
- package/src/HotTestMap.ts +130 -0
- package/src/HotTestSeleniumDriver.ts +374 -0
- package/src/HotTester.ts +697 -0
- package/src/HotTesterAPI.ts +126 -0
- package/src/HotTesterMocha.ts +133 -0
- package/src/HotTesterMochaSelenium.ts +189 -0
- package/src/HotTesterServer.ts +551 -0
- package/src/api.ts +102 -0
- package/src/cli.ts +1147 -0
- package/src/schemas/HotDBInflux.ts +211 -0
- package/src/schemas/HotDBMigration.ts +24 -0
- package/src/schemas/HotDBMySQL.ts +312 -0
- package/src/schemas/HotDBSchema.ts +21 -0
- package/src/schemas/influx/InfluxSchema.ts +19 -0
- package/src/schemas/mysql/MySQLSchema.ts +90 -0
- package/src/schemas/mysql/MySQLSchemaField.ts +408 -0
- package/src/schemas/mysql/MySQLSchemaTable.ts +353 -0
- package/tsconfig-web.json +74 -0
- package/tsconfig.json +73 -0
- package/webpack.config.js +51 -0
- package/webpack.config.tests.js +56 -0
package/src/HotTester.ts
ADDED
|
@@ -0,0 +1,697 @@
|
|
|
1
|
+
import { HotStaq } from "./HotStaq";
|
|
2
|
+
import { HotRoute } from "./HotRoute";
|
|
3
|
+
import { HotRouteMethod, TestCaseObject } from "./HotRouteMethod";
|
|
4
|
+
import { HotTestDriver } from "./HotTestDriver";
|
|
5
|
+
import { HotTestDestination, HotTestMap, HotTestPage, HotTestPath } from "./HotTestMap";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The test stop that is executed as either a destination or
|
|
9
|
+
* a path.
|
|
10
|
+
*/
|
|
11
|
+
export interface HotTestStop
|
|
12
|
+
{
|
|
13
|
+
/**
|
|
14
|
+
* A command to execute. Can be:
|
|
15
|
+
* * print(x)
|
|
16
|
+
* * Print a message to the server's console.
|
|
17
|
+
* * println(x)
|
|
18
|
+
* * Print a message with a new line to the server's console.
|
|
19
|
+
* * url(x)
|
|
20
|
+
* * Open a url. Must be an absolute url.
|
|
21
|
+
* * waitForTesterAPIData
|
|
22
|
+
* * This will wait for the tester API to receive data.
|
|
23
|
+
* * wait(x)
|
|
24
|
+
* * This will wait for x number of milliseconds.
|
|
25
|
+
* * waitForTestObject(x)
|
|
26
|
+
* * This will wait for a test object to be loaded.
|
|
27
|
+
*/
|
|
28
|
+
cmd: string;
|
|
29
|
+
/**
|
|
30
|
+
* The destination to execute.
|
|
31
|
+
*/
|
|
32
|
+
dest: string;
|
|
33
|
+
/**
|
|
34
|
+
* The path to execute.
|
|
35
|
+
*/
|
|
36
|
+
path: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The destination for a test to take.
|
|
41
|
+
*/
|
|
42
|
+
export interface HotDestination
|
|
43
|
+
{
|
|
44
|
+
/**
|
|
45
|
+
* The name of the map.
|
|
46
|
+
*/
|
|
47
|
+
mapName: string;
|
|
48
|
+
/**
|
|
49
|
+
* The page to start at.
|
|
50
|
+
*/
|
|
51
|
+
page: string;
|
|
52
|
+
/**
|
|
53
|
+
* The API route to start using.
|
|
54
|
+
*/
|
|
55
|
+
api: string;
|
|
56
|
+
/**
|
|
57
|
+
* The paths to take on the page.
|
|
58
|
+
*/
|
|
59
|
+
paths: HotTestStop[];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Executes tests.
|
|
64
|
+
*/
|
|
65
|
+
export abstract class HotTester
|
|
66
|
+
{
|
|
67
|
+
/**
|
|
68
|
+
* The tester name.
|
|
69
|
+
*/
|
|
70
|
+
name: string;
|
|
71
|
+
/**
|
|
72
|
+
* The base url that will construct future urls.
|
|
73
|
+
*/
|
|
74
|
+
baseUrl: string;
|
|
75
|
+
/**
|
|
76
|
+
* The associated processor.
|
|
77
|
+
*/
|
|
78
|
+
processor: HotStaq;
|
|
79
|
+
/**
|
|
80
|
+
* The test maps to test.
|
|
81
|
+
*/
|
|
82
|
+
testMaps: { [name: string]: HotTestMap; };
|
|
83
|
+
/**
|
|
84
|
+
* The driver to use when running tests.
|
|
85
|
+
*/
|
|
86
|
+
driver: HotTestDriver;
|
|
87
|
+
/**
|
|
88
|
+
* Has this tester finished loading?
|
|
89
|
+
*/
|
|
90
|
+
finishedLoading: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Has this tester finished setting up?
|
|
93
|
+
*/
|
|
94
|
+
hasBeenSetup: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Has this tester finished setting up?
|
|
97
|
+
*/
|
|
98
|
+
hasBeenDestroyed: boolean;
|
|
99
|
+
|
|
100
|
+
constructor (processor: HotStaq, name: string, baseUrl: string,
|
|
101
|
+
driver: HotTestDriver, testMaps: { [name: string]: HotTestMap; } = {})
|
|
102
|
+
{
|
|
103
|
+
this.processor = processor;
|
|
104
|
+
this.name = name;
|
|
105
|
+
this.baseUrl = baseUrl;
|
|
106
|
+
this.testMaps = testMaps;
|
|
107
|
+
this.driver = driver;
|
|
108
|
+
this.finishedLoading = false;
|
|
109
|
+
this.hasBeenSetup = false;
|
|
110
|
+
this.hasBeenDestroyed = false;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Executed when setting up the tester.
|
|
115
|
+
*/
|
|
116
|
+
abstract setup (isWebRoute: boolean, url: string, destinationKey?: string): Promise<void>;
|
|
117
|
+
/**
|
|
118
|
+
* Executed when destroying up the tester.
|
|
119
|
+
*/
|
|
120
|
+
abstract destroy (): Promise<void>;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Executed when tests are started. If this returns true, it will
|
|
124
|
+
* continue and execute all test paths. If this returns it will
|
|
125
|
+
* skip all test paths and execute onTestEnd instead.
|
|
126
|
+
*/
|
|
127
|
+
async onTestStart? (destination: HotDestination, url: string, destinationKey?: string): Promise<boolean>;
|
|
128
|
+
/**
|
|
129
|
+
* Executed when an API test path has started. If this returns false,
|
|
130
|
+
* the testPath will not be immediately executed afterwards.
|
|
131
|
+
*/
|
|
132
|
+
async onTestAPIPathStart? (destination: HotDestination, method: HotRouteMethod,
|
|
133
|
+
testName: string, continueWhenTestIsComplete?: boolean): Promise<boolean>;
|
|
134
|
+
/**
|
|
135
|
+
* Executed when an API test path has ended.
|
|
136
|
+
*/
|
|
137
|
+
async onTestAPIPathEnd? (destination: HotDestination, method: HotRouteMethod,
|
|
138
|
+
testName: string, result: any, continueWhenTestIsComplete?: boolean): Promise<void>;
|
|
139
|
+
/**
|
|
140
|
+
* Executed when page tests are started. If this returns false, the testPath will not be
|
|
141
|
+
* immediately executed afterwards.
|
|
142
|
+
*/
|
|
143
|
+
async onTestPagePathStart? (destination: HotDestination, page: HotTestPage,
|
|
144
|
+
stop: HotTestStop, continueWhenTestIsComplete?: boolean): Promise<boolean>;
|
|
145
|
+
/**
|
|
146
|
+
* Executed when a page test has ended.
|
|
147
|
+
*/
|
|
148
|
+
async onTestPagePathEnd? (destination: HotDestination, testPath: HotTestPath,
|
|
149
|
+
result: any, continueWhenTestIsComplete?: boolean): Promise<void>;
|
|
150
|
+
/**
|
|
151
|
+
* Executed when a command is executed.
|
|
152
|
+
*/
|
|
153
|
+
async onCommand? (destination: HotDestination, page: HotTestPage, stop: HotTestStop,
|
|
154
|
+
cmd: string, args: string[], cmdFunc: ((cmdArgs: string[]) => Promise<void>)): Promise<void>;
|
|
155
|
+
/**
|
|
156
|
+
* Executed when tests are finished.
|
|
157
|
+
*/
|
|
158
|
+
async onTestEnd? (destination: HotDestination): Promise<void>;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Executed when this tester has been executed from the API.
|
|
162
|
+
*/
|
|
163
|
+
async onExecute? (): Promise<void>;
|
|
164
|
+
/**
|
|
165
|
+
* Executed when this tester has finished loading all data from the API.
|
|
166
|
+
*/
|
|
167
|
+
async onFinishedLoading? (): Promise<void>;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Waits for the API to finish loading all data.
|
|
171
|
+
*/
|
|
172
|
+
async waitForData (): Promise<void>
|
|
173
|
+
{
|
|
174
|
+
while (this.finishedLoading === false)
|
|
175
|
+
await HotStaq.wait (10);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Get a test page.
|
|
180
|
+
*/
|
|
181
|
+
getTestPage (destination: HotDestination): HotTestPage
|
|
182
|
+
{
|
|
183
|
+
let page = this.testMaps[destination.mapName].pages[destination.page];
|
|
184
|
+
|
|
185
|
+
return (page);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Get a test path.
|
|
190
|
+
*/
|
|
191
|
+
getTestPath (destination: HotDestination, pathName: string): HotTestPath
|
|
192
|
+
{
|
|
193
|
+
let page = this.testMaps[destination.mapName].pages[destination.page];
|
|
194
|
+
|
|
195
|
+
return (page.testPaths[pathName]);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Get a destination JSON object to use.
|
|
200
|
+
*/
|
|
201
|
+
static interpretDestination (mapName: string, testDest: HotTestDestination): HotDestination
|
|
202
|
+
{
|
|
203
|
+
let destination: string = testDest.destination;
|
|
204
|
+
let newDestination: HotDestination = {
|
|
205
|
+
mapName: mapName,
|
|
206
|
+
page: "",
|
|
207
|
+
api: "",
|
|
208
|
+
paths: []
|
|
209
|
+
};
|
|
210
|
+
let strs: string[] = destination.split (/\-\>/g);
|
|
211
|
+
let type: string = strs[0];
|
|
212
|
+
let getType: (typeStr: string, typeDelimiter: string) => string =
|
|
213
|
+
(typeStr: string, typeDelimiter: string): string =>
|
|
214
|
+
{
|
|
215
|
+
let pos: number = typeStr.indexOf (typeDelimiter);
|
|
216
|
+
let typeValue: string = "";
|
|
217
|
+
|
|
218
|
+
if (pos > -1)
|
|
219
|
+
{
|
|
220
|
+
typeValue = typeStr.substr (pos + typeDelimiter.length);
|
|
221
|
+
typeValue = typeValue.trim ();
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
return (typeValue);
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
newDestination.page = getType (type, "page:");
|
|
228
|
+
newDestination.api = getType (type, "api:");
|
|
229
|
+
|
|
230
|
+
for (let iIdx = 1; iIdx < strs.length; iIdx++)
|
|
231
|
+
{
|
|
232
|
+
let newPathStr: string = strs[iIdx];
|
|
233
|
+
let newPath: HotTestStop = {
|
|
234
|
+
cmd: "",
|
|
235
|
+
dest: "",
|
|
236
|
+
path: ""
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
newPathStr = newPathStr.trim ();
|
|
240
|
+
newPath.dest = getType (newPathStr, "dest:");
|
|
241
|
+
newPath.cmd = getType (newPathStr, "cmd:");
|
|
242
|
+
newPath.path = getType (newPathStr, "path:");
|
|
243
|
+
|
|
244
|
+
if ((newPath.dest == "") && (newPath.cmd == "") && (newPath.path == ""))
|
|
245
|
+
newPath.path = newPathStr;
|
|
246
|
+
|
|
247
|
+
newDestination.paths.push (newPath);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
return (newDestination);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Execute an API's test path.
|
|
255
|
+
*/
|
|
256
|
+
async executeTestAPIPath (destination: HotDestination, method: HotRouteMethod,
|
|
257
|
+
testName: string, skipEventCalls: boolean = false, continueWhenTestIsComplete: boolean = false): Promise<any>
|
|
258
|
+
{
|
|
259
|
+
let runTestPath: boolean = true;
|
|
260
|
+
|
|
261
|
+
// A dumb hack to prevent any recursion that could occur.
|
|
262
|
+
if (skipEventCalls === false)
|
|
263
|
+
{
|
|
264
|
+
if (this.onTestAPIPathStart != null)
|
|
265
|
+
runTestPath = await this.onTestAPIPathStart (destination, method, testName, continueWhenTestIsComplete);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
let result: any = null;
|
|
269
|
+
|
|
270
|
+
if (runTestPath === true)
|
|
271
|
+
{
|
|
272
|
+
let testCaseObject: TestCaseObject = method.testCases[testName];
|
|
273
|
+
|
|
274
|
+
if (testCaseObject == null)
|
|
275
|
+
throw new Error (`HotTester: Test case object ${testName} does not exist!`);
|
|
276
|
+
|
|
277
|
+
result = await testCaseObject.func (this.driver);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
if (skipEventCalls === false)
|
|
281
|
+
{
|
|
282
|
+
if (this.onTestAPIPathEnd != null)
|
|
283
|
+
await this.onTestAPIPathEnd (destination, method, testName, result, continueWhenTestIsComplete);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
return (result);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Execute all test paths in an API route.
|
|
291
|
+
*
|
|
292
|
+
* @fixme This needs a better implementation...
|
|
293
|
+
*/
|
|
294
|
+
async executeTestAPIPaths (destination: HotDestination): Promise<any[]>
|
|
295
|
+
{
|
|
296
|
+
let results: any[] = [];
|
|
297
|
+
let testMap: HotTestMap = this.testMaps[destination.mapName];
|
|
298
|
+
|
|
299
|
+
if (testMap == null)
|
|
300
|
+
throw new Error (`HotTester: Map ${destination.mapName} does not exist!`);
|
|
301
|
+
|
|
302
|
+
if (this.processor.api == null)
|
|
303
|
+
throw new Error (`HotTester: Associated processor does not have an API!`);
|
|
304
|
+
|
|
305
|
+
let route: HotRoute = this.processor.api.routes[destination.api];
|
|
306
|
+
|
|
307
|
+
if (route == null)
|
|
308
|
+
throw new Error (`HotTester: API does not have route ${destination.api}!`);
|
|
309
|
+
|
|
310
|
+
// Iterate through each path in the destination until complete.
|
|
311
|
+
for (let iIdx = 0; iIdx < destination.paths.length; iIdx += 2)
|
|
312
|
+
{
|
|
313
|
+
let stop: HotTestStop = destination.paths[iIdx];
|
|
314
|
+
let pathName: string = stop.path;
|
|
315
|
+
let method: HotRouteMethod = route.getMethod (pathName);
|
|
316
|
+
let nextStop: HotTestStop = destination.paths[iIdx + 1];
|
|
317
|
+
let testName: string = nextStop.path;
|
|
318
|
+
let result: any = await this.executeTestAPIPath (destination, method, testName);
|
|
319
|
+
|
|
320
|
+
results.push (result);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
return (results);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Execute a test page path.
|
|
328
|
+
*/
|
|
329
|
+
async executeTestPagePath (destination: HotDestination, stop: HotTestStop,
|
|
330
|
+
skipEventCalls: boolean = false, continueWhenTestIsComplete: boolean = false): Promise<any>
|
|
331
|
+
{
|
|
332
|
+
let runTestPath: boolean = true;
|
|
333
|
+
let testMap: HotTestMap = this.testMaps[destination.mapName];
|
|
334
|
+
|
|
335
|
+
/// @fixme For some reason the errors being thrown here are not being thrown.
|
|
336
|
+
if (testMap == null)
|
|
337
|
+
throw new Error (`HotTester: Map ${destination.mapName} does not exist!`);
|
|
338
|
+
|
|
339
|
+
let page: HotTestPage = testMap.pages[destination.page];
|
|
340
|
+
|
|
341
|
+
if (page == null)
|
|
342
|
+
throw new Error (`HotTester: Page ${destination.page} does not exist!`);
|
|
343
|
+
|
|
344
|
+
this.driver.page = page;
|
|
345
|
+
|
|
346
|
+
let testPathName: string = stop.path;
|
|
347
|
+
let testPath: HotTestPath = page.testPaths[testPathName];
|
|
348
|
+
|
|
349
|
+
// A dumb hack to prevent any recursion that could occur.
|
|
350
|
+
if (skipEventCalls === false)
|
|
351
|
+
{
|
|
352
|
+
if (this.onTestPagePathStart != null)
|
|
353
|
+
runTestPath = await this.onTestPagePathStart (destination, page, stop, continueWhenTestIsComplete);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
let result: any = null;
|
|
357
|
+
|
|
358
|
+
if (runTestPath === true)
|
|
359
|
+
{
|
|
360
|
+
if (testPath == null)
|
|
361
|
+
{
|
|
362
|
+
debugger;
|
|
363
|
+
throw new Error (`HotTester: Test path ${testPathName} does not have a function!`);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
result = await testPath (this.driver);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
if (skipEventCalls === false)
|
|
370
|
+
{
|
|
371
|
+
if (this.onTestPagePathEnd != null)
|
|
372
|
+
await this.onTestPagePathEnd (destination, testPath, result, continueWhenTestIsComplete);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
return (result);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Execute a command.
|
|
380
|
+
*/
|
|
381
|
+
async executeCommand (destination: HotDestination, page: HotTestPage, stop: HotTestStop, cmd: string): Promise<void>
|
|
382
|
+
{
|
|
383
|
+
/**
|
|
384
|
+
* Check if the input command matches.
|
|
385
|
+
*/
|
|
386
|
+
let hasCmd: (input: string, cmd: string, hasArguments: boolean) => boolean =
|
|
387
|
+
(input: string, cmd: string, hasArguments: boolean): boolean =>
|
|
388
|
+
{
|
|
389
|
+
let result: boolean = false;
|
|
390
|
+
|
|
391
|
+
if (stop.cmd === cmd)
|
|
392
|
+
result = true;
|
|
393
|
+
|
|
394
|
+
const pos: number = stop.cmd.indexOf ("(");
|
|
395
|
+
|
|
396
|
+
// If there's parenthesis, get the incoming command.
|
|
397
|
+
if (pos > -1)
|
|
398
|
+
{
|
|
399
|
+
let inputCmd: string = stop.cmd.substr (0, pos);
|
|
400
|
+
|
|
401
|
+
if (inputCmd === cmd)
|
|
402
|
+
result = true;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
return (result);
|
|
406
|
+
};
|
|
407
|
+
/**
|
|
408
|
+
* Get the arguments in a command. This will only return a
|
|
409
|
+
* single argument for now.
|
|
410
|
+
*
|
|
411
|
+
* @fixme Add support for multiple arguments.
|
|
412
|
+
*/
|
|
413
|
+
let getCmdArgs: (input: string) => string[] =
|
|
414
|
+
(input: string): string[] =>
|
|
415
|
+
{
|
|
416
|
+
let results: string[] = [];
|
|
417
|
+
let matches = input.match (/(?=\()(.*?)(?=\))/g);
|
|
418
|
+
|
|
419
|
+
if (matches != null)
|
|
420
|
+
{
|
|
421
|
+
let tempMatch = matches[0];
|
|
422
|
+
|
|
423
|
+
// A little hack, since I suck at Regex :(
|
|
424
|
+
tempMatch = tempMatch.substr (2, tempMatch.length);
|
|
425
|
+
|
|
426
|
+
results.push (tempMatch);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
if (results.length < 1)
|
|
430
|
+
throw new Error (`HotTester: Command ${input} requires arguments, but none were supplied.`);
|
|
431
|
+
|
|
432
|
+
return (results);
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
let cmdFunc: ((cmdArgs: string[]) => Promise<void>) = null;
|
|
436
|
+
let args: string[] = [];
|
|
437
|
+
|
|
438
|
+
if (hasCmd (stop.cmd, "waitForTesterAPIData", false) === true)
|
|
439
|
+
{
|
|
440
|
+
cmdFunc = async (cmdArgs: string[]): Promise<void> =>
|
|
441
|
+
{
|
|
442
|
+
this.finishedLoading = false;
|
|
443
|
+
await this.waitForData ();
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
if (hasCmd (stop.cmd, "wait", true) === true)
|
|
448
|
+
{
|
|
449
|
+
args = getCmdArgs (stop.cmd);
|
|
450
|
+
|
|
451
|
+
cmdFunc = async (cmdArgs: string[]): Promise<void> =>
|
|
452
|
+
{
|
|
453
|
+
let numMilliseconds: number = parseInt (cmdArgs[0]);
|
|
454
|
+
|
|
455
|
+
await HotStaq.wait (numMilliseconds);
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
if (hasCmd (stop.cmd, "url", true) === true)
|
|
460
|
+
{
|
|
461
|
+
args = getCmdArgs (stop.cmd);
|
|
462
|
+
|
|
463
|
+
cmdFunc = async (cmdArgs: string[]): Promise<void> =>
|
|
464
|
+
{
|
|
465
|
+
let input: string = cmdArgs[0];
|
|
466
|
+
|
|
467
|
+
await this.driver.navigateToUrl (input);
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
if (hasCmd (stop.cmd, "print", true) === true)
|
|
472
|
+
{
|
|
473
|
+
args = getCmdArgs (stop.cmd);
|
|
474
|
+
|
|
475
|
+
cmdFunc = async (cmdArgs: string[]): Promise<void> =>
|
|
476
|
+
{
|
|
477
|
+
let input: string = cmdArgs[0];
|
|
478
|
+
|
|
479
|
+
await this.driver.print (input);
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
if (hasCmd (stop.cmd, "println", true) === true)
|
|
484
|
+
{
|
|
485
|
+
args = getCmdArgs (stop.cmd);
|
|
486
|
+
|
|
487
|
+
cmdFunc = async (cmdArgs: string[]): Promise<void> =>
|
|
488
|
+
{
|
|
489
|
+
let input: string = cmdArgs[0];
|
|
490
|
+
|
|
491
|
+
await this.driver.println (input);
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
if (hasCmd (stop.cmd, "waitForTestObject", true) === true)
|
|
496
|
+
{
|
|
497
|
+
args = getCmdArgs (stop.cmd);
|
|
498
|
+
|
|
499
|
+
cmdFunc = async (cmdArgs: string[]): Promise<void> =>
|
|
500
|
+
{
|
|
501
|
+
let testObject: string = JSON.parse (cmdArgs[0]);
|
|
502
|
+
|
|
503
|
+
await this.driver.waitForTestElement (testObject);
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
if (cmdFunc == null)
|
|
508
|
+
throw new Error (`HotTester: Command ${stop.cmd} does not exist!`);
|
|
509
|
+
|
|
510
|
+
await this.onCommand (destination, page, stop, cmd, args, cmdFunc);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* Execute all test paths in a page.
|
|
515
|
+
*/
|
|
516
|
+
async executeTestPagePaths (destination: HotDestination, continueWhenTestIsComplete: boolean = false): Promise<any[]>
|
|
517
|
+
{
|
|
518
|
+
let results: any[] = [];
|
|
519
|
+
let testMap: HotTestMap = this.testMaps[destination.mapName];
|
|
520
|
+
|
|
521
|
+
/// @fixme For some reason the errors being thrown here are not being thrown.
|
|
522
|
+
if (testMap == null)
|
|
523
|
+
throw new Error (`HotTester: Map ${destination.mapName} does not exist!`);
|
|
524
|
+
|
|
525
|
+
// Iterate through each path in the destination until complete.
|
|
526
|
+
for (let iIdx = 0; iIdx < destination.paths.length; iIdx++)
|
|
527
|
+
{
|
|
528
|
+
let stop: HotTestStop = destination.paths[iIdx];
|
|
529
|
+
let result: any = null;
|
|
530
|
+
let page: HotTestPage = testMap.pages[destination.page];
|
|
531
|
+
|
|
532
|
+
if (page == null)
|
|
533
|
+
throw new Error (`HotTester: Page ${destination.page} does not exist!`);
|
|
534
|
+
|
|
535
|
+
if (stop.dest !== "")
|
|
536
|
+
{
|
|
537
|
+
if (testMap.destinations instanceof Array)
|
|
538
|
+
throw new Error (`HotTester: When using type 'dest' in a destination string, all destinations in map ${destination.mapName} must be named.`);
|
|
539
|
+
|
|
540
|
+
let testDest: HotTestDestination = testMap.destinations[stop.dest];
|
|
541
|
+
let newDestination: HotDestination = HotTester.interpretDestination (
|
|
542
|
+
destination.mapName, testDest);
|
|
543
|
+
|
|
544
|
+
result = await this.executeTestPagePaths (newDestination);
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
if (stop.cmd !== "")
|
|
548
|
+
await this.executeCommand (destination, page, stop, stop.cmd);
|
|
549
|
+
|
|
550
|
+
if (stop.path !== "")
|
|
551
|
+
result = await this.executeTestPagePath (destination, stop, false, continueWhenTestIsComplete);
|
|
552
|
+
|
|
553
|
+
results.push (result);
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
return (results);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
/**
|
|
560
|
+
* Execute the tests.
|
|
561
|
+
*/
|
|
562
|
+
async execute (mapName: string): Promise<void>
|
|
563
|
+
{
|
|
564
|
+
let map: HotTestMap = this.testMaps[mapName];
|
|
565
|
+
|
|
566
|
+
if (map == null)
|
|
567
|
+
throw new Error (`HotTester: Map ${mapName} does not exist!`);
|
|
568
|
+
|
|
569
|
+
// Process routes testing first.
|
|
570
|
+
let routeKey: string = this.processor.getRouteKeyFromName (mapName);
|
|
571
|
+
let url: string = "";
|
|
572
|
+
|
|
573
|
+
if (routeKey !== "")
|
|
574
|
+
url = `${this.baseUrl}${routeKey}`;
|
|
575
|
+
|
|
576
|
+
let executeDestination: (testDest: HotTestDestination, destinationKey?: string) => Promise<void> =
|
|
577
|
+
async (testDest: HotTestDestination, destinationKey: string = "") =>
|
|
578
|
+
{
|
|
579
|
+
if (testDest.autoStart === false)
|
|
580
|
+
return;
|
|
581
|
+
|
|
582
|
+
let destination: HotDestination = HotTester.interpretDestination (mapName, testDest);
|
|
583
|
+
let isWebRoute: boolean = false;
|
|
584
|
+
let runTestPaths: boolean = true;
|
|
585
|
+
|
|
586
|
+
if (destination.page !== "")
|
|
587
|
+
isWebRoute = true;
|
|
588
|
+
|
|
589
|
+
if (this.setup != null)
|
|
590
|
+
{
|
|
591
|
+
if (this.hasBeenSetup === false)
|
|
592
|
+
{
|
|
593
|
+
await this.setup (isWebRoute, url, destinationKey);
|
|
594
|
+
this.hasBeenSetup = true;
|
|
595
|
+
this.hasBeenDestroyed = false;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
if (this.onTestStart != null)
|
|
600
|
+
runTestPaths = await this.onTestStart (destination, url, destinationKey);
|
|
601
|
+
|
|
602
|
+
if (runTestPaths === true)
|
|
603
|
+
{
|
|
604
|
+
if (destination.page !== "")
|
|
605
|
+
await this.executeTestPagePaths (destination);
|
|
606
|
+
|
|
607
|
+
if (destination.api !== "")
|
|
608
|
+
await this.executeTestAPIPaths (destination);
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
if (this.onTestEnd != null)
|
|
612
|
+
await this.onTestEnd (destination);
|
|
613
|
+
|
|
614
|
+
if (this.destroy != null)
|
|
615
|
+
{
|
|
616
|
+
if (this.hasBeenDestroyed === false)
|
|
617
|
+
{
|
|
618
|
+
await this.destroy ();
|
|
619
|
+
this.hasBeenDestroyed = true;
|
|
620
|
+
this.hasBeenSetup = false;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
};
|
|
624
|
+
|
|
625
|
+
// If the map destinations are in an array, just execute those in order.
|
|
626
|
+
if (map.destinations instanceof Array)
|
|
627
|
+
{
|
|
628
|
+
for (let iIdx = 0; iIdx < map.destinations.length; iIdx++)
|
|
629
|
+
{
|
|
630
|
+
let testDest: HotTestDestination = map.destinations[iIdx];
|
|
631
|
+
|
|
632
|
+
await executeDestination (testDest);
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
else
|
|
636
|
+
{
|
|
637
|
+
// If there's a destination order, use that.
|
|
638
|
+
if (map.destinationOrder.length > 0)
|
|
639
|
+
{
|
|
640
|
+
let hasExecutedKeys: string[] = [];
|
|
641
|
+
|
|
642
|
+
// Go through the destination order and execute each one.
|
|
643
|
+
for (let iIdx = 0; iIdx < map.destinationOrder.length; iIdx++)
|
|
644
|
+
{
|
|
645
|
+
let orderKey: string = map.destinationOrder[iIdx];
|
|
646
|
+
let testDest: HotTestDestination = map.destinations[orderKey];
|
|
647
|
+
|
|
648
|
+
if (testDest == null)
|
|
649
|
+
throw new Error (`HotTester: Destination ${orderKey} does not exist!`);
|
|
650
|
+
|
|
651
|
+
hasExecutedKeys.push (orderKey);
|
|
652
|
+
await executeDestination (testDest, orderKey);
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
// Execute the rest of the destinations that have not been executed yet.
|
|
656
|
+
for (let key in map.destinations)
|
|
657
|
+
{
|
|
658
|
+
let executeDest: boolean = true;
|
|
659
|
+
|
|
660
|
+
for (let iIdx = 0; iIdx < hasExecutedKeys.length; iIdx++)
|
|
661
|
+
{
|
|
662
|
+
let executedKey: string = hasExecutedKeys[iIdx];
|
|
663
|
+
|
|
664
|
+
if (executedKey === key)
|
|
665
|
+
{
|
|
666
|
+
executeDest = false;
|
|
667
|
+
|
|
668
|
+
break;
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
if (executeDest === true)
|
|
673
|
+
{
|
|
674
|
+
let testDest: HotTestDestination = map.destinations[key];
|
|
675
|
+
|
|
676
|
+
await executeDestination (testDest, key);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
else
|
|
681
|
+
{
|
|
682
|
+
// Execute the destinations in any order.
|
|
683
|
+
for (let key in map.destinations)
|
|
684
|
+
{
|
|
685
|
+
let testDest: HotTestDestination = map.destinations[key];
|
|
686
|
+
|
|
687
|
+
await executeDestination (testDest, key);
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
// End of routes testing
|
|
693
|
+
|
|
694
|
+
// Start of API testing
|
|
695
|
+
|
|
696
|
+
}
|
|
697
|
+
}
|