@opentap/runner-client 1.0.0-beta.78 → 1.0.0-beta.80
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/RunnerClient.d.ts +2 -27
- package/lib/RunnerClient.js +25 -256
- package/lib/SessionClient.d.ts +5 -0
- package/lib/SessionClient.js +115 -27
- package/package.json +1 -1
package/lib/RunnerClient.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Image, Session } from './DTOs';
|
|
2
2
|
import { BaseClient } from './BaseClient';
|
|
3
|
-
import {
|
|
3
|
+
import { ConnectionOptions } from 'nats.ws';
|
|
4
4
|
export declare class RunnerClient extends BaseClient {
|
|
5
5
|
private http;
|
|
6
6
|
private baseUrl;
|
|
@@ -45,29 +45,4 @@ export declare class RunnerClient extends BaseClient {
|
|
|
45
45
|
* @returns {{Promise<Session>}}
|
|
46
46
|
*/
|
|
47
47
|
startImageSession(image: Image): Promise<Session>;
|
|
48
|
-
/**
|
|
49
|
-
* Retrives the already running sessions
|
|
50
|
-
*/
|
|
51
|
-
getSessions(): Promise<Session[]>;
|
|
52
|
-
protected processGetSessions(response: Response): Promise<Session[]>;
|
|
53
|
-
/**
|
|
54
|
-
* Register a self-started Session to a SessionManager.
|
|
55
|
-
*/
|
|
56
|
-
registerSession(session: Session): Promise<Session>;
|
|
57
|
-
protected processRegisterSession(response: Response): Promise<Session>;
|
|
58
|
-
/**
|
|
59
|
-
* Shutdown Sessions and SessionManager
|
|
60
|
-
*/
|
|
61
|
-
shutdown(): Promise<void>;
|
|
62
|
-
protected processShutdown(response: Response): Promise<void>;
|
|
63
|
-
/**
|
|
64
|
-
* Links to other applications or services
|
|
65
|
-
*/
|
|
66
|
-
getLinks(): Promise<Links>;
|
|
67
|
-
protected processGetLinks(response: Response): Promise<Links>;
|
|
68
|
-
/**
|
|
69
|
-
* Retrieve settings types used in creating a Settings TapPackage
|
|
70
|
-
*/
|
|
71
|
-
getSettingsTypes(): Promise<string[]>;
|
|
72
|
-
protected processGetSettingsTypes(response: Response): Promise<string[]>;
|
|
73
48
|
}
|
package/lib/RunnerClient.js
CHANGED
|
@@ -13,8 +13,8 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
13
13
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
14
|
};
|
|
15
15
|
})();
|
|
16
|
+
import { Image, Session } from './DTOs';
|
|
16
17
|
import { BaseClient } from './BaseClient';
|
|
17
|
-
import { ApiException, ErrorResponse, Links, Session } from './DTOs';
|
|
18
18
|
var RunnerClient = /** @class */ (function (_super) {
|
|
19
19
|
__extends(RunnerClient, _super);
|
|
20
20
|
function RunnerClient(baseSubject, options) {
|
|
@@ -29,7 +29,10 @@ var RunnerClient = /** @class */ (function (_super) {
|
|
|
29
29
|
*/
|
|
30
30
|
RunnerClient.prototype.getImage = function (imageId) {
|
|
31
31
|
return (imageId === null || imageId === void 0 ? void 0 : imageId.length) > 0
|
|
32
|
-
? this.request('GetImage', imageId)
|
|
32
|
+
? this.request('GetImage', imageId)
|
|
33
|
+
.then(function (imageJs) { return Image.fromJS(imageJs); })
|
|
34
|
+
.then(this.success())
|
|
35
|
+
.catch(this.error())
|
|
33
36
|
: Promise.reject('imageId is not defined');
|
|
34
37
|
};
|
|
35
38
|
/**
|
|
@@ -37,7 +40,10 @@ var RunnerClient = /** @class */ (function (_super) {
|
|
|
37
40
|
* @returns {{Promise<Image[]>}}
|
|
38
41
|
*/
|
|
39
42
|
RunnerClient.prototype.getImages = function () {
|
|
40
|
-
return this.request('GetImages')
|
|
43
|
+
return this.request('GetImages')
|
|
44
|
+
.then(function (imageArrayJs) { return imageArrayJs.map(function (imageJs) { return Image.fromJS(imageJs); }); })
|
|
45
|
+
.then(this.success())
|
|
46
|
+
.catch(this.error());
|
|
41
47
|
};
|
|
42
48
|
/**
|
|
43
49
|
* Create a OpenTAP package configuration image from a list image inputs consisting of user specified packages and repositories.
|
|
@@ -46,7 +52,10 @@ var RunnerClient = /** @class */ (function (_super) {
|
|
|
46
52
|
*/
|
|
47
53
|
RunnerClient.prototype.resolveImage = function (images) {
|
|
48
54
|
return (images === null || images === void 0 ? void 0 : images.length) > 0
|
|
49
|
-
? this.request('ResolveImage', images)
|
|
55
|
+
? this.request('ResolveImage', images)
|
|
56
|
+
.then(function (imageJs) { return Image.fromJS(imageJs); })
|
|
57
|
+
.then(this.success())
|
|
58
|
+
.catch(this.error())
|
|
50
59
|
: Promise.reject('images list is not defined or is empty');
|
|
51
60
|
};
|
|
52
61
|
/**
|
|
@@ -64,14 +73,20 @@ var RunnerClient = /** @class */ (function (_super) {
|
|
|
64
73
|
* @returns {{Promise<Session>}}
|
|
65
74
|
*/
|
|
66
75
|
RunnerClient.prototype.startSession = function () {
|
|
67
|
-
return this.request('StartSession')
|
|
76
|
+
return this.request('StartSession')
|
|
77
|
+
.then(function (sessionJs) { return Session.fromJS(sessionJs); })
|
|
78
|
+
.then(this.success())
|
|
79
|
+
.catch(this.error());
|
|
68
80
|
};
|
|
69
81
|
/**
|
|
70
82
|
* Get the session manager image.
|
|
71
83
|
* @returns {{Promise<Image>}}
|
|
72
84
|
*/
|
|
73
85
|
RunnerClient.prototype.getSessionManagerImage = function () {
|
|
74
|
-
return this.request('GetSessionManagerImage')
|
|
86
|
+
return this.request('GetSessionManagerImage')
|
|
87
|
+
.then(function (imageJs) { return Image.fromJS(imageJs); })
|
|
88
|
+
.then(this.success())
|
|
89
|
+
.catch(this.error());
|
|
75
90
|
};
|
|
76
91
|
/**
|
|
77
92
|
* Start a session based on an image.
|
|
@@ -80,258 +95,12 @@ var RunnerClient = /** @class */ (function (_super) {
|
|
|
80
95
|
*/
|
|
81
96
|
RunnerClient.prototype.startImageSession = function (image) {
|
|
82
97
|
return image
|
|
83
|
-
? this.request('StartImageSession', image)
|
|
98
|
+
? this.request('StartImageSession', image)
|
|
99
|
+
.then(function (sessionJs) { return Session.fromJS(sessionJs); })
|
|
100
|
+
.then(this.success())
|
|
101
|
+
.catch(this.error())
|
|
84
102
|
: Promise.reject('image is not defined');
|
|
85
103
|
};
|
|
86
|
-
/**
|
|
87
|
-
* Retrives the already running sessions
|
|
88
|
-
*/
|
|
89
|
-
RunnerClient.prototype.getSessions = function () {
|
|
90
|
-
var _this = this;
|
|
91
|
-
var url_ = this.baseUrl + '/sessions';
|
|
92
|
-
url_ = url_.replace(/[?&]$/, '');
|
|
93
|
-
var options_ = {
|
|
94
|
-
method: 'GET',
|
|
95
|
-
headers: {
|
|
96
|
-
Accept: 'application/json',
|
|
97
|
-
},
|
|
98
|
-
};
|
|
99
|
-
return this.http.fetch(url_, options_).then(function (_response) {
|
|
100
|
-
return _this.processGetSessions(_response);
|
|
101
|
-
});
|
|
102
|
-
};
|
|
103
|
-
RunnerClient.prototype.processGetSessions = function (response) {
|
|
104
|
-
var _this = this;
|
|
105
|
-
var status = response.status;
|
|
106
|
-
var _headers = {};
|
|
107
|
-
if (response.headers && response.headers.forEach) {
|
|
108
|
-
response.headers.forEach(function (v, k) { return (_headers[k] = v); });
|
|
109
|
-
}
|
|
110
|
-
if (status === 200) {
|
|
111
|
-
return response.text().then(function (_responseText) {
|
|
112
|
-
var result200 = null;
|
|
113
|
-
var resultData200 = _responseText === '' ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
114
|
-
if (Array.isArray(resultData200)) {
|
|
115
|
-
result200 = [];
|
|
116
|
-
for (var _i = 0, resultData200_1 = resultData200; _i < resultData200_1.length; _i++) {
|
|
117
|
-
var item = resultData200_1[_i];
|
|
118
|
-
result200.push(Session.fromJS(item));
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
result200 = null;
|
|
123
|
-
}
|
|
124
|
-
return result200;
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
else if (status !== 200 && status !== 204) {
|
|
128
|
-
return response.text().then(function (_responseText) {
|
|
129
|
-
return throwException('An unexpected server error occurred.', status, _responseText, _headers);
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
return Promise.resolve(null);
|
|
133
|
-
};
|
|
134
|
-
/**
|
|
135
|
-
* Register a self-started Session to a SessionManager.
|
|
136
|
-
*/
|
|
137
|
-
RunnerClient.prototype.registerSession = function (session) {
|
|
138
|
-
var _this = this;
|
|
139
|
-
var url_ = this.baseUrl + '/sessions/register';
|
|
140
|
-
url_ = url_.replace(/[?&]$/, '');
|
|
141
|
-
var content_ = JSON.stringify(session);
|
|
142
|
-
var options_ = {
|
|
143
|
-
body: content_,
|
|
144
|
-
method: 'POST',
|
|
145
|
-
headers: {
|
|
146
|
-
'Content-Type': 'application/json',
|
|
147
|
-
Accept: 'application/json',
|
|
148
|
-
},
|
|
149
|
-
};
|
|
150
|
-
return this.http.fetch(url_, options_).then(function (_response) {
|
|
151
|
-
return _this.processRegisterSession(_response);
|
|
152
|
-
});
|
|
153
|
-
};
|
|
154
|
-
RunnerClient.prototype.processRegisterSession = function (response) {
|
|
155
|
-
var _this = this;
|
|
156
|
-
var status = response.status;
|
|
157
|
-
var _headers = {};
|
|
158
|
-
if (response.headers && response.headers.forEach) {
|
|
159
|
-
response.headers.forEach(function (v, k) { return (_headers[k] = v); });
|
|
160
|
-
}
|
|
161
|
-
if (status === 200) {
|
|
162
|
-
return response.text().then(function (_responseText) {
|
|
163
|
-
var result200 = null;
|
|
164
|
-
var resultData200 = _responseText === '' ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
165
|
-
result200 = Session.fromJS(resultData200);
|
|
166
|
-
return result200;
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
else if (status === 400) {
|
|
170
|
-
return response.text().then(function (_responseText) {
|
|
171
|
-
var result400 = null;
|
|
172
|
-
var resultData400 = _responseText === '' ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
173
|
-
result400 = ErrorResponse.fromJS(resultData400);
|
|
174
|
-
return throwException('A server side error occurred.', status, _responseText, _headers, result400);
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
else if (status !== 200 && status !== 204) {
|
|
178
|
-
return response.text().then(function (_responseText) {
|
|
179
|
-
return throwException('An unexpected server error occurred.', status, _responseText, _headers);
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
return Promise.resolve(null);
|
|
183
|
-
};
|
|
184
|
-
/**
|
|
185
|
-
* Shutdown Sessions and SessionManager
|
|
186
|
-
*/
|
|
187
|
-
RunnerClient.prototype.shutdown = function () {
|
|
188
|
-
var _this = this;
|
|
189
|
-
var url_ = this.baseUrl + '/sessionmanager';
|
|
190
|
-
url_ = url_.replace(/[?&]$/, '');
|
|
191
|
-
var options_ = {
|
|
192
|
-
method: 'DELETE',
|
|
193
|
-
headers: {},
|
|
194
|
-
};
|
|
195
|
-
return this.http.fetch(url_, options_).then(function (_response) {
|
|
196
|
-
return _this.processShutdown(_response);
|
|
197
|
-
});
|
|
198
|
-
};
|
|
199
|
-
RunnerClient.prototype.processShutdown = function (response) {
|
|
200
|
-
var _this = this;
|
|
201
|
-
var status = response.status;
|
|
202
|
-
var _headers = {};
|
|
203
|
-
if (response.headers && response.headers.forEach) {
|
|
204
|
-
response.headers.forEach(function (v, k) { return (_headers[k] = v); });
|
|
205
|
-
}
|
|
206
|
-
if (status === 200) {
|
|
207
|
-
return response.text().then(function () {
|
|
208
|
-
return;
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
else if (status === 400) {
|
|
212
|
-
return response.text().then(function (_responseText) {
|
|
213
|
-
var result400 = null;
|
|
214
|
-
var resultData400 = _responseText === '' ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
215
|
-
result400 = ErrorResponse.fromJS(resultData400);
|
|
216
|
-
return throwException('A server side error occurred.', status, _responseText, _headers, result400);
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
else if (status !== 200 && status !== 204) {
|
|
220
|
-
return response.text().then(function (_responseText) {
|
|
221
|
-
return throwException('An unexpected server error occurred.', status, _responseText, _headers);
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
return Promise.resolve(null);
|
|
225
|
-
};
|
|
226
|
-
/**
|
|
227
|
-
* Links to other applications or services
|
|
228
|
-
*/
|
|
229
|
-
RunnerClient.prototype.getLinks = function () {
|
|
230
|
-
var _this = this;
|
|
231
|
-
var url_ = this.baseUrl + '/links';
|
|
232
|
-
url_ = url_.replace(/[?&]$/, '');
|
|
233
|
-
var options_ = {
|
|
234
|
-
method: 'GET',
|
|
235
|
-
headers: {
|
|
236
|
-
Accept: 'application/json',
|
|
237
|
-
},
|
|
238
|
-
};
|
|
239
|
-
return this.http.fetch(url_, options_).then(function (_response) {
|
|
240
|
-
return _this.processGetLinks(_response);
|
|
241
|
-
});
|
|
242
|
-
};
|
|
243
|
-
RunnerClient.prototype.processGetLinks = function (response) {
|
|
244
|
-
var _this = this;
|
|
245
|
-
var status = response.status;
|
|
246
|
-
var _headers = {};
|
|
247
|
-
if (response.headers && response.headers.forEach) {
|
|
248
|
-
response.headers.forEach(function (v, k) { return (_headers[k] = v); });
|
|
249
|
-
}
|
|
250
|
-
if (status === 200) {
|
|
251
|
-
return response.text().then(function (_responseText) {
|
|
252
|
-
var result200 = null;
|
|
253
|
-
var resultData200 = _responseText === '' ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
254
|
-
result200 = Links.fromJS(resultData200);
|
|
255
|
-
return result200;
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
else if (status === 400) {
|
|
259
|
-
return response.text().then(function (_responseText) {
|
|
260
|
-
var result400 = null;
|
|
261
|
-
var resultData400 = _responseText === '' ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
262
|
-
result400 = ErrorResponse.fromJS(resultData400);
|
|
263
|
-
return throwException('A server side error occurred.', status, _responseText, _headers, result400);
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
else if (status !== 200 && status !== 204) {
|
|
267
|
-
return response.text().then(function (_responseText) {
|
|
268
|
-
return throwException('An unexpected server error occurred.', status, _responseText, _headers);
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
return Promise.resolve(null);
|
|
272
|
-
};
|
|
273
|
-
/**
|
|
274
|
-
* Retrieve settings types used in creating a Settings TapPackage
|
|
275
|
-
*/
|
|
276
|
-
RunnerClient.prototype.getSettingsTypes = function () {
|
|
277
|
-
var _this = this;
|
|
278
|
-
var url_ = this.baseUrl + '/componentsettings/types';
|
|
279
|
-
url_ = url_.replace(/[?&]$/, '');
|
|
280
|
-
var options_ = {
|
|
281
|
-
method: 'GET',
|
|
282
|
-
headers: {
|
|
283
|
-
Accept: 'application/json',
|
|
284
|
-
},
|
|
285
|
-
};
|
|
286
|
-
return this.http.fetch(url_, options_).then(function (_response) {
|
|
287
|
-
return _this.processGetSettingsTypes(_response);
|
|
288
|
-
});
|
|
289
|
-
};
|
|
290
|
-
RunnerClient.prototype.processGetSettingsTypes = function (response) {
|
|
291
|
-
var _this = this;
|
|
292
|
-
var status = response.status;
|
|
293
|
-
var _headers = {};
|
|
294
|
-
if (response.headers && response.headers.forEach) {
|
|
295
|
-
response.headers.forEach(function (v, k) { return (_headers[k] = v); });
|
|
296
|
-
}
|
|
297
|
-
if (status === 200) {
|
|
298
|
-
return response.text().then(function (_responseText) {
|
|
299
|
-
var result200 = null;
|
|
300
|
-
var resultData200 = _responseText === '' ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
301
|
-
if (Array.isArray(resultData200)) {
|
|
302
|
-
result200 = [];
|
|
303
|
-
for (var _i = 0, resultData200_2 = resultData200; _i < resultData200_2.length; _i++) {
|
|
304
|
-
var item = resultData200_2[_i];
|
|
305
|
-
result200.push(item);
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
else {
|
|
309
|
-
result200 = null;
|
|
310
|
-
}
|
|
311
|
-
return result200;
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
else if (status === 400) {
|
|
315
|
-
return response.text().then(function (_responseText) {
|
|
316
|
-
var result400 = null;
|
|
317
|
-
var resultData400 = _responseText === '' ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
318
|
-
result400 = ErrorResponse.fromJS(resultData400);
|
|
319
|
-
return throwException('A server side error occurred.', status, _responseText, _headers, result400);
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
|
-
else if (status !== 200 && status !== 204) {
|
|
323
|
-
return response.text().then(function (_responseText) {
|
|
324
|
-
return throwException('An unexpected server error occurred.', status, _responseText, _headers);
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
return Promise.resolve(null);
|
|
328
|
-
};
|
|
329
104
|
return RunnerClient;
|
|
330
105
|
}(BaseClient));
|
|
331
106
|
export { RunnerClient };
|
|
332
|
-
function throwException(message, status, response, headers, result) {
|
|
333
|
-
if (result !== null && result !== undefined)
|
|
334
|
-
throw result;
|
|
335
|
-
else
|
|
336
|
-
throw new ApiException(message, status, response, headers, null);
|
|
337
|
-
}
|
package/lib/SessionClient.d.ts
CHANGED
|
@@ -128,6 +128,11 @@ export declare class SessionClient extends BaseClient {
|
|
|
128
128
|
* @return Test plan changed
|
|
129
129
|
*/
|
|
130
130
|
setTestPlan(plan: TestPlan): Promise<TestPlan>;
|
|
131
|
+
/**
|
|
132
|
+
* Set the name of the test plan
|
|
133
|
+
* @param {string} testPlanName
|
|
134
|
+
*/
|
|
135
|
+
SetTestPlanName(testPlanName: string): Promise<void>;
|
|
131
136
|
/**
|
|
132
137
|
* Retrieve all validation errors present in the test plan
|
|
133
138
|
* @return Retrieved validation errors for loaded TestPlan
|
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 { LogList, Result, SessionEvent, TestRun, } from './DTOs';
|
|
27
|
+
import { BreakPoints, CommonContext, CommonSettings, DataGridControl, Image, Interaction, ListItemType, LogList, Result, RunStatus, SessionEvent, Setting, TestPlan, TestRun, TestStepType, TestStepValidationError, WatchDog, } from './DTOs';
|
|
28
28
|
import { JSONCodec } from 'nats.ws/cjs/nats.js';
|
|
29
29
|
import { BaseClient } from './BaseClient';
|
|
30
30
|
var SessionClient = /** @class */ (function (_super) {
|
|
@@ -128,7 +128,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
128
128
|
*/
|
|
129
129
|
SessionClient.prototype.getSessionLogs = function (id, levels, excludedSources, filterText, offset, limit) {
|
|
130
130
|
var getSessionLogsRequest = { id: id, levels: levels, excludedSources: excludedSources, filterText: filterText, offset: offset, limit: limit };
|
|
131
|
-
return this.request('GetSessionLogs', getSessionLogsRequest)
|
|
131
|
+
return this.request('GetSessionLogs', getSessionLogsRequest)
|
|
132
|
+
.then(function (logListJs) { return LogList.fromJS(logListJs); })
|
|
133
|
+
.then(this.success())
|
|
134
|
+
.catch(this.error());
|
|
132
135
|
};
|
|
133
136
|
/**
|
|
134
137
|
* Retrieve session log indexes
|
|
@@ -172,7 +175,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
172
175
|
* @return RunStatus retrieved
|
|
173
176
|
*/
|
|
174
177
|
SessionClient.prototype.getStatus = function (timeout) {
|
|
175
|
-
return this.request('GetStatus', timeout)
|
|
178
|
+
return this.request('GetStatus', timeout)
|
|
179
|
+
.then(function (runStatusJs) { return RunStatus.fromJS(runStatusJs); })
|
|
180
|
+
.then(this.success())
|
|
181
|
+
.catch(this.error());
|
|
176
182
|
};
|
|
177
183
|
/**
|
|
178
184
|
* Upload test plan XML
|
|
@@ -210,14 +216,20 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
210
216
|
* @return Test plan resources opened.
|
|
211
217
|
*/
|
|
212
218
|
SessionClient.prototype.resourcesOpen = function () {
|
|
213
|
-
return this.request('ResourcesOpen')
|
|
219
|
+
return this.request('ResourcesOpen')
|
|
220
|
+
.then(function (testPlanJs) { return TestPlan.fromJS(testPlanJs); })
|
|
221
|
+
.then(this.success())
|
|
222
|
+
.catch(this.error());
|
|
214
223
|
};
|
|
215
224
|
/**
|
|
216
225
|
* Test plan resources closed
|
|
217
226
|
* @return Test plan resources closed.
|
|
218
227
|
*/
|
|
219
228
|
SessionClient.prototype.resourcesClose = function () {
|
|
220
|
-
return this.request('ResourcesClose')
|
|
229
|
+
return this.request('ResourcesClose')
|
|
230
|
+
.then(function (testPlanJs) { return TestPlan.fromJS(testPlanJs); })
|
|
231
|
+
.then(this.success())
|
|
232
|
+
.catch(this.error());
|
|
221
233
|
};
|
|
222
234
|
/**
|
|
223
235
|
* Retrieve test plan or test step settings
|
|
@@ -225,7 +237,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
225
237
|
* @return List of settings retrieved
|
|
226
238
|
*/
|
|
227
239
|
SessionClient.prototype.getSettings = function (contextId) {
|
|
228
|
-
return this.request('GetSettings', contextId)
|
|
240
|
+
return this.request('GetSettings', contextId)
|
|
241
|
+
.then(function (settingArrayJs) { return settingArrayJs.map(function (settingJs) { return Setting.fromJS(settingJs); }); })
|
|
242
|
+
.then(this.success())
|
|
243
|
+
.catch(this.error());
|
|
229
244
|
};
|
|
230
245
|
/**
|
|
231
246
|
* Change test plan or test step settings
|
|
@@ -235,7 +250,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
235
250
|
*/
|
|
236
251
|
SessionClient.prototype.setSettings = function (contextId, settings) {
|
|
237
252
|
var setSettingsRequest = { contextId: contextId, settings: settings };
|
|
238
|
-
return this.request('SetSettings', setSettingsRequest)
|
|
253
|
+
return this.request('SetSettings', setSettingsRequest)
|
|
254
|
+
.then(function (settingArrayJs) { return settingArrayJs.map(function (settingJs) { return Setting.fromJS(settingJs); }); })
|
|
255
|
+
.then(this.success())
|
|
256
|
+
.catch(this.error());
|
|
239
257
|
};
|
|
240
258
|
/**
|
|
241
259
|
* Retrieve test plan structure
|
|
@@ -243,7 +261,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
243
261
|
* @return Test plan retrieved
|
|
244
262
|
*/
|
|
245
263
|
SessionClient.prototype.getTestPlan = function (properties) {
|
|
246
|
-
return this.request('GetTestPlan', properties)
|
|
264
|
+
return this.request('GetTestPlan', properties)
|
|
265
|
+
.then(function (testPlanJs) { return TestPlan.fromJS(testPlanJs); })
|
|
266
|
+
.then(this.success())
|
|
267
|
+
.catch(this.error());
|
|
247
268
|
};
|
|
248
269
|
/**
|
|
249
270
|
* Change test plan structure
|
|
@@ -251,14 +272,29 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
251
272
|
* @return Test plan changed
|
|
252
273
|
*/
|
|
253
274
|
SessionClient.prototype.setTestPlan = function (plan) {
|
|
254
|
-
return this.request('SetTestPlan', plan)
|
|
275
|
+
return this.request('SetTestPlan', plan)
|
|
276
|
+
.then(function (testPlanJs) { return TestPlan.fromJS(testPlanJs); })
|
|
277
|
+
.then(this.success())
|
|
278
|
+
.catch(this.error());
|
|
279
|
+
};
|
|
280
|
+
/**
|
|
281
|
+
* Set the name of the test plan
|
|
282
|
+
* @param {string} testPlanName
|
|
283
|
+
*/
|
|
284
|
+
SessionClient.prototype.SetTestPlanName = function (testPlanName) {
|
|
285
|
+
return this.request('SetTestPlanName', testPlanName).then(this.success()).catch(this.error());
|
|
255
286
|
};
|
|
256
287
|
/**
|
|
257
288
|
* Retrieve all validation errors present in the test plan
|
|
258
289
|
* @return Retrieved validation errors for loaded TestPlan
|
|
259
290
|
*/
|
|
260
291
|
SessionClient.prototype.getValidationErrors = function () {
|
|
261
|
-
return this.request('GetValidationErrors')
|
|
292
|
+
return this.request('GetValidationErrors')
|
|
293
|
+
.then(function (testStepValidationErrorArrayJs) {
|
|
294
|
+
return testStepValidationErrorArrayJs.map(function (testStepValidationErrorJs) { return TestStepValidationError.fromJS(testStepValidationErrorJs); });
|
|
295
|
+
})
|
|
296
|
+
.then(this.success())
|
|
297
|
+
.catch(this.error());
|
|
262
298
|
};
|
|
263
299
|
/**
|
|
264
300
|
* Retrieve or change common test step settings
|
|
@@ -266,7 +302,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
266
302
|
* @return Common test step settings retrieved or changed
|
|
267
303
|
*/
|
|
268
304
|
SessionClient.prototype.commonStepSettings = function (commonSettings) {
|
|
269
|
-
return this.request('CommonStepSettings', commonSettings)
|
|
305
|
+
return this.request('CommonStepSettings', commonSettings)
|
|
306
|
+
.then(function (commonSettingsJs) { return CommonSettings.fromJS(commonSettingsJs); })
|
|
307
|
+
.then(this.success())
|
|
308
|
+
.catch(this.error());
|
|
270
309
|
};
|
|
271
310
|
/**
|
|
272
311
|
* Retrieve or invoke common test step settings context menu items
|
|
@@ -277,6 +316,7 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
277
316
|
SessionClient.prototype.commonStepSettingsContextMenu = function (propertyName, commonContext) {
|
|
278
317
|
var commonStepSettingsContextRequest = { propertyName: propertyName, commonContext: commonContext };
|
|
279
318
|
return this.request('CommonStepSettingsContextMenu', commonStepSettingsContextRequest)
|
|
319
|
+
.then(function (commonContextJs) { return CommonContext.fromJS(commonContextJs); })
|
|
280
320
|
.then(this.success())
|
|
281
321
|
.catch(this.error());
|
|
282
322
|
};
|
|
@@ -293,7 +333,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
293
333
|
* @return Retrieved pending user input
|
|
294
334
|
*/
|
|
295
335
|
SessionClient.prototype.getUserInput = function (id) {
|
|
296
|
-
return this.request('GetUserInput', id)
|
|
336
|
+
return this.request('GetUserInput', id)
|
|
337
|
+
.then(function (interactionJs) { return Interaction.fromJS(interactionJs); })
|
|
338
|
+
.then(this.success())
|
|
339
|
+
.catch(this.error());
|
|
297
340
|
};
|
|
298
341
|
/**
|
|
299
342
|
* Modify or answer pending user input based on ID
|
|
@@ -301,7 +344,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
301
344
|
* @returns {Promise<Interaction>}
|
|
302
345
|
*/
|
|
303
346
|
SessionClient.prototype.setUserInput = function (interaction) {
|
|
304
|
-
return this.request('SetUserInput', interaction)
|
|
347
|
+
return this.request('SetUserInput', interaction)
|
|
348
|
+
.then(function (interactionJs) { return Interaction.fromJS(interactionJs); })
|
|
349
|
+
.then(this.success())
|
|
350
|
+
.catch(this.error());
|
|
305
351
|
};
|
|
306
352
|
/**
|
|
307
353
|
* Property context menu
|
|
@@ -314,7 +360,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
314
360
|
contextId: contextId,
|
|
315
361
|
propertyName: propertyName,
|
|
316
362
|
};
|
|
317
|
-
return this.request('GetContextMenu', propertyReferenceRequest)
|
|
363
|
+
return this.request('GetContextMenu', propertyReferenceRequest)
|
|
364
|
+
.then(function (settingArrayJs) { return settingArrayJs.map(function (settingJs) { return Setting.fromJS(settingJs); }); })
|
|
365
|
+
.then(this.success())
|
|
366
|
+
.catch(this.error());
|
|
318
367
|
};
|
|
319
368
|
/**
|
|
320
369
|
* Property context menu
|
|
@@ -329,7 +378,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
329
378
|
propertyName: propertyName,
|
|
330
379
|
contextMenu: contextMenu,
|
|
331
380
|
};
|
|
332
|
-
return this.request('SetContextMenu', setContextMenuRequest)
|
|
381
|
+
return this.request('SetContextMenu', setContextMenuRequest)
|
|
382
|
+
.then(function (settingArrayJs) { return settingArrayJs.map(function (settingJs) { return Setting.fromJS(settingJs); }); })
|
|
383
|
+
.then(this.success())
|
|
384
|
+
.catch(this.error());
|
|
333
385
|
};
|
|
334
386
|
/**
|
|
335
387
|
* Get data grid
|
|
@@ -342,7 +394,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
342
394
|
contextId: contextId,
|
|
343
395
|
propertyName: propertyName,
|
|
344
396
|
};
|
|
345
|
-
return this.request('GetDataGrid', propertyReferenceRequest)
|
|
397
|
+
return this.request('GetDataGrid', propertyReferenceRequest)
|
|
398
|
+
.then(function (dataGridControlJs) { return DataGridControl.fromJS(dataGridControlJs); })
|
|
399
|
+
.then(this.success())
|
|
400
|
+
.catch(this.error());
|
|
346
401
|
};
|
|
347
402
|
/**
|
|
348
403
|
* Set data grid
|
|
@@ -350,7 +405,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
350
405
|
*/
|
|
351
406
|
SessionClient.prototype.setDataGrid = function (contextId, propertyName, dataGridControl) {
|
|
352
407
|
var setDataGridRequest = { contextId: contextId, propertyName: propertyName, dataGridControl: dataGridControl };
|
|
353
|
-
return this.request('SetDataGrid', setDataGridRequest)
|
|
408
|
+
return this.request('SetDataGrid', setDataGridRequest)
|
|
409
|
+
.then(function (dataGridControlJs) { return DataGridControl.fromJS(dataGridControlJs); })
|
|
410
|
+
.then(this.success())
|
|
411
|
+
.catch(this.error());
|
|
354
412
|
};
|
|
355
413
|
/**
|
|
356
414
|
* Add item type to data grid
|
|
@@ -365,7 +423,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
365
423
|
propertyName: propertyName,
|
|
366
424
|
typeName: typeName,
|
|
367
425
|
};
|
|
368
|
-
return this.request('AddDataGridItemType', addDataGridItemTypeRequest)
|
|
426
|
+
return this.request('AddDataGridItemType', addDataGridItemTypeRequest)
|
|
427
|
+
.then(function (dataGridControlJs) { return DataGridControl.fromJS(dataGridControlJs); })
|
|
428
|
+
.then(this.success())
|
|
429
|
+
.catch(this.error());
|
|
369
430
|
};
|
|
370
431
|
/**
|
|
371
432
|
* Add item to data grid
|
|
@@ -378,7 +439,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
378
439
|
contextId: contextId,
|
|
379
440
|
propertyName: propertyName,
|
|
380
441
|
};
|
|
381
|
-
return this.request('AddDataGridItem', propertyReferenceRequest)
|
|
442
|
+
return this.request('AddDataGridItem', propertyReferenceRequest)
|
|
443
|
+
.then(function (dataGridControlJs) { return DataGridControl.fromJS(dataGridControlJs); })
|
|
444
|
+
.then(this.success())
|
|
445
|
+
.catch(this.error());
|
|
382
446
|
};
|
|
383
447
|
/**
|
|
384
448
|
* Get item types available in the data grid
|
|
@@ -391,14 +455,20 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
391
455
|
contextId: contextId,
|
|
392
456
|
propertyName: propertyName,
|
|
393
457
|
};
|
|
394
|
-
return this.request('GetDataGridTypes', propertyReferenceRequest)
|
|
458
|
+
return this.request('GetDataGridTypes', propertyReferenceRequest)
|
|
459
|
+
.then(function (listItemTypeArrayJs) { return listItemTypeArrayJs.map(function (listItemTypeJs) { return ListItemType.fromJS(listItemTypeJs); }); })
|
|
460
|
+
.then(this.success())
|
|
461
|
+
.catch(this.error());
|
|
395
462
|
};
|
|
396
463
|
/**
|
|
397
464
|
* Retrieve static available step type information.
|
|
398
465
|
* @return StepTypes retrieved
|
|
399
466
|
*/
|
|
400
467
|
SessionClient.prototype.getTestStepTypes = function () {
|
|
401
|
-
return this.request('GetTestStepTypes')
|
|
468
|
+
return this.request('GetTestStepTypes')
|
|
469
|
+
.then(function (testStepTypeArrayJs) { return testStepTypeArrayJs.map(function (testStepTypeJs) { return TestStepType.fromJS(testStepTypeJs); }); })
|
|
470
|
+
.then(this.success())
|
|
471
|
+
.catch(this.error());
|
|
402
472
|
};
|
|
403
473
|
/**
|
|
404
474
|
* Pause test plan execution at next possible test step
|
|
@@ -410,7 +480,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
410
480
|
* Retrieve breakpoints set in test plan
|
|
411
481
|
*/
|
|
412
482
|
SessionClient.prototype.getBreakpoints = function () {
|
|
413
|
-
return this.request('SetPauseNext')
|
|
483
|
+
return this.request('SetPauseNext')
|
|
484
|
+
.then(function (breakPointsJs) { return BreakPoints.fromJS(breakPointsJs); })
|
|
485
|
+
.then(this.success())
|
|
486
|
+
.catch(this.error());
|
|
414
487
|
};
|
|
415
488
|
/**
|
|
416
489
|
* Set breakpoints in test plan
|
|
@@ -418,7 +491,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
418
491
|
* @return BreakPoints retrieved
|
|
419
492
|
*/
|
|
420
493
|
SessionClient.prototype.setBreakpoints = function (breakPointsDto) {
|
|
421
|
-
return this.request('SetBreakpoints', breakPointsDto)
|
|
494
|
+
return this.request('SetBreakpoints', breakPointsDto)
|
|
495
|
+
.then(function (breakPointsJs) { return BreakPoints.fromJS(breakPointsJs); })
|
|
496
|
+
.then(this.success())
|
|
497
|
+
.catch(this.error());
|
|
422
498
|
};
|
|
423
499
|
/**
|
|
424
500
|
* Jump test plan execution to step. Execution state must be 'breaking'.
|
|
@@ -433,7 +509,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
433
509
|
* @return RunStatus retrieved
|
|
434
510
|
*/
|
|
435
511
|
SessionClient.prototype.runTestPlanMetadata = function (parameters) {
|
|
436
|
-
return this.request('RunTestPlanMetadata', parameters)
|
|
512
|
+
return this.request('RunTestPlanMetadata', parameters)
|
|
513
|
+
.then(function (runStatusJs) { return RunStatus.fromJS(runStatusJs); })
|
|
514
|
+
.then(this.success())
|
|
515
|
+
.catch(this.error());
|
|
437
516
|
};
|
|
438
517
|
/**
|
|
439
518
|
* Abort test plan execution
|
|
@@ -451,7 +530,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
451
530
|
* Retrieves installed packages in this session
|
|
452
531
|
*/
|
|
453
532
|
SessionClient.prototype.getImage = function () {
|
|
454
|
-
return this.request('GetImage')
|
|
533
|
+
return this.request('GetImage')
|
|
534
|
+
.then(function (imageJs) { return Image.fromJS(imageJs); })
|
|
535
|
+
.then(this.success())
|
|
536
|
+
.catch(this.error());
|
|
455
537
|
};
|
|
456
538
|
/**
|
|
457
539
|
* Retrieves session readiness
|
|
@@ -463,14 +545,20 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
463
545
|
* Retrieves watchdog
|
|
464
546
|
*/
|
|
465
547
|
SessionClient.prototype.getWatchDog = function () {
|
|
466
|
-
return this.request('GetWatchDog')
|
|
548
|
+
return this.request('GetWatchDog')
|
|
549
|
+
.then(function (watchDogJs) { return WatchDog.fromJS(watchDogJs); })
|
|
550
|
+
.then(this.success())
|
|
551
|
+
.catch(this.error());
|
|
467
552
|
};
|
|
468
553
|
/**
|
|
469
554
|
* Sets a new watchdog
|
|
470
555
|
* @param {WatchDog} watchDog
|
|
471
556
|
*/
|
|
472
557
|
SessionClient.prototype.setWatchDog = function (watchDog) {
|
|
473
|
-
return this.request('SetWatchDog', watchDog)
|
|
558
|
+
return this.request('SetWatchDog', watchDog)
|
|
559
|
+
.then(function (watchDogJs) { return WatchDog.fromJS(watchDogJs); })
|
|
560
|
+
.then(this.success())
|
|
561
|
+
.catch(this.error());
|
|
474
562
|
};
|
|
475
563
|
/**
|
|
476
564
|
* Retrieve settings types used in creating a Settings TapPackage
|