@opentap/runner-client 2.19.1-alpha.1.1 → 2.19.1-alpha.1.3
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/lib/SessionClient.d.ts +53 -2
- package/lib/SessionClient.js +136 -5
- package/package.json +1 -1
package/lib/SessionClient.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BreakPoints, CommonContext, CommonSettings, DataGridControl, Image, Interaction, ListItemType, LogList, Parameter, RepositoryPackageDefinition, RepositoryPackageReference, Result, Resource, RunStatus, SessionEvent, Setting, TestPlan, TestRun, TestStepType, TestStepValidationError, WatchDog,
|
|
1
|
+
import { BreakPoints, CommonContext, CommonSettings, DataGridControl, Image, Interaction, ListItemType, LogList, Parameter, RepositoryPackageDefinition, RepositoryPackageReference, Result, Resource, RunStatus, SessionEvent, Setting, TestPlan, TestRun, TestStepType, TestStepValidationError, WatchDog, TestStepRunEvent, TestPlanRunEvent } from './DTOs';
|
|
2
2
|
import { ConnectionOptions, NatsError, Subscription, SubscriptionOptions } from 'nats.ws';
|
|
3
3
|
import { BaseClient } from './BaseClient';
|
|
4
4
|
export declare class SessionClient extends BaseClient {
|
|
@@ -24,7 +24,58 @@ export declare class SessionClient extends BaseClient {
|
|
|
24
24
|
*/
|
|
25
25
|
connectSessionResults(resultHandler: (result: Result | undefined, err: NatsError | Error | null) => void, testRunHandler: (testRun: TestRun | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): [Subscription, Subscription];
|
|
26
26
|
connectTestStepRunStartedEvents(resultHandler: (result: Result | undefined, err: NatsError | Error | null) => void, testRunHandler: (testRun: TestRun | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): [Subscription, Subscription];
|
|
27
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Connect to listen to the TestPlanRun events for the given test plan run ID.
|
|
29
|
+
* @param {string} testPlanRunId
|
|
30
|
+
* @param {(event:TestPlanRunEvent|undefined,err:NatsError|Error|null)=>void} handler
|
|
31
|
+
* @param {SubscriptionOptions} options?
|
|
32
|
+
* @returns Subscription
|
|
33
|
+
*/
|
|
34
|
+
connectTestPlanRunEvents(testPlanRunId: string, handler: (event: TestPlanRunEvent | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
35
|
+
/**
|
|
36
|
+
* Connect to listen to the test plan run logs for the given test plan run ID
|
|
37
|
+
* @param {string} testPlanRunId
|
|
38
|
+
* @param {(logList:LogList|undefined,err:NatsError|Error|null)=>void} handler
|
|
39
|
+
* @param {SubscriptionOptions} options?
|
|
40
|
+
* @returns Subscription
|
|
41
|
+
*/
|
|
42
|
+
connectTestPlanRunLogs(testPlanRunId: string, handler: (logList: LogList | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
43
|
+
/**
|
|
44
|
+
* Connect to listen to the test plan run parameter events for the given test plan run ID
|
|
45
|
+
* @param {string} testPlanRunId
|
|
46
|
+
* @param {(event:Parameter[]|undefined,err:NatsError|Error|null)=>void} handler
|
|
47
|
+
* @param {SubscriptionOptions} options?
|
|
48
|
+
* @returns Subscription
|
|
49
|
+
*/
|
|
50
|
+
connectTestPlanRunParameterEvents(testPlanRunId: string, handler: (event: Parameter[] | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
51
|
+
/**
|
|
52
|
+
* Connect to listen to the test step run events for the given test step and test plan run ID
|
|
53
|
+
* @param {string} testPlanRunId
|
|
54
|
+
* @param {string} testStepRunId
|
|
55
|
+
* @param {(testRun:TestStepRunEvent|undefined,err:NatsError|Error|null)=>void} handler
|
|
56
|
+
* @param {SubscriptionOptions} options?
|
|
57
|
+
* @returns Subscription
|
|
58
|
+
*/
|
|
59
|
+
connectTestStepRunEvents(testPlanRunId: string, testStepRunId: string, handler: (testRun: TestStepRunEvent | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
60
|
+
/**
|
|
61
|
+
* Connect to listen to the test step run parameters for the given test step and test plan run ID
|
|
62
|
+
* @param {string} testPlanRunId
|
|
63
|
+
* @param {string} testStepRunId
|
|
64
|
+
* @param {(event:Parameter[]|undefined,err:NatsError|Error|null)=>void} handler
|
|
65
|
+
* @param {SubscriptionOptions} options?
|
|
66
|
+
* @returns Subscription
|
|
67
|
+
*/
|
|
68
|
+
connectTestStepRunParameterEvents(testPlanRunId: string, testStepRunId: string, handler: (event: Parameter[] | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
69
|
+
/**
|
|
70
|
+
* Connect to listen to the test step run results for the given test step and test plan run ID
|
|
71
|
+
* @param {string} testPlanRunId
|
|
72
|
+
* @param {string} testStepRunId
|
|
73
|
+
* @param {string} resultName
|
|
74
|
+
* @param {(result:Result|undefined,err:NatsError|Error|null)=>void} handler
|
|
75
|
+
* @param {SubscriptionOptions} options?
|
|
76
|
+
* @returns Subscription
|
|
77
|
+
*/
|
|
78
|
+
connectTestStepRunResults(testPlanRunId: string, testStepRunId: string, resultName: string, handler: (result: Result | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
28
79
|
/**
|
|
29
80
|
* Unsubscibe from session events
|
|
30
81
|
*/
|
package/lib/SessionClient.js
CHANGED
|
@@ -24,7 +24,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
24
24
|
};
|
|
25
25
|
return __assign.apply(this, arguments);
|
|
26
26
|
};
|
|
27
|
-
import { BreakPoints, CommonContext, CommonSettings, DataGridControl, Image, Interaction, ListItemType, LogList, Result, RunStatus, SessionEvent, Setting, TestPlan, TestRun, TestStepType, TestStepValidationError, WatchDog,
|
|
27
|
+
import { BreakPoints, CommonContext, CommonSettings, DataGridControl, Image, Interaction, ListItemType, LogList, Parameter, Result, RunStatus, SessionEvent, Setting, TestPlan, TestRun, TestStepType, TestStepValidationError, WatchDog, TestStepRunEvent, TestPlanRunEvent, } from './DTOs';
|
|
28
28
|
import { JSONCodec } from 'nats.ws';
|
|
29
29
|
import { BaseClient } from './BaseClient';
|
|
30
30
|
var SessionClient = /** @class */ (function (_super) {
|
|
@@ -154,16 +154,147 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
154
154
|
} })),
|
|
155
155
|
];
|
|
156
156
|
};
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
/**
|
|
158
|
+
* Connect to listen to the TestPlanRun events for the given test plan run ID.
|
|
159
|
+
* @param {string} testPlanRunId
|
|
160
|
+
* @param {(event:TestPlanRunEvent|undefined,err:NatsError|Error|null)=>void} handler
|
|
161
|
+
* @param {SubscriptionOptions} options?
|
|
162
|
+
* @returns Subscription
|
|
163
|
+
*/
|
|
164
|
+
SessionClient.prototype.connectTestPlanRunEvents = function (testPlanRunId, handler, options) {
|
|
165
|
+
return this.subscribe("PlanRun.".concat(testPlanRunId), __assign(__assign({}, options), { callback: function (error, encodedMessage) {
|
|
166
|
+
if (error) {
|
|
167
|
+
handler(undefined, error);
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
try {
|
|
171
|
+
var jsonCodec = JSONCodec();
|
|
172
|
+
var testPlanRunEventJs = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
173
|
+
var testPlanRunEvent = TestPlanRunEvent.fromJS(testPlanRunEventJs);
|
|
174
|
+
handler(testPlanRunEvent, error);
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
handler(undefined, error);
|
|
178
|
+
}
|
|
179
|
+
} }));
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* Connect to listen to the test plan run logs for the given test plan run ID
|
|
183
|
+
* @param {string} testPlanRunId
|
|
184
|
+
* @param {(logList:LogList|undefined,err:NatsError|Error|null)=>void} handler
|
|
185
|
+
* @param {SubscriptionOptions} options?
|
|
186
|
+
* @returns Subscription
|
|
187
|
+
*/
|
|
188
|
+
SessionClient.prototype.connectTestPlanRunLogs = function (testPlanRunId, handler, options) {
|
|
189
|
+
return this.subscribe("PlanRun.".concat(testPlanRunId, ".Logs"), __assign(__assign({}, options), { callback: function (error, encodedMessage) {
|
|
190
|
+
if (error) {
|
|
191
|
+
handler(undefined, error);
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
try {
|
|
195
|
+
var jsonCodec = JSONCodec();
|
|
196
|
+
var logListJson = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
197
|
+
var logList = LogList.fromJS(logListJson);
|
|
198
|
+
handler(logList, error);
|
|
199
|
+
}
|
|
200
|
+
catch (error) {
|
|
201
|
+
handler(undefined, error);
|
|
202
|
+
}
|
|
203
|
+
} }));
|
|
204
|
+
};
|
|
205
|
+
/**
|
|
206
|
+
* Connect to listen to the test plan run parameter events for the given test plan run ID
|
|
207
|
+
* @param {string} testPlanRunId
|
|
208
|
+
* @param {(event:Parameter[]|undefined,err:NatsError|Error|null)=>void} handler
|
|
209
|
+
* @param {SubscriptionOptions} options?
|
|
210
|
+
* @returns Subscription
|
|
211
|
+
*/
|
|
212
|
+
SessionClient.prototype.connectTestPlanRunParameterEvents = function (testPlanRunId, handler, options) {
|
|
213
|
+
return this.subscribe("PlanRun.".concat(testPlanRunId, ".Parameters"), __assign(__assign({}, options), { callback: function (error, encodedMessage) {
|
|
214
|
+
if (error) {
|
|
215
|
+
handler(undefined, error);
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
try {
|
|
219
|
+
var jsonCodec = JSONCodec();
|
|
220
|
+
var parameterListJs = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
221
|
+
var parameterList = parameterListJs.map(function (parameterJs) { return Parameter.fromJS(parameterJs); });
|
|
222
|
+
handler(parameterList, error);
|
|
223
|
+
}
|
|
224
|
+
catch (error) {
|
|
225
|
+
handler(undefined, error);
|
|
226
|
+
}
|
|
227
|
+
} }));
|
|
228
|
+
};
|
|
229
|
+
/**
|
|
230
|
+
* Connect to listen to the test step run events for the given test step and test plan run ID
|
|
231
|
+
* @param {string} testPlanRunId
|
|
232
|
+
* @param {string} testStepRunId
|
|
233
|
+
* @param {(testRun:TestStepRunEvent|undefined,err:NatsError|Error|null)=>void} handler
|
|
234
|
+
* @param {SubscriptionOptions} options?
|
|
235
|
+
* @returns Subscription
|
|
236
|
+
*/
|
|
237
|
+
SessionClient.prototype.connectTestStepRunEvents = function (testPlanRunId, testStepRunId, handler, options) {
|
|
238
|
+
return this.subscribe("PlanRun.".concat(testPlanRunId, ".StepRun.").concat(testStepRunId), __assign(__assign({}, options), { callback: function (error, encodedMessage) {
|
|
239
|
+
if (error) {
|
|
240
|
+
handler(undefined, error);
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
try {
|
|
244
|
+
var jsonCodec = JSONCodec();
|
|
245
|
+
var testStepRunEventJs = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
246
|
+
var testStepRunEvent = TestStepRunEvent.fromJS(testStepRunEventJs);
|
|
247
|
+
handler(testStepRunEvent, error);
|
|
248
|
+
}
|
|
249
|
+
catch (error) {
|
|
250
|
+
handler(undefined, error);
|
|
251
|
+
}
|
|
252
|
+
} }));
|
|
253
|
+
};
|
|
254
|
+
/**
|
|
255
|
+
* Connect to listen to the test step run parameters for the given test step and test plan run ID
|
|
256
|
+
* @param {string} testPlanRunId
|
|
257
|
+
* @param {string} testStepRunId
|
|
258
|
+
* @param {(event:Parameter[]|undefined,err:NatsError|Error|null)=>void} handler
|
|
259
|
+
* @param {SubscriptionOptions} options?
|
|
260
|
+
* @returns Subscription
|
|
261
|
+
*/
|
|
262
|
+
SessionClient.prototype.connectTestStepRunParameterEvents = function (testPlanRunId, testStepRunId, handler, options) {
|
|
263
|
+
return this.subscribe("PlanRun.".concat(testPlanRunId, ".StepRun.").concat(testStepRunId, ".Parameters"), __assign(__assign({}, options), { callback: function (error, encodedMessage) {
|
|
264
|
+
if (error) {
|
|
265
|
+
handler(undefined, error);
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
try {
|
|
269
|
+
var jsonCodec = JSONCodec();
|
|
270
|
+
var parameterListJs = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
271
|
+
var parameterList = parameterListJs.map(function (parameterJs) { return Parameter.fromJS(parameterJs); });
|
|
272
|
+
handler(parameterList, error);
|
|
273
|
+
}
|
|
274
|
+
catch (error) {
|
|
275
|
+
handler(undefined, error);
|
|
276
|
+
}
|
|
277
|
+
} }));
|
|
278
|
+
};
|
|
279
|
+
/**
|
|
280
|
+
* Connect to listen to the test step run results for the given test step and test plan run ID
|
|
281
|
+
* @param {string} testPlanRunId
|
|
282
|
+
* @param {string} testStepRunId
|
|
283
|
+
* @param {string} resultName
|
|
284
|
+
* @param {(result:Result|undefined,err:NatsError|Error|null)=>void} handler
|
|
285
|
+
* @param {SubscriptionOptions} options?
|
|
286
|
+
* @returns Subscription
|
|
287
|
+
*/
|
|
288
|
+
SessionClient.prototype.connectTestStepRunResults = function (testPlanRunId, testStepRunId, resultName, handler, options) {
|
|
289
|
+
return this.subscribe("PlanRun.".concat(testPlanRunId, ".StepRun.").concat(testStepRunId, ".Result.").concat(resultName), __assign(__assign({}, options), { callback: function (error, encodedMessage) {
|
|
159
290
|
if (error) {
|
|
160
291
|
handler(undefined, error);
|
|
161
292
|
return;
|
|
162
293
|
}
|
|
163
294
|
try {
|
|
164
295
|
var jsonCodec = JSONCodec();
|
|
165
|
-
var
|
|
166
|
-
var result =
|
|
296
|
+
var resultJs = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
297
|
+
var result = Result.fromJS(resultJs);
|
|
167
298
|
handler(result, error);
|
|
168
299
|
}
|
|
169
300
|
catch (error) {
|