@opentap/runner-client 2.5.0-alpha.1.7 → 2.5.0-alpha.1.8
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/DTOs.d.ts +39 -0
- package/lib/DTOs.js +118 -6
- package/lib/SystemClient.d.ts +42 -6
- package/lib/SystemClient.js +57 -6
- package/package.json +1 -1
package/lib/DTOs.d.ts
CHANGED
|
@@ -1168,6 +1168,45 @@ export declare class TestPlanSettingsChangedEventArgs extends SessionEvent imple
|
|
|
1168
1168
|
toJSON(data?: any): any;
|
|
1169
1169
|
}
|
|
1170
1170
|
export declare type ITestPlanSettingsChangedEventArgs = ISessionEvent;
|
|
1171
|
+
export interface ITestStepRunEvent {
|
|
1172
|
+
parent?: string;
|
|
1173
|
+
testStepId?: string;
|
|
1174
|
+
testStepName?: string;
|
|
1175
|
+
testStepTypeName?: string;
|
|
1176
|
+
id?: string;
|
|
1177
|
+
verdict?: number;
|
|
1178
|
+
startTime?: string;
|
|
1179
|
+
parameters?: Parameter[];
|
|
1180
|
+
}
|
|
1181
|
+
export declare class TestStepRunEvent implements ITestStepRunEvent {
|
|
1182
|
+
parent?: string;
|
|
1183
|
+
testStepId?: string;
|
|
1184
|
+
testStepName?: string;
|
|
1185
|
+
testStepTypeName?: string;
|
|
1186
|
+
id?: string;
|
|
1187
|
+
verdict?: number;
|
|
1188
|
+
startTime?: string;
|
|
1189
|
+
parameters?: Parameter[];
|
|
1190
|
+
protected _discriminator: string;
|
|
1191
|
+
constructor(data?: ITestStepRunEvent);
|
|
1192
|
+
init(_data?: any): void;
|
|
1193
|
+
static fromJS(data: any): TestStepRunEvent;
|
|
1194
|
+
toJSON(data?: any): any;
|
|
1195
|
+
}
|
|
1196
|
+
export declare type ITestStepRunStartEventArgs = ITestStepRunEvent;
|
|
1197
|
+
export declare class TestStepRunStartEventArgs extends TestStepRunEvent implements ITestStepRunStartEventArgs {
|
|
1198
|
+
constructor(data?: ITestStepRunStartEventArgs);
|
|
1199
|
+
init(_data?: any): void;
|
|
1200
|
+
static fromJS(data: any): TestStepRunStartEventArgs;
|
|
1201
|
+
toJSON(data?: any): any;
|
|
1202
|
+
}
|
|
1203
|
+
export declare type ITestStepRunCompletedEventArgs = ITestStepRunEvent;
|
|
1204
|
+
export declare class TestStepRunCompletedEventArgs extends TestStepRunEvent implements ITestStepRunCompletedEventArgs {
|
|
1205
|
+
constructor(data?: ITestStepRunCompletedEventArgs);
|
|
1206
|
+
init(_data?: any): void;
|
|
1207
|
+
static fromJS(data: any): TestStepRunCompletedEventArgs;
|
|
1208
|
+
toJSON(data?: any): any;
|
|
1209
|
+
}
|
|
1171
1210
|
export interface ITestPlanRunEvent {
|
|
1172
1211
|
testPlanRunId?: number;
|
|
1173
1212
|
testPlanRunGuid?: string;
|
package/lib/DTOs.js
CHANGED
|
@@ -3392,6 +3392,118 @@ var TestPlanSettingsChangedEventArgs = /** @class */ (function (_super) {
|
|
|
3392
3392
|
return TestPlanSettingsChangedEventArgs;
|
|
3393
3393
|
}(SessionEvent));
|
|
3394
3394
|
export { TestPlanSettingsChangedEventArgs };
|
|
3395
|
+
var TestStepRunEvent = /** @class */ (function () {
|
|
3396
|
+
function TestStepRunEvent(data) {
|
|
3397
|
+
if (data) {
|
|
3398
|
+
for (var property in data) {
|
|
3399
|
+
if (Object.prototype.hasOwnProperty.call(data, property))
|
|
3400
|
+
this[property] = data[property];
|
|
3401
|
+
}
|
|
3402
|
+
}
|
|
3403
|
+
this._discriminator = 'TestStepRunEvent';
|
|
3404
|
+
}
|
|
3405
|
+
TestStepRunEvent.prototype.init = function (_data) {
|
|
3406
|
+
if (_data) {
|
|
3407
|
+
this.parent = _data['Parent'];
|
|
3408
|
+
this.testStepId = _data['TestStepId'];
|
|
3409
|
+
this.testStepName = _data['TestStepName'];
|
|
3410
|
+
this.testStepTypeName = _data['TestStepTypeName'];
|
|
3411
|
+
this.id = _data['Id'];
|
|
3412
|
+
this.verdict = _data['Verdict'];
|
|
3413
|
+
this.startTime = _data['StartTime'];
|
|
3414
|
+
if (Array.isArray(_data['Parameters'])) {
|
|
3415
|
+
this.parameters = [];
|
|
3416
|
+
for (var _i = 0, _a = _data['Parameters']; _i < _a.length; _i++) {
|
|
3417
|
+
var item = _a[_i];
|
|
3418
|
+
this.parameters.push(Parameter.fromJS(item));
|
|
3419
|
+
}
|
|
3420
|
+
}
|
|
3421
|
+
}
|
|
3422
|
+
};
|
|
3423
|
+
TestStepRunEvent.fromJS = function (data) {
|
|
3424
|
+
data = typeof data === 'object' ? data : {};
|
|
3425
|
+
if (data['discriminator'] === 'TestStepRunStartEventArgs') {
|
|
3426
|
+
var result_39 = new TestStepRunStartEventArgs();
|
|
3427
|
+
result_39.init(data);
|
|
3428
|
+
return result_39;
|
|
3429
|
+
}
|
|
3430
|
+
if (data['discriminator'] === 'TestStepRunCompletedEventArgs') {
|
|
3431
|
+
var result_40 = new TestStepRunCompletedEventArgs();
|
|
3432
|
+
result_40.init(data);
|
|
3433
|
+
return result_40;
|
|
3434
|
+
}
|
|
3435
|
+
var result = new TestStepRunEvent();
|
|
3436
|
+
result.init(data);
|
|
3437
|
+
return result;
|
|
3438
|
+
};
|
|
3439
|
+
TestStepRunEvent.prototype.toJSON = function (data) {
|
|
3440
|
+
data['Parent'] = this.parent;
|
|
3441
|
+
data['TestStepId'] = this.testStepId;
|
|
3442
|
+
data['TestStepName'] = this.testStepName;
|
|
3443
|
+
data['TestStepTypeName'] = this.testStepTypeName;
|
|
3444
|
+
data['Id'] = this.id;
|
|
3445
|
+
data['Verdict'] = this.verdict;
|
|
3446
|
+
data['StartTime'] = this.startTime;
|
|
3447
|
+
if (Array.isArray(this.parameters)) {
|
|
3448
|
+
data['Parameters'] = [];
|
|
3449
|
+
for (var _i = 0, _a = this.parameters; _i < _a.length; _i++) {
|
|
3450
|
+
var item = _a[_i];
|
|
3451
|
+
data['Parameters'].push(item.toJSON());
|
|
3452
|
+
}
|
|
3453
|
+
}
|
|
3454
|
+
return data;
|
|
3455
|
+
};
|
|
3456
|
+
return TestStepRunEvent;
|
|
3457
|
+
}());
|
|
3458
|
+
export { TestStepRunEvent };
|
|
3459
|
+
var TestStepRunStartEventArgs = /** @class */ (function (_super) {
|
|
3460
|
+
__extends(TestStepRunStartEventArgs, _super);
|
|
3461
|
+
function TestStepRunStartEventArgs(data) {
|
|
3462
|
+
var _this = _super.call(this, data) || this;
|
|
3463
|
+
_this._discriminator = 'TestStepRunStartEventArgs';
|
|
3464
|
+
return _this;
|
|
3465
|
+
}
|
|
3466
|
+
TestStepRunStartEventArgs.prototype.init = function (_data) {
|
|
3467
|
+
_super.prototype.init.call(this, _data);
|
|
3468
|
+
};
|
|
3469
|
+
TestStepRunStartEventArgs.fromJS = function (data) {
|
|
3470
|
+
data = typeof data === 'object' ? data : {};
|
|
3471
|
+
var result = new TestStepRunStartEventArgs();
|
|
3472
|
+
result.init(data);
|
|
3473
|
+
return result;
|
|
3474
|
+
};
|
|
3475
|
+
TestStepRunStartEventArgs.prototype.toJSON = function (data) {
|
|
3476
|
+
data = typeof data === 'object' ? data : {};
|
|
3477
|
+
_super.prototype.toJSON.call(this, data);
|
|
3478
|
+
return data;
|
|
3479
|
+
};
|
|
3480
|
+
return TestStepRunStartEventArgs;
|
|
3481
|
+
}(TestStepRunEvent));
|
|
3482
|
+
export { TestStepRunStartEventArgs };
|
|
3483
|
+
var TestStepRunCompletedEventArgs = /** @class */ (function (_super) {
|
|
3484
|
+
__extends(TestStepRunCompletedEventArgs, _super);
|
|
3485
|
+
function TestStepRunCompletedEventArgs(data) {
|
|
3486
|
+
var _this = _super.call(this, data) || this;
|
|
3487
|
+
_this._discriminator = 'TestStepRunCompletedEventArgs';
|
|
3488
|
+
return _this;
|
|
3489
|
+
}
|
|
3490
|
+
TestStepRunCompletedEventArgs.prototype.init = function (_data) {
|
|
3491
|
+
_super.prototype.init.call(this, _data);
|
|
3492
|
+
};
|
|
3493
|
+
TestStepRunCompletedEventArgs.fromJS = function (data) {
|
|
3494
|
+
data = typeof data === 'object' ? data : {};
|
|
3495
|
+
var result = new TestStepRunCompletedEventArgs();
|
|
3496
|
+
result.init(data);
|
|
3497
|
+
return result;
|
|
3498
|
+
};
|
|
3499
|
+
TestStepRunCompletedEventArgs.prototype.toJSON = function (data) {
|
|
3500
|
+
data = typeof data === 'object' ? data : {};
|
|
3501
|
+
_super.prototype.toJSON.call(this, data);
|
|
3502
|
+
return data;
|
|
3503
|
+
};
|
|
3504
|
+
return TestStepRunCompletedEventArgs;
|
|
3505
|
+
}(TestStepRunEvent));
|
|
3506
|
+
export { TestStepRunCompletedEventArgs };
|
|
3395
3507
|
var TestPlanRunEvent = /** @class */ (function () {
|
|
3396
3508
|
function TestPlanRunEvent(data) {
|
|
3397
3509
|
if (data) {
|
|
@@ -3419,14 +3531,14 @@ var TestPlanRunEvent = /** @class */ (function () {
|
|
|
3419
3531
|
TestPlanRunEvent.fromJS = function (data) {
|
|
3420
3532
|
data = typeof data === 'object' ? data : {};
|
|
3421
3533
|
if (data['discriminator'] === 'TestPlanRunStartEventArgs') {
|
|
3422
|
-
var
|
|
3423
|
-
|
|
3424
|
-
return
|
|
3534
|
+
var result_41 = new TestPlanRunStartEventArgs();
|
|
3535
|
+
result_41.init(data);
|
|
3536
|
+
return result_41;
|
|
3425
3537
|
}
|
|
3426
3538
|
if (data['discriminator'] === 'TestPlanRunCompletedEventArgs') {
|
|
3427
|
-
var
|
|
3428
|
-
|
|
3429
|
-
return
|
|
3539
|
+
var result_42 = new TestPlanRunCompletedEventArgs();
|
|
3540
|
+
result_42.init(data);
|
|
3541
|
+
return result_42;
|
|
3430
3542
|
}
|
|
3431
3543
|
var result = new TestPlanRunEvent();
|
|
3432
3544
|
result.init(data);
|
package/lib/SystemClient.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseClient } from './BaseClient';
|
|
2
2
|
import { ConnectionOptions, Subscription, SubscriptionOptions } from 'nats.ws';
|
|
3
|
-
import { ErrorResponse,
|
|
3
|
+
import { ErrorResponse, TestPlanRunCompletedEventArgs, TestPlanRunStartEventArgs, TestStepRunCompletedEventArgs, TestStepRunStartEventArgs } from './DTOs';
|
|
4
4
|
export interface RunnerLifetimeEvent {
|
|
5
5
|
RunnerId: string;
|
|
6
6
|
Subject: string;
|
|
@@ -16,11 +16,47 @@ export declare class SystemClient extends BaseClient {
|
|
|
16
16
|
*/
|
|
17
17
|
subscribeLifetimeEventListener(listener: (error: ErrorResponse | null, message: RunnerLifetimeEvent | null) => void, options?: SubscriptionOptions): Subscription;
|
|
18
18
|
/**
|
|
19
|
-
* Subscribe to the
|
|
20
|
-
*
|
|
21
|
-
* @param
|
|
22
|
-
* @
|
|
19
|
+
* Subscribe to the test step run start events for the given Runner and Run ID.
|
|
20
|
+
* Wildcard can be used for the Runner or Run ID to receive all test step run start events.
|
|
21
|
+
* @param {string} runnerId
|
|
22
|
+
* @param {string} runId
|
|
23
|
+
* @param {(error:ErrorResponse|null,message:TestStepRunStartEventArgs|null)=>void} listener
|
|
24
|
+
* @param {SubscriptionOptions} options?
|
|
25
|
+
*/
|
|
26
|
+
subscribeTestStepRunStartEventListener(runnerId: string, runId: string, listener: (error: ErrorResponse | null, message: TestStepRunStartEventArgs | null) => void, options?: SubscriptionOptions): Subscription;
|
|
27
|
+
/**
|
|
28
|
+
* Subscribe to the test step run completed events for the given Runner and Run ID.
|
|
29
|
+
* Wildcard can be used for the Runner or Run ID to receive all test step run completed events.
|
|
30
|
+
* @param {string} runnerId
|
|
31
|
+
* @param {string} runId
|
|
32
|
+
* @param {(error:ErrorResponse|null,message:TestStepRunStartEventArgs|null)=>void} listener
|
|
33
|
+
* @param {SubscriptionOptions} options?
|
|
34
|
+
*/
|
|
35
|
+
subscribeTestStepRunCompletedEventListener(runnerId: string, runId: string, listener: (error: ErrorResponse | null, message: TestStepRunCompletedEventArgs | null) => void, options?: SubscriptionOptions): Subscription;
|
|
36
|
+
/**
|
|
37
|
+
* Subscribe to the test plan run start events for the given Runner and Run ID.
|
|
38
|
+
* Wildcard can be used for the Runner or Run ID to receive all test plan run start events.
|
|
39
|
+
* @param {string} runnerId
|
|
40
|
+
* @param {string} runId
|
|
41
|
+
* @param {(error:ErrorResponse|null,message:TestStepRunStartEventArgs|null)=>void} listener
|
|
42
|
+
* @param {SubscriptionOptions} options?
|
|
43
|
+
*/
|
|
44
|
+
subscribeTestPlanRunStartEventListener(runnerId: string, runId: string, listener: (error: ErrorResponse | null, message: TestPlanRunStartEventArgs | null) => void, options?: SubscriptionOptions): Subscription;
|
|
45
|
+
/**
|
|
46
|
+
* Subscribe to the test plan run completed events for the given Runner and Run ID.
|
|
47
|
+
* Wildcard can be used for the Runner or Run ID to receive all test plan run completed events.
|
|
48
|
+
* @param {string} runnerId
|
|
49
|
+
* @param {string} runId
|
|
50
|
+
* @param {(error:ErrorResponse|null,message:TestStepRunStartEventArgs|null)=>void} listener
|
|
51
|
+
* @param {SubscriptionOptions} options?
|
|
52
|
+
*/
|
|
53
|
+
subscribeTestPlanRunCompletedEventListener(runnerId: string, runId: string, listener: (error: ErrorResponse | null, message: TestPlanRunCompletedEventArgs | null) => void, options?: SubscriptionOptions): Subscription;
|
|
54
|
+
/**
|
|
55
|
+
* Parses the NATS message to the given template. If the NATS sends an error, it parses the error
|
|
56
|
+
* in the generic NATS error handler.
|
|
57
|
+
* @param {string} subject
|
|
58
|
+
* @param {NatsError|null} error
|
|
59
|
+
* @param {Msg} message
|
|
23
60
|
*/
|
|
24
|
-
subscribeTestPlanRunStartedEventListener(runnerId: string, runId: string, eventName: string, listener: (error: ErrorResponse | null, message: ISessionEvent | null) => void, options?: SubscriptionOptions): Subscription;
|
|
25
61
|
private parseCallbackArguments;
|
|
26
62
|
}
|
package/lib/SystemClient.js
CHANGED
|
@@ -44,17 +44,68 @@ var SystemClient = /** @class */ (function (_super) {
|
|
|
44
44
|
} }));
|
|
45
45
|
};
|
|
46
46
|
/**
|
|
47
|
-
* Subscribe to the
|
|
48
|
-
*
|
|
49
|
-
* @param
|
|
50
|
-
* @
|
|
47
|
+
* Subscribe to the test step run start events for the given Runner and Run ID.
|
|
48
|
+
* Wildcard can be used for the Runner or Run ID to receive all test step run start events.
|
|
49
|
+
* @param {string} runnerId
|
|
50
|
+
* @param {string} runId
|
|
51
|
+
* @param {(error:ErrorResponse|null,message:TestStepRunStartEventArgs|null)=>void} listener
|
|
52
|
+
* @param {SubscriptionOptions} options?
|
|
53
|
+
*/
|
|
54
|
+
SystemClient.prototype.subscribeTestStepRunStartEventListener = function (runnerId, runId, listener, options) {
|
|
55
|
+
var _this = this;
|
|
56
|
+
return this.subscribe("".concat(runnerId, ".Runs.").concat(runId, ".Events.TestStepRunStart"), __assign(__assign({}, options), { callback: function (error, message) {
|
|
57
|
+
listener.apply(void 0, _this.parseCallbackArguments('*.Events.Lifetime', error, message));
|
|
58
|
+
} }));
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Subscribe to the test step run completed events for the given Runner and Run ID.
|
|
62
|
+
* Wildcard can be used for the Runner or Run ID to receive all test step run completed events.
|
|
63
|
+
* @param {string} runnerId
|
|
64
|
+
* @param {string} runId
|
|
65
|
+
* @param {(error:ErrorResponse|null,message:TestStepRunStartEventArgs|null)=>void} listener
|
|
66
|
+
* @param {SubscriptionOptions} options?
|
|
67
|
+
*/
|
|
68
|
+
SystemClient.prototype.subscribeTestStepRunCompletedEventListener = function (runnerId, runId, listener, options) {
|
|
69
|
+
var _this = this;
|
|
70
|
+
return this.subscribe("".concat(runnerId, ".Runs.").concat(runId, ".Events.TestStepRunCompleted"), __assign(__assign({}, options), { callback: function (error, message) {
|
|
71
|
+
listener.apply(void 0, _this.parseCallbackArguments('*.Events.Lifetime', error, message));
|
|
72
|
+
} }));
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Subscribe to the test plan run start events for the given Runner and Run ID.
|
|
76
|
+
* Wildcard can be used for the Runner or Run ID to receive all test plan run start events.
|
|
77
|
+
* @param {string} runnerId
|
|
78
|
+
* @param {string} runId
|
|
79
|
+
* @param {(error:ErrorResponse|null,message:TestStepRunStartEventArgs|null)=>void} listener
|
|
80
|
+
* @param {SubscriptionOptions} options?
|
|
81
|
+
*/
|
|
82
|
+
SystemClient.prototype.subscribeTestPlanRunStartEventListener = function (runnerId, runId, listener, options) {
|
|
83
|
+
var _this = this;
|
|
84
|
+
return this.subscribe("".concat(runnerId, ".Runs.").concat(runId, ".Events.TestPlanRunStart"), __assign(__assign({}, options), { callback: function (error, message) {
|
|
85
|
+
listener.apply(void 0, _this.parseCallbackArguments('*.Events.Lifetime', error, message));
|
|
86
|
+
} }));
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Subscribe to the test plan run completed events for the given Runner and Run ID.
|
|
90
|
+
* Wildcard can be used for the Runner or Run ID to receive all test plan run completed events.
|
|
91
|
+
* @param {string} runnerId
|
|
92
|
+
* @param {string} runId
|
|
93
|
+
* @param {(error:ErrorResponse|null,message:TestStepRunStartEventArgs|null)=>void} listener
|
|
94
|
+
* @param {SubscriptionOptions} options?
|
|
51
95
|
*/
|
|
52
|
-
SystemClient.prototype.
|
|
96
|
+
SystemClient.prototype.subscribeTestPlanRunCompletedEventListener = function (runnerId, runId, listener, options) {
|
|
53
97
|
var _this = this;
|
|
54
|
-
return this.subscribe("".concat(runnerId, ".Runs.").concat(runId, ".Events.")
|
|
98
|
+
return this.subscribe("".concat(runnerId, ".Runs.").concat(runId, ".Events.TestPlanRunCompleted"), __assign(__assign({}, options), { callback: function (error, message) {
|
|
55
99
|
listener.apply(void 0, _this.parseCallbackArguments('*.Events.Lifetime', error, message));
|
|
56
100
|
} }));
|
|
57
101
|
};
|
|
102
|
+
/**
|
|
103
|
+
* Parses the NATS message to the given template. If the NATS sends an error, it parses the error
|
|
104
|
+
* in the generic NATS error handler.
|
|
105
|
+
* @param {string} subject
|
|
106
|
+
* @param {NatsError|null} error
|
|
107
|
+
* @param {Msg} message
|
|
108
|
+
*/
|
|
58
109
|
SystemClient.prototype.parseCallbackArguments = function (subject, error, message) {
|
|
59
110
|
if (error) {
|
|
60
111
|
return [this.natsErrorHandler(error, subject), null];
|