@opentap/runner-client 2.36.0 → 2.37.0-alpha.1.2.18220225540
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/dist/cjs/DTOs.d.ts +4 -20
- package/dist/cjs/DTOs.js +30 -53
- package/dist/cjs/SessionClient.d.ts +3 -33
- package/dist/cjs/SessionClient.js +13 -118
- package/dist/mjs/DTOs.d.ts +4 -20
- package/dist/mjs/DTOs.js +20 -45
- package/dist/mjs/SessionClient.d.ts +3 -33
- package/dist/mjs/SessionClient.js +14 -119
- package/package.json +1 -1
package/dist/cjs/DTOs.d.ts
CHANGED
|
@@ -1021,26 +1021,6 @@ export interface IWatchDog {
|
|
|
1021
1021
|
terminationTimeout?: number;
|
|
1022
1022
|
}
|
|
1023
1023
|
export declare type IComponentSettingsIdentifier = IComponentSettingsBase;
|
|
1024
|
-
export declare class TestRun implements ITestRun {
|
|
1025
|
-
status?: string | undefined;
|
|
1026
|
-
id?: string | undefined;
|
|
1027
|
-
verdict?: string | undefined;
|
|
1028
|
-
duration?: string | undefined;
|
|
1029
|
-
parameters?: Parameter[] | undefined;
|
|
1030
|
-
testStepRun?: TestStepRun | undefined;
|
|
1031
|
-
constructor(data?: ITestRun);
|
|
1032
|
-
init(_data?: any): void;
|
|
1033
|
-
static fromJS(data: any): TestRun;
|
|
1034
|
-
toJSON(data?: any): any;
|
|
1035
|
-
}
|
|
1036
|
-
export interface ITestRun {
|
|
1037
|
-
status?: string | undefined;
|
|
1038
|
-
id?: string | undefined;
|
|
1039
|
-
verdict?: string | undefined;
|
|
1040
|
-
duration?: string | undefined;
|
|
1041
|
-
parameters?: Parameter[] | undefined;
|
|
1042
|
-
testStepRun?: TestStepRun | undefined;
|
|
1043
|
-
}
|
|
1044
1024
|
export declare class TestStepRun implements ITestStepRun {
|
|
1045
1025
|
parentId?: string | undefined;
|
|
1046
1026
|
testStepId?: string | undefined;
|
|
@@ -1346,10 +1326,12 @@ export interface IMetricsConfigurationChangedEventArgs extends ISessionEvent {
|
|
|
1346
1326
|
export interface IOnTestPlanRun {
|
|
1347
1327
|
status?: string;
|
|
1348
1328
|
userId?: string;
|
|
1329
|
+
parameters?: Parameter[];
|
|
1349
1330
|
}
|
|
1350
1331
|
export declare class OnTestPlanRun implements IOnTestPlanRun {
|
|
1351
1332
|
status?: string;
|
|
1352
1333
|
userId?: string;
|
|
1334
|
+
parameters?: Parameter[];
|
|
1353
1335
|
constructor(data?: IOnTestPlanRun);
|
|
1354
1336
|
init(_data?: any): void;
|
|
1355
1337
|
static fromJS(data: any): OnTestPlanRun;
|
|
@@ -1361,6 +1343,7 @@ export interface IOnTestStepRun {
|
|
|
1361
1343
|
parentRunId?: string;
|
|
1362
1344
|
verdict?: string;
|
|
1363
1345
|
duration?: string;
|
|
1346
|
+
parameters?: Parameter[];
|
|
1364
1347
|
}
|
|
1365
1348
|
export declare class OnTestStepRun implements IOnTestStepRun {
|
|
1366
1349
|
status?: string;
|
|
@@ -1368,6 +1351,7 @@ export declare class OnTestStepRun implements IOnTestStepRun {
|
|
|
1368
1351
|
parentRunId?: string;
|
|
1369
1352
|
verdict?: string;
|
|
1370
1353
|
duration?: string;
|
|
1354
|
+
parameters?: Parameter[];
|
|
1371
1355
|
constructor(data?: IOnTestStepRun);
|
|
1372
1356
|
init(_data?: any): void;
|
|
1373
1357
|
static fromJS(data: any): OnTestStepRun;
|
package/dist/cjs/DTOs.js
CHANGED
|
@@ -16,8 +16,8 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
16
16
|
})();
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.SessionStartInitiated = exports.SessionEventArgs = exports.SettingsTapPackage = exports.RepositorySettingsPackageDefinition = exports.RepositoryPackageDefinition = exports.RepositoryPackageReference = exports.ProfileGroup = exports.ListItemType = exports.ComponentSettings = exports.FileDescriptor = exports.Resource = exports.PluginTypeSelectorControl = exports.PictureControl = exports.PasswordControl = exports.MultiSelectControl = exports.DropdownControl = exports.EnabledControl = exports.DirectoryPathControl = exports.FilePathControl = exports.ComboBoxControl = exports.TextBoxControl = exports.DataGridControl = exports.DataGridReferenceControl = exports.CheckBoxControl = exports.AvailableValue = exports.ButtonsControl = exports.ButtonControl = exports.ExternalParameter = exports.MetaData = exports.DisplayAttribute = exports.VisualStatus = exports.UnitAttribute = exports.Icon = exports.ColumnDisplayName = exports.LayoutMode = exports.Layout = exports.Setting = exports.ComponentSettingsListItem = exports.AnnotatedObject = exports.ComponentSettingsList = exports.DisplayMode = exports.ComponentSettingsIdentifier = exports.ComponentSettingsBase = exports.Links = exports.Session = exports.ImageResolveErrorResponse = exports.NoResponderError = exports.ErrorResponse = exports.PackageSpecifier = exports.Image = void 0;
|
|
19
|
-
exports.TestPlanExecutionStateChangedEventArgs = exports.TestPlanChangeEventArgs = exports.StoppedEventArgs = exports.StoppingEventArgs = exports.StartedEventArgs = exports.StartingEventArgs = exports.SessionTimeoutEventArgs = exports.SessionEventType = exports.SessionEvent = exports.MetricValue = exports.MetricsConfiguration = exports.SessionMetricInfo = exports.MetricsPollRate = exports.SessionMetricType = exports.SessionMetricKind = exports.ResultColumn = exports.Result = exports.LogEvent = exports.TestStepRun = exports.
|
|
20
|
-
exports.RunnerStatus = exports.StreamInfoStatus = exports.RemoteConnection = exports.SaveDefaultSettings = exports.AssetUpdatedEvent = exports.MetadataUpdatedEvent = exports.RunnerDeletedEvent = exports.RunnerUpdatedEvent = exports.RunnerRegisteredEvent = exports.RunnerEvent = exports.TestPlanRunCompletedEventArgs = exports.TestPlanRunStartEventArgs = exports.TestPlanRunEvent = exports.TestStepRunCompletedEventArgs = exports.TestStepRunStartEventArgs = exports.TestStepRunEvent = exports.OnTestStepRun = exports.OnTestPlanRun = exports.MetricsConfigurationChangedEventArgs = exports.HeartbeatEventArgs = exports.TestPlanSettingsChangedEventArgs = exports.UserInputRequestCompletedEventArgs = exports.UserInputRequestEventArgs = exports.BreakEventArgs = exports.TestStepChangeEventArgs =
|
|
19
|
+
exports.SettingsChangedEventArgs = exports.TestPlanExecutionStateChangedEventArgs = exports.TestPlanChangeEventArgs = exports.StoppedEventArgs = exports.StoppingEventArgs = exports.StartedEventArgs = exports.StartingEventArgs = exports.SessionTimeoutEventArgs = exports.SessionEventType = exports.SessionEvent = exports.MetricValue = exports.MetricsConfiguration = exports.SessionMetricInfo = exports.MetricsPollRate = exports.SessionMetricType = exports.SessionMetricKind = exports.ResultColumn = exports.Result = exports.LogEvent = exports.TestStepRun = exports.WatchDog = exports.Parameter = exports.BreakPoints = exports.InstalledFile = exports.Interaction = exports.CommonContext = exports.CommonSettings = exports.ValidationError = exports.TestStepValidationError = exports.TestStepCopy = exports.TestStepType = exports.TestStep = exports.TestPlan = exports.ExecutionState = exports.Verdict = exports.RunStatus = exports.MissingLicenseResponse = exports.LogEntry = exports.LogList = exports.ApiException = exports.ImageCreationFailed = exports.ImageCreated = exports.ImageCreating = exports.ImageEventArgs = exports.SessionInactivityLimitHit = exports.SessionShutdownFailed = exports.SessionShutdown = exports.SessionShutdownInitiated = exports.SessionStartFailed = exports.SessionStarted = void 0;
|
|
20
|
+
exports.RunnerStatus = exports.StreamInfoStatus = exports.RemoteConnection = exports.SaveDefaultSettings = exports.AssetUpdatedEvent = exports.MetadataUpdatedEvent = exports.RunnerDeletedEvent = exports.RunnerUpdatedEvent = exports.RunnerRegisteredEvent = exports.RunnerEvent = exports.TestPlanRunCompletedEventArgs = exports.TestPlanRunStartEventArgs = exports.TestPlanRunEvent = exports.TestStepRunCompletedEventArgs = exports.TestStepRunStartEventArgs = exports.TestStepRunEvent = exports.OnTestStepRun = exports.OnTestPlanRun = exports.MetricsConfigurationChangedEventArgs = exports.HeartbeatEventArgs = exports.TestPlanSettingsChangedEventArgs = exports.UserInputRequestCompletedEventArgs = exports.UserInputRequestEventArgs = exports.BreakEventArgs = exports.TestStepChangeEventArgs = void 0;
|
|
21
21
|
var Image = /** @class */ (function () {
|
|
22
22
|
function Image(data) {
|
|
23
23
|
this.packages = [];
|
|
@@ -2912,56 +2912,6 @@ var WatchDog = /** @class */ (function () {
|
|
|
2912
2912
|
return WatchDog;
|
|
2913
2913
|
}());
|
|
2914
2914
|
exports.WatchDog = WatchDog;
|
|
2915
|
-
var TestRun = /** @class */ (function () {
|
|
2916
|
-
function TestRun(data) {
|
|
2917
|
-
if (data) {
|
|
2918
|
-
for (var property in data) {
|
|
2919
|
-
if (Object.prototype.hasOwnProperty.call(data, property))
|
|
2920
|
-
this[property] = data[property];
|
|
2921
|
-
}
|
|
2922
|
-
}
|
|
2923
|
-
}
|
|
2924
|
-
TestRun.prototype.init = function (_data) {
|
|
2925
|
-
if (_data) {
|
|
2926
|
-
this.status = _data['Status'];
|
|
2927
|
-
this.id = _data['Id'];
|
|
2928
|
-
this.verdict = _data['Verdict'];
|
|
2929
|
-
this.duration = _data['Duration'];
|
|
2930
|
-
if (Array.isArray(_data['Parameters'])) {
|
|
2931
|
-
this.parameters = [];
|
|
2932
|
-
for (var _i = 0, _a = _data['Parameters']; _i < _a.length; _i++) {
|
|
2933
|
-
var item = _a[_i];
|
|
2934
|
-
this.parameters.push(Parameter.fromJS(item));
|
|
2935
|
-
}
|
|
2936
|
-
}
|
|
2937
|
-
this.testStepRun = _data['TestStepRun'] ? TestStepRun.fromJS(_data['TestStepRun']) : undefined;
|
|
2938
|
-
}
|
|
2939
|
-
};
|
|
2940
|
-
TestRun.fromJS = function (data) {
|
|
2941
|
-
data = typeof data === 'object' ? data : {};
|
|
2942
|
-
var result = new TestRun();
|
|
2943
|
-
result.init(data);
|
|
2944
|
-
return result;
|
|
2945
|
-
};
|
|
2946
|
-
TestRun.prototype.toJSON = function (data) {
|
|
2947
|
-
data = typeof data === 'object' ? data : {};
|
|
2948
|
-
data['Status'] = this.status;
|
|
2949
|
-
data['Id'] = this.id;
|
|
2950
|
-
data['Verdict'] = this.verdict;
|
|
2951
|
-
data['Duration'] = this.duration;
|
|
2952
|
-
if (Array.isArray(this.parameters)) {
|
|
2953
|
-
data['Parameters'] = [];
|
|
2954
|
-
for (var _i = 0, _a = this.parameters; _i < _a.length; _i++) {
|
|
2955
|
-
var item = _a[_i];
|
|
2956
|
-
data['Parameters'].push(item.toJSON());
|
|
2957
|
-
}
|
|
2958
|
-
}
|
|
2959
|
-
data['TestStepRun'] = this.testStepRun ? this.testStepRun.toJSON() : undefined;
|
|
2960
|
-
return data;
|
|
2961
|
-
};
|
|
2962
|
-
return TestRun;
|
|
2963
|
-
}());
|
|
2964
|
-
exports.TestRun = TestRun;
|
|
2965
2915
|
var TestStepRun = /** @class */ (function () {
|
|
2966
2916
|
function TestStepRun(data) {
|
|
2967
2917
|
if (data) {
|
|
@@ -3777,6 +3727,13 @@ var OnTestPlanRun = /** @class */ (function () {
|
|
|
3777
3727
|
if (_data) {
|
|
3778
3728
|
this.status = _data['Status'];
|
|
3779
3729
|
this.userId = _data['UserId'];
|
|
3730
|
+
if (Array.isArray(_data['Parameters'])) {
|
|
3731
|
+
this.parameters = [];
|
|
3732
|
+
for (var _i = 0, _a = _data['Parameters']; _i < _a.length; _i++) {
|
|
3733
|
+
var item = _a[_i];
|
|
3734
|
+
this.parameters.push(Parameter.fromJS(item));
|
|
3735
|
+
}
|
|
3736
|
+
}
|
|
3780
3737
|
}
|
|
3781
3738
|
};
|
|
3782
3739
|
OnTestPlanRun.fromJS = function (data) {
|
|
@@ -3786,9 +3743,15 @@ var OnTestPlanRun = /** @class */ (function () {
|
|
|
3786
3743
|
return result;
|
|
3787
3744
|
};
|
|
3788
3745
|
OnTestPlanRun.prototype.toJSON = function (data) {
|
|
3789
|
-
data = typeof data === 'object' ? data : {};
|
|
3790
3746
|
data['Status'] = this.status;
|
|
3791
3747
|
data['UserId'] = this.userId;
|
|
3748
|
+
if (Array.isArray(this.parameters)) {
|
|
3749
|
+
data['Parameters'] = [];
|
|
3750
|
+
for (var _i = 0, _a = this.parameters; _i < _a.length; _i++) {
|
|
3751
|
+
var item = _a[_i];
|
|
3752
|
+
data['Parameters'].push(item.toJSON());
|
|
3753
|
+
}
|
|
3754
|
+
}
|
|
3792
3755
|
return data;
|
|
3793
3756
|
};
|
|
3794
3757
|
return OnTestPlanRun;
|
|
@@ -3810,6 +3773,13 @@ var OnTestStepRun = /** @class */ (function () {
|
|
|
3810
3773
|
this.parentRunId = _data['ParentRunId'];
|
|
3811
3774
|
this.verdict = _data['Verdict'];
|
|
3812
3775
|
this.duration = _data['Duration'];
|
|
3776
|
+
if (Array.isArray(_data['Parameters'])) {
|
|
3777
|
+
this.parameters = [];
|
|
3778
|
+
for (var _i = 0, _a = _data['Parameters']; _i < _a.length; _i++) {
|
|
3779
|
+
var item = _a[_i];
|
|
3780
|
+
this.parameters.push(Parameter.fromJS(item));
|
|
3781
|
+
}
|
|
3782
|
+
}
|
|
3813
3783
|
}
|
|
3814
3784
|
};
|
|
3815
3785
|
OnTestStepRun.fromJS = function (data) {
|
|
@@ -3825,6 +3795,13 @@ var OnTestStepRun = /** @class */ (function () {
|
|
|
3825
3795
|
data['ParentRunId'] = this.parentRunId;
|
|
3826
3796
|
data['Verdict'] = this.verdict;
|
|
3827
3797
|
data['Duration'] = this.duration;
|
|
3798
|
+
if (Array.isArray(this.parameters)) {
|
|
3799
|
+
data['Parameters'] = [];
|
|
3800
|
+
for (var _i = 0, _a = this.parameters; _i < _a.length; _i++) {
|
|
3801
|
+
var item = _a[_i];
|
|
3802
|
+
data['Parameters'].push(item.toJSON());
|
|
3803
|
+
}
|
|
3804
|
+
}
|
|
3828
3805
|
return data;
|
|
3829
3806
|
};
|
|
3830
3807
|
return OnTestStepRun;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BreakPoints, CommonContext, CommonSettings, DataGridControl, IMetricsConfiguration, Image, Interaction, ListItemType, LogList, MetricsConfiguration, OnTestPlanRun, OnTestStepRun, Parameter, RepositoryPackageDefinition, RepositoryPackageReference, Resource, Result, RunStatus, SessionEvent, Setting, TestPlan,
|
|
1
|
+
import { BreakPoints, CommonContext, CommonSettings, DataGridControl, IMetricsConfiguration, Image, Interaction, ListItemType, LogList, MetricsConfiguration, OnTestPlanRun, OnTestStepRun, Parameter, RepositoryPackageDefinition, RepositoryPackageReference, Resource, Result, RunStatus, SessionEvent, Setting, TestPlan, TestStepType, TestStepValidationError, WatchDog } 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,19 +24,6 @@ export declare class SessionClient extends BaseClient {
|
|
|
24
24
|
* @returns Subscription object
|
|
25
25
|
*/
|
|
26
26
|
connectSessionEvents(eventHandler: (sessionEvent: SessionEvent | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): void;
|
|
27
|
-
/**
|
|
28
|
-
* @param resultHandler Function to be called when result or error is received
|
|
29
|
-
* @param testRunHandler Function to be called when test run or error is received
|
|
30
|
-
* @param options (optional) Subscription options
|
|
31
|
-
* @returns Subscription array: Result and Test Run subscriptions
|
|
32
|
-
*/
|
|
33
|
-
connectSessionResults(resultHandler: (result: Result | undefined, err: NatsError | Error | null) => void, testRunHandler: (testRun: TestRun | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): [Subscription, Subscription];
|
|
34
|
-
/**
|
|
35
|
-
* @param testRunHandler Function to be called when test run or error is received
|
|
36
|
-
* @param options (optional) Subscription options
|
|
37
|
-
* @returns Subscription array: Result and Test Run subscriptions
|
|
38
|
-
*/
|
|
39
|
-
connectTestRunEvents(testRunHandler: (testRun: TestRun | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
40
27
|
/**
|
|
41
28
|
* Connect to listen to the TestPlanRun events for the given test plan run ID.
|
|
42
29
|
* @param {string} testPlanRunId
|
|
@@ -44,7 +31,7 @@ export declare class SessionClient extends BaseClient {
|
|
|
44
31
|
* @param {SubscriptionOptions} options?
|
|
45
32
|
* @returns Subscription
|
|
46
33
|
*/
|
|
47
|
-
connectTestPlanRunEvents(testPlanRunId: string, handler: (event: OnTestPlanRun | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
34
|
+
connectTestPlanRunEvents(testPlanRunId: string, handler: (planRunId: string | undefined, event: OnTestPlanRun | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
48
35
|
/**
|
|
49
36
|
* Connect to listen to the test plan run logs for the given test plan run ID
|
|
50
37
|
* @param {string} testPlanRunId
|
|
@@ -53,14 +40,6 @@ export declare class SessionClient extends BaseClient {
|
|
|
53
40
|
* @returns Subscription
|
|
54
41
|
*/
|
|
55
42
|
connectTestPlanRunLogs(testPlanRunId: string, handler: (logList: LogList | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
56
|
-
/**
|
|
57
|
-
* Connect to listen to the test plan run parameter events for the given test plan run ID
|
|
58
|
-
* @param {string} testPlanRunId
|
|
59
|
-
* @param {(event:Parameter[]|undefined,err:NatsError|Error|null)=>void} handler
|
|
60
|
-
* @param {SubscriptionOptions} options?
|
|
61
|
-
* @returns Subscription
|
|
62
|
-
*/
|
|
63
|
-
connectTestPlanRunParameterEvents(testPlanRunId: string, handler: (event: Parameter[] | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
64
43
|
/**
|
|
65
44
|
* Connect to listen to the test step run events for the given test step and test plan run ID
|
|
66
45
|
* @param {string} testPlanRunId
|
|
@@ -69,16 +48,7 @@ export declare class SessionClient extends BaseClient {
|
|
|
69
48
|
* @param {SubscriptionOptions} options?
|
|
70
49
|
* @returns Subscription
|
|
71
50
|
*/
|
|
72
|
-
connectTestStepRunEvents(testPlanRunId: string, testStepRunId: string, handler: (
|
|
73
|
-
/**
|
|
74
|
-
* Connect to listen to the test step run parameters for the given test step and test plan run ID
|
|
75
|
-
* @param {string} testPlanRunId
|
|
76
|
-
* @param {string} testStepRunId
|
|
77
|
-
* @param {(event:Parameter[]|undefined,err:NatsError|Error|null)=>void} handler
|
|
78
|
-
* @param {SubscriptionOptions} options?
|
|
79
|
-
* @returns Subscription
|
|
80
|
-
*/
|
|
81
|
-
connectTestStepRunParameterEvents(testPlanRunId: string, testStepRunId: string, handler: (event: Parameter[] | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
51
|
+
connectTestStepRunEvents(testPlanRunId: string, testStepRunId: string, handler: (planRunId: string | undefined, stepRunId: string | undefined, testRun: OnTestStepRun | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
82
52
|
/**
|
|
83
53
|
* Connect to listen to the test step run results for the given test step and test plan run ID
|
|
84
54
|
* @param {string} testPlanRunId
|
|
@@ -103,68 +103,6 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
103
103
|
this.subscriptions.push(this.subscribe('Events', __assign(__assign({}, options), { callback: callback })));
|
|
104
104
|
this.subscriptions.push(this.subscribe('Events.*', __assign(__assign({}, options), { callback: callback })));
|
|
105
105
|
};
|
|
106
|
-
/**
|
|
107
|
-
* @param resultHandler Function to be called when result or error is received
|
|
108
|
-
* @param testRunHandler Function to be called when test run or error is received
|
|
109
|
-
* @param options (optional) Subscription options
|
|
110
|
-
* @returns Subscription array: Result and Test Run subscriptions
|
|
111
|
-
*/
|
|
112
|
-
SessionClient.prototype.connectSessionResults = function (resultHandler, testRunHandler, options) {
|
|
113
|
-
return [
|
|
114
|
-
this.subscribe('OnResult', __assign(__assign({}, options), { callback: function (error, encodedMessage) {
|
|
115
|
-
if (error) {
|
|
116
|
-
resultHandler(undefined, error);
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
try {
|
|
120
|
-
var jsonCodec = (0, nats_ws_1.JSONCodec)();
|
|
121
|
-
var resultJs = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
122
|
-
var result = DTOs_1.Result.fromJS(resultJs);
|
|
123
|
-
resultHandler(result, error);
|
|
124
|
-
}
|
|
125
|
-
catch (error) {
|
|
126
|
-
resultHandler(undefined, error);
|
|
127
|
-
}
|
|
128
|
-
} })),
|
|
129
|
-
this.subscribe('OnTestRun', __assign(__assign({}, options), { callback: function (error, encodedMessage) {
|
|
130
|
-
if (error) {
|
|
131
|
-
testRunHandler(undefined, error);
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
try {
|
|
135
|
-
var jsonCodec = (0, nats_ws_1.JSONCodec)();
|
|
136
|
-
var testRunJs = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
137
|
-
var testRun = DTOs_1.TestRun.fromJS(testRunJs);
|
|
138
|
-
testRunHandler(testRun, error);
|
|
139
|
-
}
|
|
140
|
-
catch (error) {
|
|
141
|
-
testRunHandler(undefined, error);
|
|
142
|
-
}
|
|
143
|
-
} })),
|
|
144
|
-
];
|
|
145
|
-
};
|
|
146
|
-
/**
|
|
147
|
-
* @param testRunHandler Function to be called when test run or error is received
|
|
148
|
-
* @param options (optional) Subscription options
|
|
149
|
-
* @returns Subscription array: Result and Test Run subscriptions
|
|
150
|
-
*/
|
|
151
|
-
SessionClient.prototype.connectTestRunEvents = function (testRunHandler, options) {
|
|
152
|
-
return this.subscribe('OnTestRun', __assign(__assign({}, options), { callback: function (error, encodedMessage) {
|
|
153
|
-
if (error) {
|
|
154
|
-
testRunHandler(undefined, error);
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
try {
|
|
158
|
-
var jsonCodec = (0, nats_ws_1.JSONCodec)();
|
|
159
|
-
var testRunJs = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
160
|
-
var testRun = DTOs_1.TestRun.fromJS(testRunJs);
|
|
161
|
-
testRunHandler(testRun, error);
|
|
162
|
-
}
|
|
163
|
-
catch (error) {
|
|
164
|
-
testRunHandler(undefined, error);
|
|
165
|
-
}
|
|
166
|
-
} }));
|
|
167
|
-
};
|
|
168
106
|
/**
|
|
169
107
|
* Connect to listen to the TestPlanRun events for the given test plan run ID.
|
|
170
108
|
* @param {string} testPlanRunId
|
|
@@ -174,18 +112,20 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
174
112
|
*/
|
|
175
113
|
SessionClient.prototype.connectTestPlanRunEvents = function (testPlanRunId, handler, options) {
|
|
176
114
|
return this.subscribe("PlanRun.".concat(testPlanRunId), __assign(__assign({}, options), { callback: function (error, encodedMessage) {
|
|
115
|
+
var _a;
|
|
177
116
|
if (error) {
|
|
178
|
-
handler(undefined, error);
|
|
117
|
+
handler(undefined, undefined, error);
|
|
179
118
|
return;
|
|
180
119
|
}
|
|
181
120
|
try {
|
|
182
121
|
var jsonCodec = (0, nats_ws_1.JSONCodec)();
|
|
183
122
|
var onTestPlanRunJs = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
184
123
|
var onTestPlanRun = DTOs_1.OnTestPlanRun.fromJS(onTestPlanRunJs);
|
|
185
|
-
|
|
124
|
+
var planRunId = (_a = encodedMessage.subject.match(/\.PlanRun\.(.+)$/)) === null || _a === void 0 ? void 0 : _a[1];
|
|
125
|
+
handler(planRunId, onTestPlanRun, error);
|
|
186
126
|
}
|
|
187
127
|
catch (error) {
|
|
188
|
-
handler(undefined, error);
|
|
128
|
+
handler(undefined, undefined, error);
|
|
189
129
|
}
|
|
190
130
|
} }));
|
|
191
131
|
};
|
|
@@ -213,30 +153,6 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
213
153
|
}
|
|
214
154
|
} }));
|
|
215
155
|
};
|
|
216
|
-
/**
|
|
217
|
-
* Connect to listen to the test plan run parameter events for the given test plan run ID
|
|
218
|
-
* @param {string} testPlanRunId
|
|
219
|
-
* @param {(event:Parameter[]|undefined,err:NatsError|Error|null)=>void} handler
|
|
220
|
-
* @param {SubscriptionOptions} options?
|
|
221
|
-
* @returns Subscription
|
|
222
|
-
*/
|
|
223
|
-
SessionClient.prototype.connectTestPlanRunParameterEvents = function (testPlanRunId, handler, options) {
|
|
224
|
-
return this.subscribe("PlanRun.".concat(testPlanRunId, ".Parameters"), __assign(__assign({}, options), { callback: function (error, encodedMessage) {
|
|
225
|
-
if (error) {
|
|
226
|
-
handler(undefined, error);
|
|
227
|
-
return;
|
|
228
|
-
}
|
|
229
|
-
try {
|
|
230
|
-
var jsonCodec = (0, nats_ws_1.JSONCodec)();
|
|
231
|
-
var parameterListJs = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
232
|
-
var parameterList = parameterListJs.map(function (parameterJs) { return DTOs_1.Parameter.fromJS(parameterJs); });
|
|
233
|
-
handler(parameterList, error);
|
|
234
|
-
}
|
|
235
|
-
catch (error) {
|
|
236
|
-
handler(undefined, error);
|
|
237
|
-
}
|
|
238
|
-
} }));
|
|
239
|
-
};
|
|
240
156
|
/**
|
|
241
157
|
* Connect to listen to the test step run events for the given test step and test plan run ID
|
|
242
158
|
* @param {string} testPlanRunId
|
|
@@ -249,43 +165,22 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
249
165
|
return this.subscribe("PlanRun.".concat(testPlanRunId, ".StepRun.").concat(testStepRunId), __assign(__assign({}, options), { callback: function (error, encodedMessage) {
|
|
250
166
|
var _a;
|
|
251
167
|
if (error) {
|
|
252
|
-
handler(undefined, undefined, error);
|
|
168
|
+
handler(undefined, undefined, undefined, error);
|
|
253
169
|
return;
|
|
254
170
|
}
|
|
255
171
|
try {
|
|
256
172
|
var jsonCodec = (0, nats_ws_1.JSONCodec)();
|
|
257
173
|
var onTestStepRunJs = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
258
174
|
var onTestStepRun = DTOs_1.OnTestStepRun.fromJS(onTestStepRunJs);
|
|
259
|
-
var
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
} }));
|
|
266
|
-
};
|
|
267
|
-
/**
|
|
268
|
-
* Connect to listen to the test step run parameters for the given test step and test plan run ID
|
|
269
|
-
* @param {string} testPlanRunId
|
|
270
|
-
* @param {string} testStepRunId
|
|
271
|
-
* @param {(event:Parameter[]|undefined,err:NatsError|Error|null)=>void} handler
|
|
272
|
-
* @param {SubscriptionOptions} options?
|
|
273
|
-
* @returns Subscription
|
|
274
|
-
*/
|
|
275
|
-
SessionClient.prototype.connectTestStepRunParameterEvents = function (testPlanRunId, testStepRunId, handler, options) {
|
|
276
|
-
return this.subscribe("PlanRun.".concat(testPlanRunId, ".StepRun.").concat(testStepRunId, ".Parameters"), __assign(__assign({}, options), { callback: function (error, encodedMessage) {
|
|
277
|
-
if (error) {
|
|
278
|
-
handler(undefined, error);
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
|
-
try {
|
|
282
|
-
var jsonCodec = (0, nats_ws_1.JSONCodec)();
|
|
283
|
-
var parameterListJs = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
284
|
-
var parameterList = parameterListJs.map(function (parameterJs) { return DTOs_1.Parameter.fromJS(parameterJs); });
|
|
285
|
-
handler(parameterList, error);
|
|
175
|
+
var _b = (_a = encodedMessage.subject.match(/\.PlanRun\.(.+)\.StepRun\.(.+)$/)) !== null && _a !== void 0 ? _a : [
|
|
176
|
+
undefined,
|
|
177
|
+
undefined,
|
|
178
|
+
undefined,
|
|
179
|
+
], planRunId = _b[1], stepRunId = _b[2];
|
|
180
|
+
handler(planRunId, stepRunId, onTestStepRun, error);
|
|
286
181
|
}
|
|
287
182
|
catch (error) {
|
|
288
|
-
handler(undefined, error);
|
|
183
|
+
handler(undefined, undefined, undefined, error);
|
|
289
184
|
}
|
|
290
185
|
} }));
|
|
291
186
|
};
|
package/dist/mjs/DTOs.d.ts
CHANGED
|
@@ -1021,26 +1021,6 @@ export interface IWatchDog {
|
|
|
1021
1021
|
terminationTimeout?: number;
|
|
1022
1022
|
}
|
|
1023
1023
|
export declare type IComponentSettingsIdentifier = IComponentSettingsBase;
|
|
1024
|
-
export declare class TestRun implements ITestRun {
|
|
1025
|
-
status?: string | undefined;
|
|
1026
|
-
id?: string | undefined;
|
|
1027
|
-
verdict?: string | undefined;
|
|
1028
|
-
duration?: string | undefined;
|
|
1029
|
-
parameters?: Parameter[] | undefined;
|
|
1030
|
-
testStepRun?: TestStepRun | undefined;
|
|
1031
|
-
constructor(data?: ITestRun);
|
|
1032
|
-
init(_data?: any): void;
|
|
1033
|
-
static fromJS(data: any): TestRun;
|
|
1034
|
-
toJSON(data?: any): any;
|
|
1035
|
-
}
|
|
1036
|
-
export interface ITestRun {
|
|
1037
|
-
status?: string | undefined;
|
|
1038
|
-
id?: string | undefined;
|
|
1039
|
-
verdict?: string | undefined;
|
|
1040
|
-
duration?: string | undefined;
|
|
1041
|
-
parameters?: Parameter[] | undefined;
|
|
1042
|
-
testStepRun?: TestStepRun | undefined;
|
|
1043
|
-
}
|
|
1044
1024
|
export declare class TestStepRun implements ITestStepRun {
|
|
1045
1025
|
parentId?: string | undefined;
|
|
1046
1026
|
testStepId?: string | undefined;
|
|
@@ -1346,10 +1326,12 @@ export interface IMetricsConfigurationChangedEventArgs extends ISessionEvent {
|
|
|
1346
1326
|
export interface IOnTestPlanRun {
|
|
1347
1327
|
status?: string;
|
|
1348
1328
|
userId?: string;
|
|
1329
|
+
parameters?: Parameter[];
|
|
1349
1330
|
}
|
|
1350
1331
|
export declare class OnTestPlanRun implements IOnTestPlanRun {
|
|
1351
1332
|
status?: string;
|
|
1352
1333
|
userId?: string;
|
|
1334
|
+
parameters?: Parameter[];
|
|
1353
1335
|
constructor(data?: IOnTestPlanRun);
|
|
1354
1336
|
init(_data?: any): void;
|
|
1355
1337
|
static fromJS(data: any): OnTestPlanRun;
|
|
@@ -1361,6 +1343,7 @@ export interface IOnTestStepRun {
|
|
|
1361
1343
|
parentRunId?: string;
|
|
1362
1344
|
verdict?: string;
|
|
1363
1345
|
duration?: string;
|
|
1346
|
+
parameters?: Parameter[];
|
|
1364
1347
|
}
|
|
1365
1348
|
export declare class OnTestStepRun implements IOnTestStepRun {
|
|
1366
1349
|
status?: string;
|
|
@@ -1368,6 +1351,7 @@ export declare class OnTestStepRun implements IOnTestStepRun {
|
|
|
1368
1351
|
parentRunId?: string;
|
|
1369
1352
|
verdict?: string;
|
|
1370
1353
|
duration?: string;
|
|
1354
|
+
parameters?: Parameter[];
|
|
1371
1355
|
constructor(data?: IOnTestStepRun);
|
|
1372
1356
|
init(_data?: any): void;
|
|
1373
1357
|
static fromJS(data: any): OnTestStepRun;
|
package/dist/mjs/DTOs.js
CHANGED
|
@@ -2539,50 +2539,6 @@ export class WatchDog {
|
|
|
2539
2539
|
return data;
|
|
2540
2540
|
}
|
|
2541
2541
|
}
|
|
2542
|
-
export class TestRun {
|
|
2543
|
-
constructor(data) {
|
|
2544
|
-
if (data) {
|
|
2545
|
-
for (const property in data) {
|
|
2546
|
-
if (Object.prototype.hasOwnProperty.call(data, property))
|
|
2547
|
-
this[property] = data[property];
|
|
2548
|
-
}
|
|
2549
|
-
}
|
|
2550
|
-
}
|
|
2551
|
-
init(_data) {
|
|
2552
|
-
if (_data) {
|
|
2553
|
-
this.status = _data['Status'];
|
|
2554
|
-
this.id = _data['Id'];
|
|
2555
|
-
this.verdict = _data['Verdict'];
|
|
2556
|
-
this.duration = _data['Duration'];
|
|
2557
|
-
if (Array.isArray(_data['Parameters'])) {
|
|
2558
|
-
this.parameters = [];
|
|
2559
|
-
for (const item of _data['Parameters'])
|
|
2560
|
-
this.parameters.push(Parameter.fromJS(item));
|
|
2561
|
-
}
|
|
2562
|
-
this.testStepRun = _data['TestStepRun'] ? TestStepRun.fromJS(_data['TestStepRun']) : undefined;
|
|
2563
|
-
}
|
|
2564
|
-
}
|
|
2565
|
-
static fromJS(data) {
|
|
2566
|
-
data = typeof data === 'object' ? data : {};
|
|
2567
|
-
const result = new TestRun();
|
|
2568
|
-
result.init(data);
|
|
2569
|
-
return result;
|
|
2570
|
-
}
|
|
2571
|
-
toJSON(data) {
|
|
2572
|
-
data = typeof data === 'object' ? data : {};
|
|
2573
|
-
data['Status'] = this.status;
|
|
2574
|
-
data['Id'] = this.id;
|
|
2575
|
-
data['Verdict'] = this.verdict;
|
|
2576
|
-
data['Duration'] = this.duration;
|
|
2577
|
-
if (Array.isArray(this.parameters)) {
|
|
2578
|
-
data['Parameters'] = [];
|
|
2579
|
-
for (const item of this.parameters)
|
|
2580
|
-
data['Parameters'].push(item.toJSON());
|
|
2581
|
-
}
|
|
2582
|
-
data['TestStepRun'] = this.testStepRun ? this.testStepRun.toJSON() : undefined;
|
|
2583
|
-
return data;
|
|
2584
|
-
}
|
|
2585
|
-
}
|
|
2586
2542
|
export class TestStepRun {
|
|
2587
2543
|
constructor(data) {
|
|
2588
2544
|
if (data) {
|
|
@@ -3314,6 +3270,11 @@ export class OnTestPlanRun {
|
|
|
3314
3270
|
if (_data) {
|
|
3315
3271
|
this.status = _data['Status'];
|
|
3316
3272
|
this.userId = _data['UserId'];
|
|
3273
|
+
if (Array.isArray(_data['Parameters'])) {
|
|
3274
|
+
this.parameters = [];
|
|
3275
|
+
for (const item of _data['Parameters'])
|
|
3276
|
+
this.parameters.push(Parameter.fromJS(item));
|
|
3277
|
+
}
|
|
3317
3278
|
}
|
|
3318
3279
|
}
|
|
3319
3280
|
static fromJS(data) {
|
|
@@ -3323,9 +3284,13 @@ export class OnTestPlanRun {
|
|
|
3323
3284
|
return result;
|
|
3324
3285
|
}
|
|
3325
3286
|
toJSON(data) {
|
|
3326
|
-
data = typeof data === 'object' ? data : {};
|
|
3327
3287
|
data['Status'] = this.status;
|
|
3328
3288
|
data['UserId'] = this.userId;
|
|
3289
|
+
if (Array.isArray(this.parameters)) {
|
|
3290
|
+
data['Parameters'] = [];
|
|
3291
|
+
for (const item of this.parameters)
|
|
3292
|
+
data['Parameters'].push(item.toJSON());
|
|
3293
|
+
}
|
|
3329
3294
|
return data;
|
|
3330
3295
|
}
|
|
3331
3296
|
}
|
|
@@ -3345,6 +3310,11 @@ export class OnTestStepRun {
|
|
|
3345
3310
|
this.parentRunId = _data['ParentRunId'];
|
|
3346
3311
|
this.verdict = _data['Verdict'];
|
|
3347
3312
|
this.duration = _data['Duration'];
|
|
3313
|
+
if (Array.isArray(_data['Parameters'])) {
|
|
3314
|
+
this.parameters = [];
|
|
3315
|
+
for (const item of _data['Parameters'])
|
|
3316
|
+
this.parameters.push(Parameter.fromJS(item));
|
|
3317
|
+
}
|
|
3348
3318
|
}
|
|
3349
3319
|
}
|
|
3350
3320
|
static fromJS(data) {
|
|
@@ -3360,6 +3330,11 @@ export class OnTestStepRun {
|
|
|
3360
3330
|
data['ParentRunId'] = this.parentRunId;
|
|
3361
3331
|
data['Verdict'] = this.verdict;
|
|
3362
3332
|
data['Duration'] = this.duration;
|
|
3333
|
+
if (Array.isArray(this.parameters)) {
|
|
3334
|
+
data['Parameters'] = [];
|
|
3335
|
+
for (const item of this.parameters)
|
|
3336
|
+
data['Parameters'].push(item.toJSON());
|
|
3337
|
+
}
|
|
3363
3338
|
return data;
|
|
3364
3339
|
}
|
|
3365
3340
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BreakPoints, CommonContext, CommonSettings, DataGridControl, IMetricsConfiguration, Image, Interaction, ListItemType, LogList, MetricsConfiguration, OnTestPlanRun, OnTestStepRun, Parameter, RepositoryPackageDefinition, RepositoryPackageReference, Resource, Result, RunStatus, SessionEvent, Setting, TestPlan,
|
|
1
|
+
import { BreakPoints, CommonContext, CommonSettings, DataGridControl, IMetricsConfiguration, Image, Interaction, ListItemType, LogList, MetricsConfiguration, OnTestPlanRun, OnTestStepRun, Parameter, RepositoryPackageDefinition, RepositoryPackageReference, Resource, Result, RunStatus, SessionEvent, Setting, TestPlan, TestStepType, TestStepValidationError, WatchDog } 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,19 +24,6 @@ export declare class SessionClient extends BaseClient {
|
|
|
24
24
|
* @returns Subscription object
|
|
25
25
|
*/
|
|
26
26
|
connectSessionEvents(eventHandler: (sessionEvent: SessionEvent | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): void;
|
|
27
|
-
/**
|
|
28
|
-
* @param resultHandler Function to be called when result or error is received
|
|
29
|
-
* @param testRunHandler Function to be called when test run or error is received
|
|
30
|
-
* @param options (optional) Subscription options
|
|
31
|
-
* @returns Subscription array: Result and Test Run subscriptions
|
|
32
|
-
*/
|
|
33
|
-
connectSessionResults(resultHandler: (result: Result | undefined, err: NatsError | Error | null) => void, testRunHandler: (testRun: TestRun | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): [Subscription, Subscription];
|
|
34
|
-
/**
|
|
35
|
-
* @param testRunHandler Function to be called when test run or error is received
|
|
36
|
-
* @param options (optional) Subscription options
|
|
37
|
-
* @returns Subscription array: Result and Test Run subscriptions
|
|
38
|
-
*/
|
|
39
|
-
connectTestRunEvents(testRunHandler: (testRun: TestRun | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
40
27
|
/**
|
|
41
28
|
* Connect to listen to the TestPlanRun events for the given test plan run ID.
|
|
42
29
|
* @param {string} testPlanRunId
|
|
@@ -44,7 +31,7 @@ export declare class SessionClient extends BaseClient {
|
|
|
44
31
|
* @param {SubscriptionOptions} options?
|
|
45
32
|
* @returns Subscription
|
|
46
33
|
*/
|
|
47
|
-
connectTestPlanRunEvents(testPlanRunId: string, handler: (event: OnTestPlanRun | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
34
|
+
connectTestPlanRunEvents(testPlanRunId: string, handler: (planRunId: string | undefined, event: OnTestPlanRun | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
48
35
|
/**
|
|
49
36
|
* Connect to listen to the test plan run logs for the given test plan run ID
|
|
50
37
|
* @param {string} testPlanRunId
|
|
@@ -53,14 +40,6 @@ export declare class SessionClient extends BaseClient {
|
|
|
53
40
|
* @returns Subscription
|
|
54
41
|
*/
|
|
55
42
|
connectTestPlanRunLogs(testPlanRunId: string, handler: (logList: LogList | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
56
|
-
/**
|
|
57
|
-
* Connect to listen to the test plan run parameter events for the given test plan run ID
|
|
58
|
-
* @param {string} testPlanRunId
|
|
59
|
-
* @param {(event:Parameter[]|undefined,err:NatsError|Error|null)=>void} handler
|
|
60
|
-
* @param {SubscriptionOptions} options?
|
|
61
|
-
* @returns Subscription
|
|
62
|
-
*/
|
|
63
|
-
connectTestPlanRunParameterEvents(testPlanRunId: string, handler: (event: Parameter[] | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
64
43
|
/**
|
|
65
44
|
* Connect to listen to the test step run events for the given test step and test plan run ID
|
|
66
45
|
* @param {string} testPlanRunId
|
|
@@ -69,16 +48,7 @@ export declare class SessionClient extends BaseClient {
|
|
|
69
48
|
* @param {SubscriptionOptions} options?
|
|
70
49
|
* @returns Subscription
|
|
71
50
|
*/
|
|
72
|
-
connectTestStepRunEvents(testPlanRunId: string, testStepRunId: string, handler: (
|
|
73
|
-
/**
|
|
74
|
-
* Connect to listen to the test step run parameters for the given test step and test plan run ID
|
|
75
|
-
* @param {string} testPlanRunId
|
|
76
|
-
* @param {string} testStepRunId
|
|
77
|
-
* @param {(event:Parameter[]|undefined,err:NatsError|Error|null)=>void} handler
|
|
78
|
-
* @param {SubscriptionOptions} options?
|
|
79
|
-
* @returns Subscription
|
|
80
|
-
*/
|
|
81
|
-
connectTestStepRunParameterEvents(testPlanRunId: string, testStepRunId: string, handler: (event: Parameter[] | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
51
|
+
connectTestStepRunEvents(testPlanRunId: string, testStepRunId: string, handler: (planRunId: string | undefined, stepRunId: string | undefined, testRun: OnTestStepRun | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
82
52
|
/**
|
|
83
53
|
* Connect to listen to the test step run results for the given test step and test plan run ID
|
|
84
54
|
* @param {string} testPlanRunId
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BreakPoints, CommonContext, CommonSettings, DataGridControl, Image, Interaction, ListItemType, LogList, MetricsConfiguration, OnTestPlanRun, OnTestStepRun,
|
|
1
|
+
import { BreakPoints, CommonContext, CommonSettings, DataGridControl, Image, Interaction, ListItemType, LogList, MetricsConfiguration, OnTestPlanRun, OnTestStepRun, Result, RunStatus, SessionEvent, Setting, TestPlan, TestStepType, TestStepValidationError, WatchDog, } from './DTOs';
|
|
2
2
|
import { JSONCodec } from 'nats.ws';
|
|
3
3
|
import { BaseClient } from './BaseClient';
|
|
4
4
|
export class SessionClient extends BaseClient {
|
|
@@ -68,68 +68,6 @@ export class SessionClient extends BaseClient {
|
|
|
68
68
|
this.subscriptions.push(this.subscribe('Events', Object.assign(Object.assign({}, options), { callback })));
|
|
69
69
|
this.subscriptions.push(this.subscribe('Events.*', Object.assign(Object.assign({}, options), { callback })));
|
|
70
70
|
}
|
|
71
|
-
/**
|
|
72
|
-
* @param resultHandler Function to be called when result or error is received
|
|
73
|
-
* @param testRunHandler Function to be called when test run or error is received
|
|
74
|
-
* @param options (optional) Subscription options
|
|
75
|
-
* @returns Subscription array: Result and Test Run subscriptions
|
|
76
|
-
*/
|
|
77
|
-
connectSessionResults(resultHandler, testRunHandler, options) {
|
|
78
|
-
return [
|
|
79
|
-
this.subscribe('OnResult', Object.assign(Object.assign({}, options), { callback(error, encodedMessage) {
|
|
80
|
-
if (error) {
|
|
81
|
-
resultHandler(undefined, error);
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
try {
|
|
85
|
-
const jsonCodec = JSONCodec();
|
|
86
|
-
const resultJs = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
87
|
-
const result = Result.fromJS(resultJs);
|
|
88
|
-
resultHandler(result, error);
|
|
89
|
-
}
|
|
90
|
-
catch (error) {
|
|
91
|
-
resultHandler(undefined, error);
|
|
92
|
-
}
|
|
93
|
-
} })),
|
|
94
|
-
this.subscribe('OnTestRun', Object.assign(Object.assign({}, options), { callback(error, encodedMessage) {
|
|
95
|
-
if (error) {
|
|
96
|
-
testRunHandler(undefined, error);
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
try {
|
|
100
|
-
const jsonCodec = JSONCodec();
|
|
101
|
-
const testRunJs = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
102
|
-
const testRun = TestRun.fromJS(testRunJs);
|
|
103
|
-
testRunHandler(testRun, error);
|
|
104
|
-
}
|
|
105
|
-
catch (error) {
|
|
106
|
-
testRunHandler(undefined, error);
|
|
107
|
-
}
|
|
108
|
-
} })),
|
|
109
|
-
];
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* @param testRunHandler Function to be called when test run or error is received
|
|
113
|
-
* @param options (optional) Subscription options
|
|
114
|
-
* @returns Subscription array: Result and Test Run subscriptions
|
|
115
|
-
*/
|
|
116
|
-
connectTestRunEvents(testRunHandler, options) {
|
|
117
|
-
return this.subscribe('OnTestRun', Object.assign(Object.assign({}, options), { callback(error, encodedMessage) {
|
|
118
|
-
if (error) {
|
|
119
|
-
testRunHandler(undefined, error);
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
try {
|
|
123
|
-
const jsonCodec = JSONCodec();
|
|
124
|
-
const testRunJs = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
125
|
-
const testRun = TestRun.fromJS(testRunJs);
|
|
126
|
-
testRunHandler(testRun, error);
|
|
127
|
-
}
|
|
128
|
-
catch (error) {
|
|
129
|
-
testRunHandler(undefined, error);
|
|
130
|
-
}
|
|
131
|
-
} }));
|
|
132
|
-
}
|
|
133
71
|
/**
|
|
134
72
|
* Connect to listen to the TestPlanRun events for the given test plan run ID.
|
|
135
73
|
* @param {string} testPlanRunId
|
|
@@ -139,18 +77,20 @@ export class SessionClient extends BaseClient {
|
|
|
139
77
|
*/
|
|
140
78
|
connectTestPlanRunEvents(testPlanRunId, handler, options) {
|
|
141
79
|
return this.subscribe(`PlanRun.${testPlanRunId}`, Object.assign(Object.assign({}, options), { callback(error, encodedMessage) {
|
|
80
|
+
var _a;
|
|
142
81
|
if (error) {
|
|
143
|
-
handler(undefined, error);
|
|
82
|
+
handler(undefined, undefined, error);
|
|
144
83
|
return;
|
|
145
84
|
}
|
|
146
85
|
try {
|
|
147
86
|
const jsonCodec = JSONCodec();
|
|
148
87
|
const onTestPlanRunJs = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
149
88
|
const onTestPlanRun = OnTestPlanRun.fromJS(onTestPlanRunJs);
|
|
150
|
-
|
|
89
|
+
const planRunId = (_a = encodedMessage.subject.match(/\.PlanRun\.(.+)$/)) === null || _a === void 0 ? void 0 : _a[1];
|
|
90
|
+
handler(planRunId, onTestPlanRun, error);
|
|
151
91
|
}
|
|
152
92
|
catch (error) {
|
|
153
|
-
handler(undefined, error);
|
|
93
|
+
handler(undefined, undefined, error);
|
|
154
94
|
}
|
|
155
95
|
} }));
|
|
156
96
|
}
|
|
@@ -178,30 +118,6 @@ export class SessionClient extends BaseClient {
|
|
|
178
118
|
}
|
|
179
119
|
} }));
|
|
180
120
|
}
|
|
181
|
-
/**
|
|
182
|
-
* Connect to listen to the test plan run parameter events for the given test plan run ID
|
|
183
|
-
* @param {string} testPlanRunId
|
|
184
|
-
* @param {(event:Parameter[]|undefined,err:NatsError|Error|null)=>void} handler
|
|
185
|
-
* @param {SubscriptionOptions} options?
|
|
186
|
-
* @returns Subscription
|
|
187
|
-
*/
|
|
188
|
-
connectTestPlanRunParameterEvents(testPlanRunId, handler, options) {
|
|
189
|
-
return this.subscribe(`PlanRun.${testPlanRunId}.Parameters`, Object.assign(Object.assign({}, options), { callback(error, encodedMessage) {
|
|
190
|
-
if (error) {
|
|
191
|
-
handler(undefined, error);
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
try {
|
|
195
|
-
const jsonCodec = JSONCodec();
|
|
196
|
-
const parameterListJs = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
197
|
-
const parameterList = parameterListJs.map(parameterJs => Parameter.fromJS(parameterJs));
|
|
198
|
-
handler(parameterList, error);
|
|
199
|
-
}
|
|
200
|
-
catch (error) {
|
|
201
|
-
handler(undefined, error);
|
|
202
|
-
}
|
|
203
|
-
} }));
|
|
204
|
-
}
|
|
205
121
|
/**
|
|
206
122
|
* Connect to listen to the test step run events for the given test step and test plan run ID
|
|
207
123
|
* @param {string} testPlanRunId
|
|
@@ -214,43 +130,22 @@ export class SessionClient extends BaseClient {
|
|
|
214
130
|
return this.subscribe(`PlanRun.${testPlanRunId}.StepRun.${testStepRunId}`, Object.assign(Object.assign({}, options), { callback(error, encodedMessage) {
|
|
215
131
|
var _a;
|
|
216
132
|
if (error) {
|
|
217
|
-
handler(undefined, undefined, error);
|
|
133
|
+
handler(undefined, undefined, undefined, error);
|
|
218
134
|
return;
|
|
219
135
|
}
|
|
220
136
|
try {
|
|
221
137
|
const jsonCodec = JSONCodec();
|
|
222
138
|
const onTestStepRunJs = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
223
139
|
const onTestStepRun = OnTestStepRun.fromJS(onTestStepRunJs);
|
|
224
|
-
const stepRunId = (_a = encodedMessage.subject.match(/\.StepRun\.(.+)$/))
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
} }));
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Connect to listen to the test step run parameters for the given test step and test plan run ID
|
|
234
|
-
* @param {string} testPlanRunId
|
|
235
|
-
* @param {string} testStepRunId
|
|
236
|
-
* @param {(event:Parameter[]|undefined,err:NatsError|Error|null)=>void} handler
|
|
237
|
-
* @param {SubscriptionOptions} options?
|
|
238
|
-
* @returns Subscription
|
|
239
|
-
*/
|
|
240
|
-
connectTestStepRunParameterEvents(testPlanRunId, testStepRunId, handler, options) {
|
|
241
|
-
return this.subscribe(`PlanRun.${testPlanRunId}.StepRun.${testStepRunId}.Parameters`, Object.assign(Object.assign({}, options), { callback(error, encodedMessage) {
|
|
242
|
-
if (error) {
|
|
243
|
-
handler(undefined, error);
|
|
244
|
-
return;
|
|
245
|
-
}
|
|
246
|
-
try {
|
|
247
|
-
const jsonCodec = JSONCodec();
|
|
248
|
-
const parameterListJs = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
249
|
-
const parameterList = parameterListJs.map(parameterJs => Parameter.fromJS(parameterJs));
|
|
250
|
-
handler(parameterList, error);
|
|
140
|
+
const [, planRunId, stepRunId] = (_a = encodedMessage.subject.match(/\.PlanRun\.(.+)\.StepRun\.(.+)$/)) !== null && _a !== void 0 ? _a : [
|
|
141
|
+
undefined,
|
|
142
|
+
undefined,
|
|
143
|
+
undefined,
|
|
144
|
+
];
|
|
145
|
+
handler(planRunId, stepRunId, onTestStepRun, error);
|
|
251
146
|
}
|
|
252
147
|
catch (error) {
|
|
253
|
-
handler(undefined, error);
|
|
148
|
+
handler(undefined, undefined, undefined, error);
|
|
254
149
|
}
|
|
255
150
|
} }));
|
|
256
151
|
}
|
package/package.json
CHANGED