@opentap/runner-client 1.0.0-beta.79 → 1.0.0-beta.81
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 +1 -1
- package/lib/SessionClient.js +109 -28
- 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
|
@@ -221,7 +221,7 @@ export declare class SessionClient extends BaseClient {
|
|
|
221
221
|
* Retrieve static available step type information.
|
|
222
222
|
* @return StepTypes retrieved
|
|
223
223
|
*/
|
|
224
|
-
|
|
224
|
+
getStepTypes(): Promise<TestStepType[]>;
|
|
225
225
|
/**
|
|
226
226
|
* Pause test plan execution at next possible test step
|
|
227
227
|
*/
|
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,7 +272,10 @@ 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());
|
|
255
279
|
};
|
|
256
280
|
/**
|
|
257
281
|
* Set the name of the test plan
|
|
@@ -265,7 +289,12 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
265
289
|
* @return Retrieved validation errors for loaded TestPlan
|
|
266
290
|
*/
|
|
267
291
|
SessionClient.prototype.getValidationErrors = function () {
|
|
268
|
-
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());
|
|
269
298
|
};
|
|
270
299
|
/**
|
|
271
300
|
* Retrieve or change common test step settings
|
|
@@ -273,7 +302,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
273
302
|
* @return Common test step settings retrieved or changed
|
|
274
303
|
*/
|
|
275
304
|
SessionClient.prototype.commonStepSettings = function (commonSettings) {
|
|
276
|
-
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());
|
|
277
309
|
};
|
|
278
310
|
/**
|
|
279
311
|
* Retrieve or invoke common test step settings context menu items
|
|
@@ -284,6 +316,7 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
284
316
|
SessionClient.prototype.commonStepSettingsContextMenu = function (propertyName, commonContext) {
|
|
285
317
|
var commonStepSettingsContextRequest = { propertyName: propertyName, commonContext: commonContext };
|
|
286
318
|
return this.request('CommonStepSettingsContextMenu', commonStepSettingsContextRequest)
|
|
319
|
+
.then(function (commonContextJs) { return CommonContext.fromJS(commonContextJs); })
|
|
287
320
|
.then(this.success())
|
|
288
321
|
.catch(this.error());
|
|
289
322
|
};
|
|
@@ -300,7 +333,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
300
333
|
* @return Retrieved pending user input
|
|
301
334
|
*/
|
|
302
335
|
SessionClient.prototype.getUserInput = function (id) {
|
|
303
|
-
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());
|
|
304
340
|
};
|
|
305
341
|
/**
|
|
306
342
|
* Modify or answer pending user input based on ID
|
|
@@ -308,7 +344,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
308
344
|
* @returns {Promise<Interaction>}
|
|
309
345
|
*/
|
|
310
346
|
SessionClient.prototype.setUserInput = function (interaction) {
|
|
311
|
-
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());
|
|
312
351
|
};
|
|
313
352
|
/**
|
|
314
353
|
* Property context menu
|
|
@@ -321,7 +360,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
321
360
|
contextId: contextId,
|
|
322
361
|
propertyName: propertyName,
|
|
323
362
|
};
|
|
324
|
-
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());
|
|
325
367
|
};
|
|
326
368
|
/**
|
|
327
369
|
* Property context menu
|
|
@@ -336,7 +378,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
336
378
|
propertyName: propertyName,
|
|
337
379
|
contextMenu: contextMenu,
|
|
338
380
|
};
|
|
339
|
-
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());
|
|
340
385
|
};
|
|
341
386
|
/**
|
|
342
387
|
* Get data grid
|
|
@@ -349,7 +394,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
349
394
|
contextId: contextId,
|
|
350
395
|
propertyName: propertyName,
|
|
351
396
|
};
|
|
352
|
-
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());
|
|
353
401
|
};
|
|
354
402
|
/**
|
|
355
403
|
* Set data grid
|
|
@@ -357,7 +405,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
357
405
|
*/
|
|
358
406
|
SessionClient.prototype.setDataGrid = function (contextId, propertyName, dataGridControl) {
|
|
359
407
|
var setDataGridRequest = { contextId: contextId, propertyName: propertyName, dataGridControl: dataGridControl };
|
|
360
|
-
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());
|
|
361
412
|
};
|
|
362
413
|
/**
|
|
363
414
|
* Add item type to data grid
|
|
@@ -372,7 +423,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
372
423
|
propertyName: propertyName,
|
|
373
424
|
typeName: typeName,
|
|
374
425
|
};
|
|
375
|
-
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());
|
|
376
430
|
};
|
|
377
431
|
/**
|
|
378
432
|
* Add item to data grid
|
|
@@ -385,7 +439,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
385
439
|
contextId: contextId,
|
|
386
440
|
propertyName: propertyName,
|
|
387
441
|
};
|
|
388
|
-
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());
|
|
389
446
|
};
|
|
390
447
|
/**
|
|
391
448
|
* Get item types available in the data grid
|
|
@@ -398,14 +455,20 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
398
455
|
contextId: contextId,
|
|
399
456
|
propertyName: propertyName,
|
|
400
457
|
};
|
|
401
|
-
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());
|
|
402
462
|
};
|
|
403
463
|
/**
|
|
404
464
|
* Retrieve static available step type information.
|
|
405
465
|
* @return StepTypes retrieved
|
|
406
466
|
*/
|
|
407
|
-
SessionClient.prototype.
|
|
408
|
-
return this.request('
|
|
467
|
+
SessionClient.prototype.getStepTypes = function () {
|
|
468
|
+
return this.request('GetStepTypes')
|
|
469
|
+
.then(function (testStepTypeArrayJs) { return testStepTypeArrayJs.map(function (testStepTypeJs) { return TestStepType.fromJS(testStepTypeJs); }); })
|
|
470
|
+
.then(this.success())
|
|
471
|
+
.catch(this.error());
|
|
409
472
|
};
|
|
410
473
|
/**
|
|
411
474
|
* Pause test plan execution at next possible test step
|
|
@@ -417,7 +480,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
417
480
|
* Retrieve breakpoints set in test plan
|
|
418
481
|
*/
|
|
419
482
|
SessionClient.prototype.getBreakpoints = function () {
|
|
420
|
-
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());
|
|
421
487
|
};
|
|
422
488
|
/**
|
|
423
489
|
* Set breakpoints in test plan
|
|
@@ -425,7 +491,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
425
491
|
* @return BreakPoints retrieved
|
|
426
492
|
*/
|
|
427
493
|
SessionClient.prototype.setBreakpoints = function (breakPointsDto) {
|
|
428
|
-
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());
|
|
429
498
|
};
|
|
430
499
|
/**
|
|
431
500
|
* Jump test plan execution to step. Execution state must be 'breaking'.
|
|
@@ -440,7 +509,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
440
509
|
* @return RunStatus retrieved
|
|
441
510
|
*/
|
|
442
511
|
SessionClient.prototype.runTestPlanMetadata = function (parameters) {
|
|
443
|
-
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());
|
|
444
516
|
};
|
|
445
517
|
/**
|
|
446
518
|
* Abort test plan execution
|
|
@@ -458,7 +530,10 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
458
530
|
* Retrieves installed packages in this session
|
|
459
531
|
*/
|
|
460
532
|
SessionClient.prototype.getImage = function () {
|
|
461
|
-
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());
|
|
462
537
|
};
|
|
463
538
|
/**
|
|
464
539
|
* Retrieves session readiness
|
|
@@ -470,14 +545,20 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
470
545
|
* Retrieves watchdog
|
|
471
546
|
*/
|
|
472
547
|
SessionClient.prototype.getWatchDog = function () {
|
|
473
|
-
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());
|
|
474
552
|
};
|
|
475
553
|
/**
|
|
476
554
|
* Sets a new watchdog
|
|
477
555
|
* @param {WatchDog} watchDog
|
|
478
556
|
*/
|
|
479
557
|
SessionClient.prototype.setWatchDog = function (watchDog) {
|
|
480
|
-
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());
|
|
481
562
|
};
|
|
482
563
|
/**
|
|
483
564
|
* Retrieve settings types used in creating a Settings TapPackage
|