1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
12 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
13 | return new (P || (P = Promise))(function (resolve, reject) {
|
14 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
15 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
16 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
17 | step((generator = generator.apply(thisArg, _arguments || [])).next());
|
18 | });
|
19 | };
|
20 | Object.defineProperty(exports, "__esModule", { value: true });
|
21 | exports.TestPlanApi = void 0;
|
22 | const basem = require("./ClientApiBases");
|
23 | const TestPlanInterfaces = require("./interfaces/TestPlanInterfaces");
|
24 | class TestPlanApi extends basem.ClientApiBase {
|
25 | constructor(baseUrl, handlers, options) {
|
26 | super(baseUrl, handlers, 'node-TestPlan-api', options);
|
27 | }
|
28 | |
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 | createTestConfiguration(testConfigurationCreateUpdateParameters, project) {
|
35 | return __awaiter(this, void 0, void 0, function* () {
|
36 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
37 | let routeValues = {
|
38 | project: project
|
39 | };
|
40 | try {
|
41 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "8369318e-38fa-4e84-9043-4b2a75d2c256", routeValues);
|
42 | let url = verData.requestUrl;
|
43 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
44 | let res;
|
45 | res = yield this.rest.create(url, testConfigurationCreateUpdateParameters, options);
|
46 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestConfiguration, false);
|
47 | resolve(ret);
|
48 | }
|
49 | catch (err) {
|
50 | reject(err);
|
51 | }
|
52 | }));
|
53 | });
|
54 | }
|
55 | |
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 | deleteTestConfguration(project, testConfiguartionId) {
|
62 | return __awaiter(this, void 0, void 0, function* () {
|
63 | if (testConfiguartionId == null) {
|
64 | throw new TypeError('testConfiguartionId can not be null or undefined');
|
65 | }
|
66 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
67 | let routeValues = {
|
68 | project: project
|
69 | };
|
70 | let queryValues = {
|
71 | testConfiguartionId: testConfiguartionId,
|
72 | };
|
73 | try {
|
74 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "8369318e-38fa-4e84-9043-4b2a75d2c256", routeValues, queryValues);
|
75 | let url = verData.requestUrl;
|
76 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
77 | let res;
|
78 | res = yield this.rest.del(url, options);
|
79 | let ret = this.formatResponse(res.result, null, false);
|
80 | resolve(ret);
|
81 | }
|
82 | catch (err) {
|
83 | reject(err);
|
84 | }
|
85 | }));
|
86 | });
|
87 | }
|
88 | |
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 | getTestConfigurationById(project, testConfigurationId) {
|
95 | return __awaiter(this, void 0, void 0, function* () {
|
96 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
97 | let routeValues = {
|
98 | project: project,
|
99 | testConfigurationId: testConfigurationId
|
100 | };
|
101 | try {
|
102 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "8369318e-38fa-4e84-9043-4b2a75d2c256", routeValues);
|
103 | let url = verData.requestUrl;
|
104 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
105 | let res;
|
106 | res = yield this.rest.get(url, options);
|
107 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestConfiguration, false);
|
108 | resolve(ret);
|
109 | }
|
110 | catch (err) {
|
111 | reject(err);
|
112 | }
|
113 | }));
|
114 | });
|
115 | }
|
116 | |
117 |
|
118 |
|
119 |
|
120 |
|
121 |
|
122 | getTestConfigurations(project, continuationToken) {
|
123 | return __awaiter(this, void 0, void 0, function* () {
|
124 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
125 | let routeValues = {
|
126 | project: project
|
127 | };
|
128 | let queryValues = {
|
129 | continuationToken: continuationToken,
|
130 | };
|
131 | try {
|
132 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "8369318e-38fa-4e84-9043-4b2a75d2c256", routeValues, queryValues);
|
133 | let url = verData.requestUrl;
|
134 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
135 | let res;
|
136 | res = yield this.rest.get(url, options);
|
137 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestConfiguration, true);
|
138 | resolve(ret);
|
139 | }
|
140 | catch (err) {
|
141 | reject(err);
|
142 | }
|
143 | }));
|
144 | });
|
145 | }
|
146 | |
147 |
|
148 |
|
149 |
|
150 |
|
151 |
|
152 |
|
153 | updateTestConfiguration(testConfigurationCreateUpdateParameters, project, testConfiguartionId) {
|
154 | return __awaiter(this, void 0, void 0, function* () {
|
155 | if (testConfiguartionId == null) {
|
156 | throw new TypeError('testConfiguartionId can not be null or undefined');
|
157 | }
|
158 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
159 | let routeValues = {
|
160 | project: project
|
161 | };
|
162 | let queryValues = {
|
163 | testConfiguartionId: testConfiguartionId,
|
164 | };
|
165 | try {
|
166 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "8369318e-38fa-4e84-9043-4b2a75d2c256", routeValues, queryValues);
|
167 | let url = verData.requestUrl;
|
168 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
169 | let res;
|
170 | res = yield this.rest.update(url, testConfigurationCreateUpdateParameters, options);
|
171 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestConfiguration, false);
|
172 | resolve(ret);
|
173 | }
|
174 | catch (err) {
|
175 | reject(err);
|
176 | }
|
177 | }));
|
178 | });
|
179 | }
|
180 | |
181 |
|
182 |
|
183 |
|
184 |
|
185 |
|
186 |
|
187 |
|
188 |
|
189 |
|
190 | getTestEntityCountByPlanId(project, planId, states, outcome, configurations, testers, assignedTo, entity) {
|
191 | return __awaiter(this, void 0, void 0, function* () {
|
192 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
193 | let routeValues = {
|
194 | project: project,
|
195 | planId: planId
|
196 | };
|
197 | let queryValues = {
|
198 | states: states,
|
199 | outcome: outcome,
|
200 | configurations: configurations,
|
201 | testers: testers,
|
202 | assignedTo: assignedTo,
|
203 | entity: entity,
|
204 | };
|
205 | try {
|
206 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "300578da-7b40-4c1e-9542-7aed6029e504", routeValues, queryValues);
|
207 | let url = verData.requestUrl;
|
208 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
209 | let res;
|
210 | res = yield this.rest.get(url, options);
|
211 | let ret = this.formatResponse(res.result, null, true);
|
212 | resolve(ret);
|
213 | }
|
214 | catch (err) {
|
215 | reject(err);
|
216 | }
|
217 | }));
|
218 | });
|
219 | }
|
220 | |
221 |
|
222 |
|
223 |
|
224 |
|
225 |
|
226 | createTestPlan(testPlanCreateParams, project) {
|
227 | return __awaiter(this, void 0, void 0, function* () {
|
228 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
229 | let routeValues = {
|
230 | project: project
|
231 | };
|
232 | try {
|
233 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "0e292477-a0c2-47f3-a9b6-34f153d627f4", routeValues);
|
234 | let url = verData.requestUrl;
|
235 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
236 | let res;
|
237 | res = yield this.rest.create(url, testPlanCreateParams, options);
|
238 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestPlan, false);
|
239 | resolve(ret);
|
240 | }
|
241 | catch (err) {
|
242 | reject(err);
|
243 | }
|
244 | }));
|
245 | });
|
246 | }
|
247 | |
248 |
|
249 |
|
250 |
|
251 |
|
252 |
|
253 | deleteTestPlan(project, planId) {
|
254 | return __awaiter(this, void 0, void 0, function* () {
|
255 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
256 | let routeValues = {
|
257 | project: project,
|
258 | planId: planId
|
259 | };
|
260 | try {
|
261 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "0e292477-a0c2-47f3-a9b6-34f153d627f4", routeValues);
|
262 | let url = verData.requestUrl;
|
263 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
264 | let res;
|
265 | res = yield this.rest.del(url, options);
|
266 | let ret = this.formatResponse(res.result, null, false);
|
267 | resolve(ret);
|
268 | }
|
269 | catch (err) {
|
270 | reject(err);
|
271 | }
|
272 | }));
|
273 | });
|
274 | }
|
275 | |
276 |
|
277 |
|
278 |
|
279 |
|
280 |
|
281 | getTestPlanById(project, planId) {
|
282 | return __awaiter(this, void 0, void 0, function* () {
|
283 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
284 | let routeValues = {
|
285 | project: project,
|
286 | planId: planId
|
287 | };
|
288 | try {
|
289 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "0e292477-a0c2-47f3-a9b6-34f153d627f4", routeValues);
|
290 | let url = verData.requestUrl;
|
291 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
292 | let res;
|
293 | res = yield this.rest.get(url, options);
|
294 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestPlan, false);
|
295 | resolve(ret);
|
296 | }
|
297 | catch (err) {
|
298 | reject(err);
|
299 | }
|
300 | }));
|
301 | });
|
302 | }
|
303 | |
304 |
|
305 |
|
306 |
|
307 |
|
308 |
|
309 |
|
310 |
|
311 |
|
312 | getTestPlans(project, owner, continuationToken, includePlanDetails, filterActivePlans) {
|
313 | return __awaiter(this, void 0, void 0, function* () {
|
314 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
315 | let routeValues = {
|
316 | project: project
|
317 | };
|
318 | let queryValues = {
|
319 | owner: owner,
|
320 | continuationToken: continuationToken,
|
321 | includePlanDetails: includePlanDetails,
|
322 | filterActivePlans: filterActivePlans,
|
323 | };
|
324 | try {
|
325 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "0e292477-a0c2-47f3-a9b6-34f153d627f4", routeValues, queryValues);
|
326 | let url = verData.requestUrl;
|
327 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
328 | let res;
|
329 | res = yield this.rest.get(url, options);
|
330 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestPlan, true);
|
331 | resolve(ret);
|
332 | }
|
333 | catch (err) {
|
334 | reject(err);
|
335 | }
|
336 | }));
|
337 | });
|
338 | }
|
339 | |
340 |
|
341 |
|
342 |
|
343 |
|
344 |
|
345 |
|
346 | updateTestPlan(testPlanUpdateParams, project, planId) {
|
347 | return __awaiter(this, void 0, void 0, function* () {
|
348 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
349 | let routeValues = {
|
350 | project: project,
|
351 | planId: planId
|
352 | };
|
353 | try {
|
354 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "0e292477-a0c2-47f3-a9b6-34f153d627f4", routeValues);
|
355 | let url = verData.requestUrl;
|
356 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
357 | let res;
|
358 | res = yield this.rest.update(url, testPlanUpdateParams, options);
|
359 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestPlan, false);
|
360 | resolve(ret);
|
361 | }
|
362 | catch (err) {
|
363 | reject(err);
|
364 | }
|
365 | }));
|
366 | });
|
367 | }
|
368 | |
369 |
|
370 |
|
371 |
|
372 |
|
373 |
|
374 |
|
375 | getSuiteEntries(project, suiteId, suiteEntryType) {
|
376 | return __awaiter(this, void 0, void 0, function* () {
|
377 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
378 | let routeValues = {
|
379 | project: project,
|
380 | suiteId: suiteId
|
381 | };
|
382 | let queryValues = {
|
383 | suiteEntryType: suiteEntryType,
|
384 | };
|
385 | try {
|
386 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "d6733edf-72f1-4252-925b-c560dfe9b75a", routeValues, queryValues);
|
387 | let url = verData.requestUrl;
|
388 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
389 | let res;
|
390 | res = yield this.rest.get(url, options);
|
391 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.SuiteEntry, true);
|
392 | resolve(ret);
|
393 | }
|
394 | catch (err) {
|
395 | reject(err);
|
396 | }
|
397 | }));
|
398 | });
|
399 | }
|
400 | |
401 |
|
402 |
|
403 |
|
404 |
|
405 |
|
406 |
|
407 | reorderSuiteEntries(suiteEntries, project, suiteId) {
|
408 | return __awaiter(this, void 0, void 0, function* () {
|
409 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
410 | let routeValues = {
|
411 | project: project,
|
412 | suiteId: suiteId
|
413 | };
|
414 | try {
|
415 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "d6733edf-72f1-4252-925b-c560dfe9b75a", routeValues);
|
416 | let url = verData.requestUrl;
|
417 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
418 | let res;
|
419 | res = yield this.rest.update(url, suiteEntries, options);
|
420 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.SuiteEntry, true);
|
421 | resolve(ret);
|
422 | }
|
423 | catch (err) {
|
424 | reject(err);
|
425 | }
|
426 | }));
|
427 | });
|
428 | }
|
429 | |
430 |
|
431 |
|
432 |
|
433 |
|
434 |
|
435 |
|
436 |
|
437 | createBulkTestSuites(testSuiteCreateParams, project, planId, parentSuiteId) {
|
438 | return __awaiter(this, void 0, void 0, function* () {
|
439 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
440 | let routeValues = {
|
441 | project: project,
|
442 | planId: planId,
|
443 | parentSuiteId: parentSuiteId
|
444 | };
|
445 | try {
|
446 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "1e58fbe6-1761-43ce-97f6-5492ec9d438e", routeValues);
|
447 | let url = verData.requestUrl;
|
448 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
449 | let res;
|
450 | res = yield this.rest.create(url, testSuiteCreateParams, options);
|
451 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestSuite, true);
|
452 | resolve(ret);
|
453 | }
|
454 | catch (err) {
|
455 | reject(err);
|
456 | }
|
457 | }));
|
458 | });
|
459 | }
|
460 | |
461 |
|
462 |
|
463 |
|
464 |
|
465 |
|
466 |
|
467 | createTestSuite(testSuiteCreateParams, project, planId) {
|
468 | return __awaiter(this, void 0, void 0, function* () {
|
469 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
470 | let routeValues = {
|
471 | project: project,
|
472 | planId: planId
|
473 | };
|
474 | try {
|
475 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "1046d5d3-ab61-4ca7-a65a-36118a978256", routeValues);
|
476 | let url = verData.requestUrl;
|
477 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
478 | let res;
|
479 | res = yield this.rest.create(url, testSuiteCreateParams, options);
|
480 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestSuite, false);
|
481 | resolve(ret);
|
482 | }
|
483 | catch (err) {
|
484 | reject(err);
|
485 | }
|
486 | }));
|
487 | });
|
488 | }
|
489 | |
490 |
|
491 |
|
492 |
|
493 |
|
494 |
|
495 |
|
496 | deleteTestSuite(project, planId, suiteId) {
|
497 | return __awaiter(this, void 0, void 0, function* () {
|
498 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
499 | let routeValues = {
|
500 | project: project,
|
501 | planId: planId,
|
502 | suiteId: suiteId
|
503 | };
|
504 | try {
|
505 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "1046d5d3-ab61-4ca7-a65a-36118a978256", routeValues);
|
506 | let url = verData.requestUrl;
|
507 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
508 | let res;
|
509 | res = yield this.rest.del(url, options);
|
510 | let ret = this.formatResponse(res.result, null, false);
|
511 | resolve(ret);
|
512 | }
|
513 | catch (err) {
|
514 | reject(err);
|
515 | }
|
516 | }));
|
517 | });
|
518 | }
|
519 | |
520 |
|
521 |
|
522 |
|
523 |
|
524 |
|
525 |
|
526 |
|
527 | getTestSuiteById(project, planId, suiteId, expand) {
|
528 | return __awaiter(this, void 0, void 0, function* () {
|
529 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
530 | let routeValues = {
|
531 | project: project,
|
532 | planId: planId,
|
533 | suiteId: suiteId
|
534 | };
|
535 | let queryValues = {
|
536 | expand: expand,
|
537 | };
|
538 | try {
|
539 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "1046d5d3-ab61-4ca7-a65a-36118a978256", routeValues, queryValues);
|
540 | let url = verData.requestUrl;
|
541 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
542 | let res;
|
543 | res = yield this.rest.get(url, options);
|
544 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestSuite, false);
|
545 | resolve(ret);
|
546 | }
|
547 | catch (err) {
|
548 | reject(err);
|
549 | }
|
550 | }));
|
551 | });
|
552 | }
|
553 | |
554 |
|
555 |
|
556 |
|
557 |
|
558 |
|
559 |
|
560 |
|
561 |
|
562 | getTestSuitesForPlan(project, planId, expand, continuationToken, asTreeView) {
|
563 | return __awaiter(this, void 0, void 0, function* () {
|
564 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
565 | let routeValues = {
|
566 | project: project,
|
567 | planId: planId
|
568 | };
|
569 | let queryValues = {
|
570 | expand: expand,
|
571 | continuationToken: continuationToken,
|
572 | asTreeView: asTreeView,
|
573 | };
|
574 | try {
|
575 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "1046d5d3-ab61-4ca7-a65a-36118a978256", routeValues, queryValues);
|
576 | let url = verData.requestUrl;
|
577 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
578 | let res;
|
579 | res = yield this.rest.get(url, options);
|
580 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestSuite, true);
|
581 | resolve(ret);
|
582 | }
|
583 | catch (err) {
|
584 | reject(err);
|
585 | }
|
586 | }));
|
587 | });
|
588 | }
|
589 | |
590 |
|
591 |
|
592 |
|
593 |
|
594 |
|
595 |
|
596 |
|
597 | updateTestSuite(testSuiteUpdateParams, project, planId, suiteId) {
|
598 | return __awaiter(this, void 0, void 0, function* () {
|
599 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
600 | let routeValues = {
|
601 | project: project,
|
602 | planId: planId,
|
603 | suiteId: suiteId
|
604 | };
|
605 | try {
|
606 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "1046d5d3-ab61-4ca7-a65a-36118a978256", routeValues);
|
607 | let url = verData.requestUrl;
|
608 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
609 | let res;
|
610 | res = yield this.rest.update(url, testSuiteUpdateParams, options);
|
611 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestSuite, false);
|
612 | resolve(ret);
|
613 | }
|
614 | catch (err) {
|
615 | reject(err);
|
616 | }
|
617 | }));
|
618 | });
|
619 | }
|
620 | |
621 |
|
622 |
|
623 |
|
624 |
|
625 | getSuitesByTestCaseId(testCaseId) {
|
626 | return __awaiter(this, void 0, void 0, function* () {
|
627 | if (testCaseId == null) {
|
628 | throw new TypeError('testCaseId can not be null or undefined');
|
629 | }
|
630 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
631 | let routeValues = {};
|
632 | let queryValues = {
|
633 | testCaseId: testCaseId,
|
634 | };
|
635 | try {
|
636 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "a4080e84-f17b-4fad-84f1-7960b6525bf2", routeValues, queryValues);
|
637 | let url = verData.requestUrl;
|
638 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
639 | let res;
|
640 | res = yield this.rest.get(url, options);
|
641 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestSuite, true);
|
642 | resolve(ret);
|
643 | }
|
644 | catch (err) {
|
645 | reject(err);
|
646 | }
|
647 | }));
|
648 | });
|
649 | }
|
650 | |
651 |
|
652 |
|
653 |
|
654 |
|
655 |
|
656 |
|
657 |
|
658 | addTestCasesToSuite(suiteTestCaseCreateUpdateParameters, project, planId, suiteId) {
|
659 | return __awaiter(this, void 0, void 0, function* () {
|
660 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
661 | let routeValues = {
|
662 | project: project,
|
663 | planId: planId,
|
664 | suiteId: suiteId
|
665 | };
|
666 | try {
|
667 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "testplan", "a9bd61ac-45cf-4d13-9441-43dcd01edf8d", routeValues);
|
668 | let url = verData.requestUrl;
|
669 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
670 | let res;
|
671 | res = yield this.rest.create(url, suiteTestCaseCreateUpdateParameters, options);
|
672 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestCase, true);
|
673 | resolve(ret);
|
674 | }
|
675 | catch (err) {
|
676 | reject(err);
|
677 | }
|
678 | }));
|
679 | });
|
680 | }
|
681 | |
682 |
|
683 |
|
684 |
|
685 |
|
686 |
|
687 |
|
688 |
|
689 |
|
690 |
|
691 | getTestCase(project, planId, suiteId, testCaseId, witFields, returnIdentityRef) {
|
692 | return __awaiter(this, void 0, void 0, function* () {
|
693 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
694 | let routeValues = {
|
695 | project: project,
|
696 | planId: planId,
|
697 | suiteId: suiteId,
|
698 | testCaseId: testCaseId
|
699 | };
|
700 | let queryValues = {
|
701 | witFields: witFields,
|
702 | returnIdentityRef: returnIdentityRef,
|
703 | };
|
704 | try {
|
705 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "testplan", "a9bd61ac-45cf-4d13-9441-43dcd01edf8d", routeValues, queryValues);
|
706 | let url = verData.requestUrl;
|
707 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
708 | let res;
|
709 | res = yield this.rest.get(url, options);
|
710 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestCase, true);
|
711 | resolve(ret);
|
712 | }
|
713 | catch (err) {
|
714 | reject(err);
|
715 | }
|
716 | }));
|
717 | });
|
718 | }
|
719 | |
720 |
|
721 |
|
722 |
|
723 |
|
724 |
|
725 |
|
726 |
|
727 |
|
728 |
|
729 |
|
730 |
|
731 |
|
732 |
|
733 |
|
734 | getTestCaseList(project, planId, suiteId, testIds, configurationIds, witFields, continuationToken, returnIdentityRef, expand, excludeFlags, isRecursive) {
|
735 | return __awaiter(this, void 0, void 0, function* () {
|
736 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
737 | let routeValues = {
|
738 | project: project,
|
739 | planId: planId,
|
740 | suiteId: suiteId
|
741 | };
|
742 | let queryValues = {
|
743 | testIds: testIds,
|
744 | configurationIds: configurationIds,
|
745 | witFields: witFields,
|
746 | continuationToken: continuationToken,
|
747 | returnIdentityRef: returnIdentityRef,
|
748 | expand: expand,
|
749 | excludeFlags: excludeFlags,
|
750 | isRecursive: isRecursive,
|
751 | };
|
752 | try {
|
753 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "testplan", "a9bd61ac-45cf-4d13-9441-43dcd01edf8d", routeValues, queryValues);
|
754 | let url = verData.requestUrl;
|
755 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
756 | let res;
|
757 | res = yield this.rest.get(url, options);
|
758 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestCase, true);
|
759 | resolve(ret);
|
760 | }
|
761 | catch (err) {
|
762 | reject(err);
|
763 | }
|
764 | }));
|
765 | });
|
766 | }
|
767 | |
768 |
|
769 |
|
770 |
|
771 |
|
772 |
|
773 |
|
774 |
|
775 | removeTestCasesFromSuite(project, planId, suiteId, testCaseIds) {
|
776 | return __awaiter(this, void 0, void 0, function* () {
|
777 | if (testCaseIds == null) {
|
778 | throw new TypeError('testCaseIds can not be null or undefined');
|
779 | }
|
780 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
781 | let routeValues = {
|
782 | project: project,
|
783 | planId: planId,
|
784 | suiteId: suiteId
|
785 | };
|
786 | let queryValues = {
|
787 | testCaseIds: testCaseIds,
|
788 | };
|
789 | try {
|
790 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "testplan", "a9bd61ac-45cf-4d13-9441-43dcd01edf8d", routeValues, queryValues);
|
791 | let url = verData.requestUrl;
|
792 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
793 | let res;
|
794 | res = yield this.rest.del(url, options);
|
795 | let ret = this.formatResponse(res.result, null, false);
|
796 | resolve(ret);
|
797 | }
|
798 | catch (err) {
|
799 | reject(err);
|
800 | }
|
801 | }));
|
802 | });
|
803 | }
|
804 | |
805 |
|
806 |
|
807 |
|
808 |
|
809 |
|
810 |
|
811 |
|
812 | removeTestCasesListFromSuite(project, planId, suiteId, testIds) {
|
813 | return __awaiter(this, void 0, void 0, function* () {
|
814 | if (testIds == null) {
|
815 | throw new TypeError('testIds can not be null or undefined');
|
816 | }
|
817 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
818 | let routeValues = {
|
819 | project: project,
|
820 | planId: planId,
|
821 | suiteId: suiteId
|
822 | };
|
823 | let queryValues = {
|
824 | testIds: testIds,
|
825 | };
|
826 | try {
|
827 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "testplan", "a9bd61ac-45cf-4d13-9441-43dcd01edf8d", routeValues, queryValues);
|
828 | let url = verData.requestUrl;
|
829 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
830 | let res;
|
831 | res = yield this.rest.del(url, options);
|
832 | let ret = this.formatResponse(res.result, null, false);
|
833 | resolve(ret);
|
834 | }
|
835 | catch (err) {
|
836 | reject(err);
|
837 | }
|
838 | }));
|
839 | });
|
840 | }
|
841 | |
842 |
|
843 |
|
844 |
|
845 |
|
846 |
|
847 |
|
848 |
|
849 | updateSuiteTestCases(suiteTestCaseCreateUpdateParameters, project, planId, suiteId) {
|
850 | return __awaiter(this, void 0, void 0, function* () {
|
851 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
852 | let routeValues = {
|
853 | project: project,
|
854 | planId: planId,
|
855 | suiteId: suiteId
|
856 | };
|
857 | try {
|
858 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "testplan", "a9bd61ac-45cf-4d13-9441-43dcd01edf8d", routeValues);
|
859 | let url = verData.requestUrl;
|
860 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
861 | let res;
|
862 | res = yield this.rest.update(url, suiteTestCaseCreateUpdateParameters, options);
|
863 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestCase, true);
|
864 | resolve(ret);
|
865 | }
|
866 | catch (err) {
|
867 | reject(err);
|
868 | }
|
869 | }));
|
870 | });
|
871 | }
|
872 | |
873 |
|
874 |
|
875 |
|
876 | cloneTestCase(cloneRequestBody, project) {
|
877 | return __awaiter(this, void 0, void 0, function* () {
|
878 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
879 | let routeValues = {
|
880 | project: project
|
881 | };
|
882 | try {
|
883 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testplan", "529b2b8d-82f4-4893-b1e4-1e74ea534673", routeValues);
|
884 | let url = verData.requestUrl;
|
885 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
886 | let res;
|
887 | res = yield this.rest.create(url, cloneRequestBody, options);
|
888 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.CloneTestCaseOperationInformation, false);
|
889 | resolve(ret);
|
890 | }
|
891 | catch (err) {
|
892 | reject(err);
|
893 | }
|
894 | }));
|
895 | });
|
896 | }
|
897 | |
898 |
|
899 |
|
900 |
|
901 |
|
902 |
|
903 | getTestCaseCloneInformation(project, cloneOperationId) {
|
904 | return __awaiter(this, void 0, void 0, function* () {
|
905 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
906 | let routeValues = {
|
907 | project: project,
|
908 | cloneOperationId: cloneOperationId
|
909 | };
|
910 | try {
|
911 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testplan", "529b2b8d-82f4-4893-b1e4-1e74ea534673", routeValues);
|
912 | let url = verData.requestUrl;
|
913 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
914 | let res;
|
915 | res = yield this.rest.get(url, options);
|
916 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.CloneTestCaseOperationInformation, false);
|
917 | resolve(ret);
|
918 | }
|
919 | catch (err) {
|
920 | reject(err);
|
921 | }
|
922 | }));
|
923 | });
|
924 | }
|
925 | |
926 |
|
927 |
|
928 |
|
929 |
|
930 |
|
931 | exportTestCases(exportTestCaseRequestBody, project) {
|
932 | return __awaiter(this, void 0, void 0, function* () {
|
933 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
934 | let routeValues = {
|
935 | project: project
|
936 | };
|
937 | try {
|
938 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "3b9d1c87-6b1a-4e7d-9e7d-1a8e543112bb", routeValues);
|
939 | let url = verData.requestUrl;
|
940 | let apiVersion = verData.apiVersion;
|
941 | let accept = this.createAcceptHeader("application/octet-stream", apiVersion);
|
942 | resolve((yield this.http.get(url, { "Accept": accept })).message);
|
943 | }
|
944 | catch (err) {
|
945 | reject(err);
|
946 | }
|
947 | }));
|
948 | });
|
949 | }
|
950 | |
951 |
|
952 |
|
953 |
|
954 |
|
955 |
|
956 | deleteTestCase(project, testCaseId) {
|
957 | return __awaiter(this, void 0, void 0, function* () {
|
958 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
959 | let routeValues = {
|
960 | project: project,
|
961 | testCaseId: testCaseId
|
962 | };
|
963 | try {
|
964 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "29006fb5-816b-4ff7-a329-599943569229", routeValues);
|
965 | let url = verData.requestUrl;
|
966 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
967 | let res;
|
968 | res = yield this.rest.del(url, options);
|
969 | let ret = this.formatResponse(res.result, null, false);
|
970 | resolve(ret);
|
971 | }
|
972 | catch (err) {
|
973 | reject(err);
|
974 | }
|
975 | }));
|
976 | });
|
977 | }
|
978 | |
979 |
|
980 |
|
981 |
|
982 |
|
983 |
|
984 |
|
985 | cloneTestPlan(cloneRequestBody, project, deepClone) {
|
986 | return __awaiter(this, void 0, void 0, function* () {
|
987 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
988 | let routeValues = {
|
989 | project: project
|
990 | };
|
991 | let queryValues = {
|
992 | deepClone: deepClone,
|
993 | };
|
994 | try {
|
995 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testplan", "e65df662-d8a3-46c7-ae1c-14e2d4df57e1", routeValues, queryValues);
|
996 | let url = verData.requestUrl;
|
997 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
998 | let res;
|
999 | res = yield this.rest.create(url, cloneRequestBody, options);
|
1000 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.CloneTestPlanOperationInformation, false);
|
1001 | resolve(ret);
|
1002 | }
|
1003 | catch (err) {
|
1004 | reject(err);
|
1005 | }
|
1006 | }));
|
1007 | });
|
1008 | }
|
1009 | |
1010 |
|
1011 |
|
1012 |
|
1013 |
|
1014 |
|
1015 | getCloneInformation(project, cloneOperationId) {
|
1016 | return __awaiter(this, void 0, void 0, function* () {
|
1017 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1018 | let routeValues = {
|
1019 | project: project,
|
1020 | cloneOperationId: cloneOperationId
|
1021 | };
|
1022 | try {
|
1023 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testplan", "e65df662-d8a3-46c7-ae1c-14e2d4df57e1", routeValues);
|
1024 | let url = verData.requestUrl;
|
1025 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1026 | let res;
|
1027 | res = yield this.rest.get(url, options);
|
1028 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.CloneTestPlanOperationInformation, false);
|
1029 | resolve(ret);
|
1030 | }
|
1031 | catch (err) {
|
1032 | reject(err);
|
1033 | }
|
1034 | }));
|
1035 | });
|
1036 | }
|
1037 | |
1038 |
|
1039 |
|
1040 |
|
1041 |
|
1042 |
|
1043 |
|
1044 |
|
1045 |
|
1046 |
|
1047 | getPoints(project, planId, suiteId, pointId, returnIdentityRef, includePointDetails) {
|
1048 | return __awaiter(this, void 0, void 0, function* () {
|
1049 | if (pointId == null) {
|
1050 | throw new TypeError('pointId can not be null or undefined');
|
1051 | }
|
1052 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1053 | let routeValues = {
|
1054 | project: project,
|
1055 | planId: planId,
|
1056 | suiteId: suiteId
|
1057 | };
|
1058 | let queryValues = {
|
1059 | pointId: pointId,
|
1060 | returnIdentityRef: returnIdentityRef,
|
1061 | includePointDetails: includePointDetails,
|
1062 | };
|
1063 | try {
|
1064 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testplan", "52df686e-bae4-4334-b0ee-b6cf4e6f6b73", routeValues, queryValues);
|
1065 | let url = verData.requestUrl;
|
1066 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1067 | let res;
|
1068 | res = yield this.rest.get(url, options);
|
1069 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestPoint, true);
|
1070 | resolve(ret);
|
1071 | }
|
1072 | catch (err) {
|
1073 | reject(err);
|
1074 | }
|
1075 | }));
|
1076 | });
|
1077 | }
|
1078 | |
1079 |
|
1080 |
|
1081 |
|
1082 |
|
1083 |
|
1084 |
|
1085 |
|
1086 |
|
1087 |
|
1088 |
|
1089 |
|
1090 |
|
1091 | getPointsList(project, planId, suiteId, testPointIds, testCaseId, continuationToken, returnIdentityRef, includePointDetails, isRecursive) {
|
1092 | return __awaiter(this, void 0, void 0, function* () {
|
1093 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1094 | let routeValues = {
|
1095 | project: project,
|
1096 | planId: planId,
|
1097 | suiteId: suiteId
|
1098 | };
|
1099 | let queryValues = {
|
1100 | testPointIds: testPointIds,
|
1101 | testCaseId: testCaseId,
|
1102 | continuationToken: continuationToken,
|
1103 | returnIdentityRef: returnIdentityRef,
|
1104 | includePointDetails: includePointDetails,
|
1105 | isRecursive: isRecursive,
|
1106 | };
|
1107 | try {
|
1108 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testplan", "52df686e-bae4-4334-b0ee-b6cf4e6f6b73", routeValues, queryValues);
|
1109 | let url = verData.requestUrl;
|
1110 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1111 | let res;
|
1112 | res = yield this.rest.get(url, options);
|
1113 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestPoint, true);
|
1114 | resolve(ret);
|
1115 | }
|
1116 | catch (err) {
|
1117 | reject(err);
|
1118 | }
|
1119 | }));
|
1120 | });
|
1121 | }
|
1122 | |
1123 |
|
1124 |
|
1125 |
|
1126 |
|
1127 |
|
1128 |
|
1129 |
|
1130 |
|
1131 |
|
1132 | updateTestPoints(testPointUpdateParams, project, planId, suiteId, includePointDetails, returnIdentityRef) {
|
1133 | return __awaiter(this, void 0, void 0, function* () {
|
1134 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1135 | let routeValues = {
|
1136 | project: project,
|
1137 | planId: planId,
|
1138 | suiteId: suiteId
|
1139 | };
|
1140 | let queryValues = {
|
1141 | includePointDetails: includePointDetails,
|
1142 | returnIdentityRef: returnIdentityRef,
|
1143 | };
|
1144 | try {
|
1145 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testplan", "52df686e-bae4-4334-b0ee-b6cf4e6f6b73", routeValues, queryValues);
|
1146 | let url = verData.requestUrl;
|
1147 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1148 | let res;
|
1149 | res = yield this.rest.update(url, testPointUpdateParams, options);
|
1150 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestPoint, true);
|
1151 | resolve(ret);
|
1152 | }
|
1153 | catch (err) {
|
1154 | reject(err);
|
1155 | }
|
1156 | }));
|
1157 | });
|
1158 | }
|
1159 | |
1160 |
|
1161 |
|
1162 |
|
1163 |
|
1164 |
|
1165 |
|
1166 | cloneTestSuite(cloneRequestBody, project, deepClone) {
|
1167 | return __awaiter(this, void 0, void 0, function* () {
|
1168 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1169 | let routeValues = {
|
1170 | project: project
|
1171 | };
|
1172 | let queryValues = {
|
1173 | deepClone: deepClone,
|
1174 | };
|
1175 | try {
|
1176 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testplan", "181d4c97-0e98-4ee2-ad6a-4cada675e555", routeValues, queryValues);
|
1177 | let url = verData.requestUrl;
|
1178 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1179 | let res;
|
1180 | res = yield this.rest.create(url, cloneRequestBody, options);
|
1181 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.CloneTestSuiteOperationInformation, false);
|
1182 | resolve(ret);
|
1183 | }
|
1184 | catch (err) {
|
1185 | reject(err);
|
1186 | }
|
1187 | }));
|
1188 | });
|
1189 | }
|
1190 | |
1191 |
|
1192 |
|
1193 |
|
1194 |
|
1195 |
|
1196 | getSuiteCloneInformation(project, cloneOperationId) {
|
1197 | return __awaiter(this, void 0, void 0, function* () {
|
1198 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1199 | let routeValues = {
|
1200 | project: project,
|
1201 | cloneOperationId: cloneOperationId
|
1202 | };
|
1203 | try {
|
1204 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testplan", "181d4c97-0e98-4ee2-ad6a-4cada675e555", routeValues);
|
1205 | let url = verData.requestUrl;
|
1206 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1207 | let res;
|
1208 | res = yield this.rest.get(url, options);
|
1209 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.CloneTestSuiteOperationInformation, false);
|
1210 | resolve(ret);
|
1211 | }
|
1212 | catch (err) {
|
1213 | reject(err);
|
1214 | }
|
1215 | }));
|
1216 | });
|
1217 | }
|
1218 | |
1219 |
|
1220 |
|
1221 |
|
1222 |
|
1223 |
|
1224 | createTestVariable(testVariableCreateUpdateParameters, project) {
|
1225 | return __awaiter(this, void 0, void 0, function* () {
|
1226 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1227 | let routeValues = {
|
1228 | project: project
|
1229 | };
|
1230 | try {
|
1231 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c", routeValues);
|
1232 | let url = verData.requestUrl;
|
1233 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1234 | let res;
|
1235 | res = yield this.rest.create(url, testVariableCreateUpdateParameters, options);
|
1236 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestVariable, false);
|
1237 | resolve(ret);
|
1238 | }
|
1239 | catch (err) {
|
1240 | reject(err);
|
1241 | }
|
1242 | }));
|
1243 | });
|
1244 | }
|
1245 | |
1246 |
|
1247 |
|
1248 |
|
1249 |
|
1250 |
|
1251 | deleteTestVariable(project, testVariableId) {
|
1252 | return __awaiter(this, void 0, void 0, function* () {
|
1253 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1254 | let routeValues = {
|
1255 | project: project,
|
1256 | testVariableId: testVariableId
|
1257 | };
|
1258 | try {
|
1259 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c", routeValues);
|
1260 | let url = verData.requestUrl;
|
1261 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1262 | let res;
|
1263 | res = yield this.rest.del(url, options);
|
1264 | let ret = this.formatResponse(res.result, null, false);
|
1265 | resolve(ret);
|
1266 | }
|
1267 | catch (err) {
|
1268 | reject(err);
|
1269 | }
|
1270 | }));
|
1271 | });
|
1272 | }
|
1273 | |
1274 |
|
1275 |
|
1276 |
|
1277 |
|
1278 |
|
1279 | getTestVariableById(project, testVariableId) {
|
1280 | return __awaiter(this, void 0, void 0, function* () {
|
1281 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1282 | let routeValues = {
|
1283 | project: project,
|
1284 | testVariableId: testVariableId
|
1285 | };
|
1286 | try {
|
1287 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c", routeValues);
|
1288 | let url = verData.requestUrl;
|
1289 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1290 | let res;
|
1291 | res = yield this.rest.get(url, options);
|
1292 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestVariable, false);
|
1293 | resolve(ret);
|
1294 | }
|
1295 | catch (err) {
|
1296 | reject(err);
|
1297 | }
|
1298 | }));
|
1299 | });
|
1300 | }
|
1301 | |
1302 |
|
1303 |
|
1304 |
|
1305 |
|
1306 |
|
1307 | getTestVariables(project, continuationToken) {
|
1308 | return __awaiter(this, void 0, void 0, function* () {
|
1309 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1310 | let routeValues = {
|
1311 | project: project
|
1312 | };
|
1313 | let queryValues = {
|
1314 | continuationToken: continuationToken,
|
1315 | };
|
1316 | try {
|
1317 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c", routeValues, queryValues);
|
1318 | let url = verData.requestUrl;
|
1319 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1320 | let res;
|
1321 | res = yield this.rest.get(url, options);
|
1322 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestVariable, true);
|
1323 | resolve(ret);
|
1324 | }
|
1325 | catch (err) {
|
1326 | reject(err);
|
1327 | }
|
1328 | }));
|
1329 | });
|
1330 | }
|
1331 | |
1332 |
|
1333 |
|
1334 |
|
1335 |
|
1336 |
|
1337 |
|
1338 | updateTestVariable(testVariableCreateUpdateParameters, project, testVariableId) {
|
1339 | return __awaiter(this, void 0, void 0, function* () {
|
1340 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1341 | let routeValues = {
|
1342 | project: project,
|
1343 | testVariableId: testVariableId
|
1344 | };
|
1345 | try {
|
1346 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c", routeValues);
|
1347 | let url = verData.requestUrl;
|
1348 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1349 | let res;
|
1350 | res = yield this.rest.update(url, testVariableCreateUpdateParameters, options);
|
1351 | let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestVariable, false);
|
1352 | resolve(ret);
|
1353 | }
|
1354 | catch (err) {
|
1355 | reject(err);
|
1356 | }
|
1357 | }));
|
1358 | });
|
1359 | }
|
1360 | }
|
1361 | exports.TestPlanApi = TestPlanApi;
|