UNPKG

174 kBJavaScriptView Raw
1"use strict";
2/*
3 * ---------------------------------------------------------
4 * Copyright(C) Microsoft Corporation. All rights reserved.
5 * ---------------------------------------------------------
6 *
7 * ---------------------------------------------------------
8 * Generated file, DO NOT EDIT
9 * ---------------------------------------------------------
10 */
11var __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};
20Object.defineProperty(exports, "__esModule", { value: true });
21exports.TestResultsApi = void 0;
22const basem = require("./ClientApiBases");
23const Contracts = require("./interfaces/TestInterfaces");
24class TestResultsApi extends basem.ClientApiBase {
25 constructor(baseUrl, handlers, options) {
26 super(baseUrl, handlers, 'node-testResults-api', options);
27 }
28 /**
29 * @param {Contracts.TestAttachmentRequestModel} attachmentRequestModel
30 * @param {string} project - Project ID or project name
31 * @param {number} runId
32 * @param {number} testCaseResultId
33 * @param {number} iterationId
34 * @param {string} actionPath
35 */
36 createTestIterationResultAttachment(attachmentRequestModel, project, runId, testCaseResultId, iterationId, actionPath) {
37 return __awaiter(this, void 0, void 0, function* () {
38 if (iterationId == null) {
39 throw new TypeError('iterationId can not be null or undefined');
40 }
41 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
42 let routeValues = {
43 project: project,
44 runId: runId,
45 testCaseResultId: testCaseResultId
46 };
47 let queryValues = {
48 iterationId: iterationId,
49 actionPath: actionPath,
50 };
51 try {
52 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "2a632e97-e014-4275-978f-8e5c4906d4b3", routeValues, queryValues);
53 let url = verData.requestUrl;
54 let options = this.createRequestOptions('application/json', verData.apiVersion);
55 let res;
56 res = yield this.rest.create(url, attachmentRequestModel, options);
57 let ret = this.formatResponse(res.result, null, false);
58 resolve(ret);
59 }
60 catch (err) {
61 reject(err);
62 }
63 }));
64 });
65 }
66 /**
67 * @param {Contracts.TestAttachmentRequestModel} attachmentRequestModel
68 * @param {string} project - Project ID or project name
69 * @param {number} runId
70 * @param {number} testCaseResultId
71 */
72 createTestResultAttachment(attachmentRequestModel, project, runId, testCaseResultId) {
73 return __awaiter(this, void 0, void 0, function* () {
74 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
75 let routeValues = {
76 project: project,
77 runId: runId,
78 testCaseResultId: testCaseResultId
79 };
80 try {
81 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "2a632e97-e014-4275-978f-8e5c4906d4b3", routeValues);
82 let url = verData.requestUrl;
83 let options = this.createRequestOptions('application/json', verData.apiVersion);
84 let res;
85 res = yield this.rest.create(url, attachmentRequestModel, options);
86 let ret = this.formatResponse(res.result, null, false);
87 resolve(ret);
88 }
89 catch (err) {
90 reject(err);
91 }
92 }));
93 });
94 }
95 /**
96 * @param {Contracts.TestAttachmentRequestModel} attachmentRequestModel
97 * @param {string} project - Project ID or project name
98 * @param {number} runId
99 * @param {number} testCaseResultId
100 * @param {number} testSubResultId
101 */
102 createTestSubResultAttachment(attachmentRequestModel, project, runId, testCaseResultId, testSubResultId) {
103 return __awaiter(this, void 0, void 0, function* () {
104 if (testSubResultId == null) {
105 throw new TypeError('testSubResultId can not be null or undefined');
106 }
107 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
108 let routeValues = {
109 project: project,
110 runId: runId,
111 testCaseResultId: testCaseResultId
112 };
113 let queryValues = {
114 testSubResultId: testSubResultId,
115 };
116 try {
117 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "2a632e97-e014-4275-978f-8e5c4906d4b3", routeValues, queryValues);
118 let url = verData.requestUrl;
119 let options = this.createRequestOptions('application/json', verData.apiVersion);
120 let res;
121 res = yield this.rest.create(url, attachmentRequestModel, options);
122 let ret = this.formatResponse(res.result, null, false);
123 resolve(ret);
124 }
125 catch (err) {
126 reject(err);
127 }
128 }));
129 });
130 }
131 /**
132 * @param {string} project - Project ID or project name
133 * @param {number} runId
134 * @param {number} testCaseResultId
135 * @param {number} attachmentId
136 */
137 deleteTestResultAttachment(project, runId, testCaseResultId, attachmentId) {
138 return __awaiter(this, void 0, void 0, function* () {
139 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
140 let routeValues = {
141 project: project,
142 runId: runId,
143 testCaseResultId: testCaseResultId,
144 attachmentId: attachmentId
145 };
146 try {
147 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "2a632e97-e014-4275-978f-8e5c4906d4b3", routeValues);
148 let url = verData.requestUrl;
149 let options = this.createRequestOptions('application/json', verData.apiVersion);
150 let res;
151 res = yield this.rest.del(url, options);
152 let ret = this.formatResponse(res.result, null, false);
153 resolve(ret);
154 }
155 catch (err) {
156 reject(err);
157 }
158 }));
159 });
160 }
161 /**
162 * Returns a test iteration attachment
163 *
164 * @param {string} project - Project ID or project name
165 * @param {number} runId
166 * @param {number} testCaseResultId
167 * @param {number} attachmentId
168 * @param {number} iterationId
169 */
170 getTestIterationAttachmentContent(project, runId, testCaseResultId, attachmentId, iterationId) {
171 return __awaiter(this, void 0, void 0, function* () {
172 if (iterationId == null) {
173 throw new TypeError('iterationId can not be null or undefined');
174 }
175 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
176 let routeValues = {
177 project: project,
178 runId: runId,
179 testCaseResultId: testCaseResultId,
180 attachmentId: attachmentId
181 };
182 let queryValues = {
183 iterationId: iterationId,
184 };
185 try {
186 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "2a632e97-e014-4275-978f-8e5c4906d4b3", routeValues, queryValues);
187 let url = verData.requestUrl;
188 let apiVersion = verData.apiVersion;
189 let accept = this.createAcceptHeader("application/octet-stream", apiVersion);
190 resolve((yield this.http.get(url, { "Accept": accept })).message);
191 }
192 catch (err) {
193 reject(err);
194 }
195 }));
196 });
197 }
198 /**
199 * Returns a test iteration attachment
200 *
201 * @param {string} project - Project ID or project name
202 * @param {number} runId
203 * @param {number} testCaseResultId
204 * @param {number} attachmentId
205 * @param {number} iterationId
206 */
207 getTestIterationAttachmentZip(project, runId, testCaseResultId, attachmentId, iterationId) {
208 return __awaiter(this, void 0, void 0, function* () {
209 if (iterationId == null) {
210 throw new TypeError('iterationId can not be null or undefined');
211 }
212 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
213 let routeValues = {
214 project: project,
215 runId: runId,
216 testCaseResultId: testCaseResultId,
217 attachmentId: attachmentId
218 };
219 let queryValues = {
220 iterationId: iterationId,
221 };
222 try {
223 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "2a632e97-e014-4275-978f-8e5c4906d4b3", routeValues, queryValues);
224 let url = verData.requestUrl;
225 let apiVersion = verData.apiVersion;
226 let accept = this.createAcceptHeader("application/zip", apiVersion);
227 resolve((yield this.http.get(url, { "Accept": accept })).message);
228 }
229 catch (err) {
230 reject(err);
231 }
232 }));
233 });
234 }
235 /**
236 * Returns a test result attachment
237 *
238 * @param {string} project - Project ID or project name
239 * @param {number} runId
240 * @param {number} testCaseResultId
241 * @param {number} attachmentId
242 */
243 getTestResultAttachmentContent(project, runId, testCaseResultId, attachmentId) {
244 return __awaiter(this, void 0, void 0, function* () {
245 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
246 let routeValues = {
247 project: project,
248 runId: runId,
249 testCaseResultId: testCaseResultId,
250 attachmentId: attachmentId
251 };
252 try {
253 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "2a632e97-e014-4275-978f-8e5c4906d4b3", routeValues);
254 let url = verData.requestUrl;
255 let apiVersion = verData.apiVersion;
256 let accept = this.createAcceptHeader("application/octet-stream", apiVersion);
257 resolve((yield this.http.get(url, { "Accept": accept })).message);
258 }
259 catch (err) {
260 reject(err);
261 }
262 }));
263 });
264 }
265 /**
266 * @param {string} project - Project ID or project name
267 * @param {number} runId
268 * @param {number} testCaseResultId
269 */
270 getTestResultAttachments(project, runId, testCaseResultId) {
271 return __awaiter(this, void 0, void 0, function* () {
272 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
273 let routeValues = {
274 project: project,
275 runId: runId,
276 testCaseResultId: testCaseResultId
277 };
278 try {
279 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "2a632e97-e014-4275-978f-8e5c4906d4b3", routeValues);
280 let url = verData.requestUrl;
281 let options = this.createRequestOptions('application/json', verData.apiVersion);
282 let res;
283 res = yield this.rest.get(url, options);
284 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestAttachment, true);
285 resolve(ret);
286 }
287 catch (err) {
288 reject(err);
289 }
290 }));
291 });
292 }
293 /**
294 * Returns a test result attachment
295 *
296 * @param {string} project - Project ID or project name
297 * @param {number} runId
298 * @param {number} testCaseResultId
299 * @param {number} attachmentId
300 */
301 getTestResultAttachmentZip(project, runId, testCaseResultId, attachmentId) {
302 return __awaiter(this, void 0, void 0, function* () {
303 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
304 let routeValues = {
305 project: project,
306 runId: runId,
307 testCaseResultId: testCaseResultId,
308 attachmentId: attachmentId
309 };
310 try {
311 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "2a632e97-e014-4275-978f-8e5c4906d4b3", routeValues);
312 let url = verData.requestUrl;
313 let apiVersion = verData.apiVersion;
314 let accept = this.createAcceptHeader("application/zip", apiVersion);
315 resolve((yield this.http.get(url, { "Accept": accept })).message);
316 }
317 catch (err) {
318 reject(err);
319 }
320 }));
321 });
322 }
323 /**
324 * Returns a test sub result attachment
325 *
326 * @param {string} project - Project ID or project name
327 * @param {number} runId
328 * @param {number} testCaseResultId
329 * @param {number} attachmentId
330 * @param {number} testSubResultId
331 */
332 getTestSubResultAttachmentContent(project, runId, testCaseResultId, attachmentId, testSubResultId) {
333 return __awaiter(this, void 0, void 0, function* () {
334 if (testSubResultId == null) {
335 throw new TypeError('testSubResultId can not be null or undefined');
336 }
337 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
338 let routeValues = {
339 project: project,
340 runId: runId,
341 testCaseResultId: testCaseResultId,
342 attachmentId: attachmentId
343 };
344 let queryValues = {
345 testSubResultId: testSubResultId,
346 };
347 try {
348 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "2a632e97-e014-4275-978f-8e5c4906d4b3", routeValues, queryValues);
349 let url = verData.requestUrl;
350 let apiVersion = verData.apiVersion;
351 let accept = this.createAcceptHeader("application/octet-stream", apiVersion);
352 resolve((yield this.http.get(url, { "Accept": accept })).message);
353 }
354 catch (err) {
355 reject(err);
356 }
357 }));
358 });
359 }
360 /**
361 * Returns attachment references for test sub result.
362 *
363 * @param {string} project - Project ID or project name
364 * @param {number} runId
365 * @param {number} testCaseResultId
366 * @param {number} testSubResultId
367 */
368 getTestSubResultAttachments(project, runId, testCaseResultId, testSubResultId) {
369 return __awaiter(this, void 0, void 0, function* () {
370 if (testSubResultId == null) {
371 throw new TypeError('testSubResultId can not be null or undefined');
372 }
373 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
374 let routeValues = {
375 project: project,
376 runId: runId,
377 testCaseResultId: testCaseResultId
378 };
379 let queryValues = {
380 testSubResultId: testSubResultId,
381 };
382 try {
383 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "2a632e97-e014-4275-978f-8e5c4906d4b3", routeValues, queryValues);
384 let url = verData.requestUrl;
385 let options = this.createRequestOptions('application/json', verData.apiVersion);
386 let res;
387 res = yield this.rest.get(url, options);
388 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestAttachment, true);
389 resolve(ret);
390 }
391 catch (err) {
392 reject(err);
393 }
394 }));
395 });
396 }
397 /**
398 * Returns a test sub result attachment
399 *
400 * @param {string} project - Project ID or project name
401 * @param {number} runId
402 * @param {number} testCaseResultId
403 * @param {number} attachmentId
404 * @param {number} testSubResultId
405 */
406 getTestSubResultAttachmentZip(project, runId, testCaseResultId, attachmentId, testSubResultId) {
407 return __awaiter(this, void 0, void 0, function* () {
408 if (testSubResultId == null) {
409 throw new TypeError('testSubResultId can not be null or undefined');
410 }
411 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
412 let routeValues = {
413 project: project,
414 runId: runId,
415 testCaseResultId: testCaseResultId,
416 attachmentId: attachmentId
417 };
418 let queryValues = {
419 testSubResultId: testSubResultId,
420 };
421 try {
422 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "2a632e97-e014-4275-978f-8e5c4906d4b3", routeValues, queryValues);
423 let url = verData.requestUrl;
424 let apiVersion = verData.apiVersion;
425 let accept = this.createAcceptHeader("application/zip", apiVersion);
426 resolve((yield this.http.get(url, { "Accept": accept })).message);
427 }
428 catch (err) {
429 reject(err);
430 }
431 }));
432 });
433 }
434 /**
435 * @param {Contracts.TestAttachmentRequestModel} attachmentRequestModel
436 * @param {string} project - Project ID or project name
437 * @param {number} runId
438 */
439 createTestRunAttachment(attachmentRequestModel, project, runId) {
440 return __awaiter(this, void 0, void 0, function* () {
441 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
442 let routeValues = {
443 project: project,
444 runId: runId
445 };
446 try {
447 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "b5731898-8206-477a-a51d-3fdf116fc6bf", routeValues);
448 let url = verData.requestUrl;
449 let options = this.createRequestOptions('application/json', verData.apiVersion);
450 let res;
451 res = yield this.rest.create(url, attachmentRequestModel, options);
452 let ret = this.formatResponse(res.result, null, false);
453 resolve(ret);
454 }
455 catch (err) {
456 reject(err);
457 }
458 }));
459 });
460 }
461 /**
462 * @param {string} project - Project ID or project name
463 * @param {number} runId
464 * @param {number} attachmentId
465 */
466 deleteTestRunAttachment(project, runId, attachmentId) {
467 return __awaiter(this, void 0, void 0, function* () {
468 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
469 let routeValues = {
470 project: project,
471 runId: runId,
472 attachmentId: attachmentId
473 };
474 try {
475 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "b5731898-8206-477a-a51d-3fdf116fc6bf", routeValues);
476 let url = verData.requestUrl;
477 let options = this.createRequestOptions('application/json', verData.apiVersion);
478 let res;
479 res = yield this.rest.del(url, options);
480 let ret = this.formatResponse(res.result, null, false);
481 resolve(ret);
482 }
483 catch (err) {
484 reject(err);
485 }
486 }));
487 });
488 }
489 /**
490 * Returns a test run attachment
491 *
492 * @param {string} project - Project ID or project name
493 * @param {number} runId
494 * @param {number} attachmentId
495 */
496 getTestRunAttachmentContent(project, runId, attachmentId) {
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 runId: runId,
502 attachmentId: attachmentId
503 };
504 try {
505 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "b5731898-8206-477a-a51d-3fdf116fc6bf", routeValues);
506 let url = verData.requestUrl;
507 let apiVersion = verData.apiVersion;
508 let accept = this.createAcceptHeader("application/octet-stream", apiVersion);
509 resolve((yield this.http.get(url, { "Accept": accept })).message);
510 }
511 catch (err) {
512 reject(err);
513 }
514 }));
515 });
516 }
517 /**
518 * @param {string} project - Project ID or project name
519 * @param {number} runId
520 */
521 getTestRunAttachments(project, runId) {
522 return __awaiter(this, void 0, void 0, function* () {
523 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
524 let routeValues = {
525 project: project,
526 runId: runId
527 };
528 try {
529 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "b5731898-8206-477a-a51d-3fdf116fc6bf", routeValues);
530 let url = verData.requestUrl;
531 let options = this.createRequestOptions('application/json', verData.apiVersion);
532 let res;
533 res = yield this.rest.get(url, options);
534 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestAttachment, true);
535 resolve(ret);
536 }
537 catch (err) {
538 reject(err);
539 }
540 }));
541 });
542 }
543 /**
544 * Returns a test run attachment
545 *
546 * @param {string} project - Project ID or project name
547 * @param {number} runId
548 * @param {number} attachmentId
549 */
550 getTestRunAttachmentZip(project, runId, attachmentId) {
551 return __awaiter(this, void 0, void 0, function* () {
552 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
553 let routeValues = {
554 project: project,
555 runId: runId,
556 attachmentId: attachmentId
557 };
558 try {
559 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "b5731898-8206-477a-a51d-3fdf116fc6bf", routeValues);
560 let url = verData.requestUrl;
561 let apiVersion = verData.apiVersion;
562 let accept = this.createAcceptHeader("application/zip", apiVersion);
563 resolve((yield this.http.get(url, { "Accept": accept })).message);
564 }
565 catch (err) {
566 reject(err);
567 }
568 }));
569 });
570 }
571 /**
572 * @param {string} project - Project ID or project name
573 * @param {number} runId
574 * @param {number} testCaseResultId
575 */
576 getBugsLinkedToTestResult(project, runId, testCaseResultId) {
577 return __awaiter(this, void 0, void 0, function* () {
578 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
579 let routeValues = {
580 project: project,
581 runId: runId,
582 testCaseResultId: testCaseResultId
583 };
584 try {
585 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "d8dbf98f-eb34-4f8d-8365-47972af34f29", routeValues);
586 let url = verData.requestUrl;
587 let options = this.createRequestOptions('application/json', verData.apiVersion);
588 let res;
589 res = yield this.rest.get(url, options);
590 let ret = this.formatResponse(res.result, null, true);
591 resolve(ret);
592 }
593 catch (err) {
594 reject(err);
595 }
596 }));
597 });
598 }
599 /**
600 * @param {string} project - Project ID or project name
601 * @param {number} buildId
602 */
603 fetchSourceCodeCoverageReport(project, buildId) {
604 return __awaiter(this, void 0, void 0, function* () {
605 if (buildId == null) {
606 throw new TypeError('buildId can not be null or undefined');
607 }
608 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
609 let routeValues = {
610 project: project
611 };
612 let queryValues = {
613 buildId: buildId,
614 };
615 try {
616 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "a459e10b-d703-4193-b3c1-60f2287918b3", routeValues, queryValues);
617 let url = verData.requestUrl;
618 let options = this.createRequestOptions('application/json', verData.apiVersion);
619 let res;
620 res = yield this.rest.get(url, options);
621 let ret = this.formatResponse(res.result, Contracts.TypeInfo.SourceViewBuildCoverage, true);
622 resolve(ret);
623 }
624 catch (err) {
625 reject(err);
626 }
627 }));
628 });
629 }
630 /**
631 * @param {string} project - Project ID or project name
632 * @param {number} buildId
633 * @param {number} flags
634 */
635 getBuildCodeCoverage(project, buildId, flags) {
636 return __awaiter(this, void 0, void 0, function* () {
637 if (buildId == null) {
638 throw new TypeError('buildId can not be null or undefined');
639 }
640 if (flags == null) {
641 throw new TypeError('flags can not be null or undefined');
642 }
643 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
644 let routeValues = {
645 project: project
646 };
647 let queryValues = {
648 buildId: buildId,
649 flags: flags,
650 };
651 try {
652 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "9b3e1ece-c6ab-4fbb-8167-8a32a0c92216", routeValues, queryValues);
653 let url = verData.requestUrl;
654 let options = this.createRequestOptions('application/json', verData.apiVersion);
655 let res;
656 res = yield this.rest.get(url, options);
657 let ret = this.formatResponse(res.result, Contracts.TypeInfo.BuildCoverage, true);
658 resolve(ret);
659 }
660 catch (err) {
661 reject(err);
662 }
663 }));
664 });
665 }
666 /**
667 * http://(tfsserver):8080/tfs/DefaultCollection/_apis/test/CodeCoverage?buildId=10&deltaBuildId=9 Request: build id and delta build id (optional)
668 *
669 * @param {string} project - Project ID or project name
670 * @param {number} buildId
671 * @param {number} deltaBuildId
672 */
673 getCodeCoverageSummary(project, buildId, deltaBuildId) {
674 return __awaiter(this, void 0, void 0, function* () {
675 if (buildId == null) {
676 throw new TypeError('buildId can not be null or undefined');
677 }
678 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
679 let routeValues = {
680 project: project
681 };
682 let queryValues = {
683 buildId: buildId,
684 deltaBuildId: deltaBuildId,
685 };
686 try {
687 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "9b3e1ece-c6ab-4fbb-8167-8a32a0c92216", routeValues, queryValues);
688 let url = verData.requestUrl;
689 let options = this.createRequestOptions('application/json', verData.apiVersion);
690 let res;
691 res = yield this.rest.get(url, options);
692 let ret = this.formatResponse(res.result, Contracts.TypeInfo.CodeCoverageSummary, false);
693 resolve(ret);
694 }
695 catch (err) {
696 reject(err);
697 }
698 }));
699 });
700 }
701 /**
702 * http://(tfsserver):8080/tfs/DefaultCollection/_apis/test/CodeCoverage?buildId=10 Request: Json of code coverage summary
703 *
704 * @param {string} project - Project ID or project name
705 * @param {number} buildId
706 * @param {Contracts.CodeCoverageData} coverageData
707 */
708 updateCodeCoverageSummary(project, buildId, coverageData) {
709 return __awaiter(this, void 0, void 0, function* () {
710 if (buildId == null) {
711 throw new TypeError('buildId can not be null or undefined');
712 }
713 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
714 let routeValues = {
715 project: project
716 };
717 let queryValues = {
718 buildId: buildId,
719 };
720 try {
721 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "9b3e1ece-c6ab-4fbb-8167-8a32a0c92216", routeValues, queryValues);
722 let url = verData.requestUrl;
723 let options = this.createRequestOptions('application/json', verData.apiVersion);
724 let res;
725 res = yield this.rest.create(url, coverageData, options);
726 let ret = this.formatResponse(res.result, null, false);
727 resolve(ret);
728 }
729 catch (err) {
730 reject(err);
731 }
732 }));
733 });
734 }
735 /**
736 * @param {string} project - Project ID or project name
737 * @param {number} runId
738 * @param {number} flags
739 */
740 getTestRunCodeCoverage(project, runId, flags) {
741 return __awaiter(this, void 0, void 0, function* () {
742 if (flags == null) {
743 throw new TypeError('flags can not be null or undefined');
744 }
745 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
746 let routeValues = {
747 project: project,
748 runId: runId
749 };
750 let queryValues = {
751 flags: flags,
752 };
753 try {
754 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "5641efbc-6f9b-401a-baeb-d3da22489e5e", routeValues, queryValues);
755 let url = verData.requestUrl;
756 let options = this.createRequestOptions('application/json', verData.apiVersion);
757 let res;
758 res = yield this.rest.get(url, options);
759 let ret = this.formatResponse(res.result, null, true);
760 resolve(ret);
761 }
762 catch (err) {
763 reject(err);
764 }
765 }));
766 });
767 }
768 /**
769 * @param {Contracts.CustomTestFieldDefinition[]} newFields
770 * @param {string} project - Project ID or project name
771 */
772 addCustomFields(newFields, project) {
773 return __awaiter(this, void 0, void 0, function* () {
774 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
775 let routeValues = {
776 project: project
777 };
778 try {
779 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "b67d46d8-b70e-4dcc-a98c-7f74b52ba82f", routeValues);
780 let url = verData.requestUrl;
781 let options = this.createRequestOptions('application/json', verData.apiVersion);
782 let res;
783 res = yield this.rest.create(url, newFields, options);
784 let ret = this.formatResponse(res.result, Contracts.TypeInfo.CustomTestFieldDefinition, true);
785 resolve(ret);
786 }
787 catch (err) {
788 reject(err);
789 }
790 }));
791 });
792 }
793 /**
794 * @param {string} project - Project ID or project name
795 * @param {Contracts.CustomTestFieldScope} scopeFilter
796 */
797 queryCustomFields(project, scopeFilter) {
798 return __awaiter(this, void 0, void 0, function* () {
799 if (scopeFilter == null) {
800 throw new TypeError('scopeFilter can not be null or undefined');
801 }
802 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
803 let routeValues = {
804 project: project
805 };
806 let queryValues = {
807 scopeFilter: scopeFilter,
808 };
809 try {
810 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "b67d46d8-b70e-4dcc-a98c-7f74b52ba82f", routeValues, queryValues);
811 let url = verData.requestUrl;
812 let options = this.createRequestOptions('application/json', verData.apiVersion);
813 let res;
814 res = yield this.rest.get(url, options);
815 let ret = this.formatResponse(res.result, Contracts.TypeInfo.CustomTestFieldDefinition, true);
816 resolve(ret);
817 }
818 catch (err) {
819 reject(err);
820 }
821 }));
822 });
823 }
824 /**
825 * Get file coverage for the specified file
826 *
827 * @param {Contracts.FileCoverageRequest} fileCoverageRequest - File details with pull request iteration context
828 * @param {string} project - Project ID or project name
829 */
830 getFileLevelCodeCoverage(fileCoverageRequest, project) {
831 return __awaiter(this, void 0, void 0, function* () {
832 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
833 let routeValues = {
834 project: project
835 };
836 try {
837 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "4a6d0c46-51ca-45aa-9163-249cee3289b7", routeValues);
838 let url = verData.requestUrl;
839 let apiVersion = verData.apiVersion;
840 let accept = this.createAcceptHeader("text/plain", apiVersion);
841 resolve((yield this.http.get(url, { "Accept": accept })).message);
842 }
843 catch (err) {
844 reject(err);
845 }
846 }));
847 });
848 }
849 /**
850 * @param {string} project - Project ID or project name
851 * @param {number} buildDefinitionId
852 * @param {Date} minBuildCreatedDate
853 */
854 getFlakyTestResultsByBuildDefinitionId(project, buildDefinitionId, minBuildCreatedDate) {
855 return __awaiter(this, void 0, void 0, function* () {
856 if (buildDefinitionId == null) {
857 throw new TypeError('buildDefinitionId can not be null or undefined');
858 }
859 if (minBuildCreatedDate == null) {
860 throw new TypeError('minBuildCreatedDate can not be null or undefined');
861 }
862 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
863 let routeValues = {
864 project: project
865 };
866 let queryValues = {
867 buildDefinitionId: buildDefinitionId,
868 minBuildCreatedDate: minBuildCreatedDate,
869 };
870 try {
871 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "8ed3cf63-7153-4722-a107-c49dae996143", routeValues, queryValues);
872 let url = verData.requestUrl;
873 let options = this.createRequestOptions('application/json', verData.apiVersion);
874 let res;
875 res = yield this.rest.get(url, options);
876 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestCaseResult, true);
877 resolve(ret);
878 }
879 catch (err) {
880 reject(err);
881 }
882 }));
883 });
884 }
885 /**
886 * @param {string} project - Project ID or project name
887 * @param {number} runId
888 */
889 getFlakyTestResultsByTestRun(project, runId) {
890 return __awaiter(this, void 0, void 0, function* () {
891 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
892 let routeValues = {
893 project: project,
894 runId: runId
895 };
896 try {
897 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "31cc4b31-416f-45cd-9b45-39534279e10c", routeValues);
898 let url = verData.requestUrl;
899 let options = this.createRequestOptions('application/json', verData.apiVersion);
900 let res;
901 res = yield this.rest.get(url, options);
902 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestCaseResult, true);
903 resolve(ret);
904 }
905 catch (err) {
906 reject(err);
907 }
908 }));
909 });
910 }
911 /**
912 * @param {Contracts.ResultsFilter} filter
913 * @param {string} project - Project ID or project name
914 */
915 queryTestResultHistory(filter, project) {
916 return __awaiter(this, void 0, void 0, function* () {
917 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
918 let routeValues = {
919 project: project
920 };
921 try {
922 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "bdf7a97b-0395-4da8-9d5d-f957619327d1", routeValues);
923 let url = verData.requestUrl;
924 let options = this.createRequestOptions('application/json', verData.apiVersion);
925 let res;
926 res = yield this.rest.create(url, filter, options);
927 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestResultHistory, false);
928 resolve(ret);
929 }
930 catch (err) {
931 reject(err);
932 }
933 }));
934 });
935 }
936 /**
937 * Get test run message logs
938 *
939 * @param {string} project - Project ID or project name
940 * @param {number} runId - ID of the run to get.
941 */
942 getTestRunMessageLogs(project, runId) {
943 return __awaiter(this, void 0, void 0, function* () {
944 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
945 let routeValues = {
946 project: project,
947 runId: runId
948 };
949 try {
950 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "e9ab0c6a-1984-418b-87c0-ee4202318ba3", routeValues);
951 let url = verData.requestUrl;
952 let options = this.createRequestOptions('application/json', verData.apiVersion);
953 let res;
954 res = yield this.rest.get(url, options);
955 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestMessageLogDetails, true);
956 resolve(ret);
957 }
958 catch (err) {
959 reject(err);
960 }
961 }));
962 });
963 }
964 /**
965 * Get summary of test results.
966 *
967 * @param {string} project - Project ID or project name
968 * @param {number} pipelineId - Pipeline Id. This is same as build Id.
969 * @param {string} stageName - Name of the stage. Maximum supported length for name is 256 character.
970 * @param {string} phaseName - Name of the phase. Maximum supported length for name is 256 character.
971 * @param {string} jobName - Matrixing in YAML generates copies of a job with different inputs in matrix. JobName is the name of those input. Maximum supported length for name is 256 character.
972 * @param {Contracts.Metrics[]} metricNames
973 * @param {boolean} groupByNode - Group summary for each node of the pipleine heirarchy
974 */
975 getTestPipelineMetrics(project, pipelineId, stageName, phaseName, jobName, metricNames, groupByNode) {
976 return __awaiter(this, void 0, void 0, function* () {
977 if (pipelineId == null) {
978 throw new TypeError('pipelineId can not be null or undefined');
979 }
980 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
981 let routeValues = {
982 project: project
983 };
984 let queryValues = {
985 pipelineId: pipelineId,
986 stageName: stageName,
987 phaseName: phaseName,
988 jobName: jobName,
989 metricNames: metricNames && metricNames.join(","),
990 groupByNode: groupByNode,
991 };
992 try {
993 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "65f35817-86a1-4131-b38b-3ec2d4744e53", routeValues, queryValues);
994 let url = verData.requestUrl;
995 let options = this.createRequestOptions('application/json', verData.apiVersion);
996 let res;
997 res = yield this.rest.get(url, options);
998 let ret = this.formatResponse(res.result, Contracts.TypeInfo.PipelineTestMetrics, false);
999 resolve(ret);
1000 }
1001 catch (err) {
1002 reject(err);
1003 }
1004 }));
1005 });
1006 }
1007 /**
1008 * @param {string} project - Project ID or project name
1009 * @param {number} buildId
1010 * @param {string} publishContext
1011 * @param {string} groupBy
1012 * @param {string} filter
1013 * @param {string} orderby
1014 * @param {boolean} shouldIncludeResults
1015 * @param {boolean} queryRunSummaryForInProgress
1016 */
1017 getTestResultDetailsForBuild(project, buildId, publishContext, groupBy, filter, orderby, shouldIncludeResults, queryRunSummaryForInProgress) {
1018 return __awaiter(this, void 0, void 0, function* () {
1019 if (buildId == null) {
1020 throw new TypeError('buildId can not be null or undefined');
1021 }
1022 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1023 let routeValues = {
1024 project: project
1025 };
1026 let queryValues = {
1027 buildId: buildId,
1028 publishContext: publishContext,
1029 groupBy: groupBy,
1030 '$filter': filter,
1031 '$orderby': orderby,
1032 shouldIncludeResults: shouldIncludeResults,
1033 queryRunSummaryForInProgress: queryRunSummaryForInProgress,
1034 };
1035 try {
1036 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "a518c749-4524-45b2-a7ef-1ac009b312cd", routeValues, queryValues);
1037 let url = verData.requestUrl;
1038 let options = this.createRequestOptions('application/json', verData.apiVersion);
1039 let res;
1040 res = yield this.rest.get(url, options);
1041 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestResultsDetails, false);
1042 resolve(ret);
1043 }
1044 catch (err) {
1045 reject(err);
1046 }
1047 }));
1048 });
1049 }
1050 /**
1051 * @param {string} project - Project ID or project name
1052 * @param {number} releaseId
1053 * @param {number} releaseEnvId
1054 * @param {string} publishContext
1055 * @param {string} groupBy
1056 * @param {string} filter
1057 * @param {string} orderby
1058 * @param {boolean} shouldIncludeResults
1059 * @param {boolean} queryRunSummaryForInProgress
1060 */
1061 getTestResultDetailsForRelease(project, releaseId, releaseEnvId, publishContext, groupBy, filter, orderby, shouldIncludeResults, queryRunSummaryForInProgress) {
1062 return __awaiter(this, void 0, void 0, function* () {
1063 if (releaseId == null) {
1064 throw new TypeError('releaseId can not be null or undefined');
1065 }
1066 if (releaseEnvId == null) {
1067 throw new TypeError('releaseEnvId can not be null or undefined');
1068 }
1069 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1070 let routeValues = {
1071 project: project
1072 };
1073 let queryValues = {
1074 releaseId: releaseId,
1075 releaseEnvId: releaseEnvId,
1076 publishContext: publishContext,
1077 groupBy: groupBy,
1078 '$filter': filter,
1079 '$orderby': orderby,
1080 shouldIncludeResults: shouldIncludeResults,
1081 queryRunSummaryForInProgress: queryRunSummaryForInProgress,
1082 };
1083 try {
1084 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "19a8183a-69fb-47d7-bfbf-1b6b0d921294", routeValues, queryValues);
1085 let url = verData.requestUrl;
1086 let options = this.createRequestOptions('application/json', verData.apiVersion);
1087 let res;
1088 res = yield this.rest.get(url, options);
1089 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestResultsDetails, false);
1090 resolve(ret);
1091 }
1092 catch (err) {
1093 reject(err);
1094 }
1095 }));
1096 });
1097 }
1098 /**
1099 * @param {Contracts.TestResultDocument} document
1100 * @param {string} project - Project ID or project name
1101 * @param {number} runId
1102 */
1103 publishTestResultDocument(document, project, runId) {
1104 return __awaiter(this, void 0, void 0, function* () {
1105 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1106 let routeValues = {
1107 project: project,
1108 runId: runId
1109 };
1110 try {
1111 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "74838649-b038-42f1-a0e7-6deb3973bf14", routeValues);
1112 let url = verData.requestUrl;
1113 let options = this.createRequestOptions('application/json', verData.apiVersion);
1114 let res;
1115 res = yield this.rest.create(url, document, options);
1116 let ret = this.formatResponse(res.result, null, false);
1117 resolve(ret);
1118 }
1119 catch (err) {
1120 reject(err);
1121 }
1122 }));
1123 });
1124 }
1125 /**
1126 * @param {string} project - Project ID or project name
1127 * @param {number} buildId
1128 * @param {string} publishContext
1129 * @param {string[]} fields
1130 * @param {string} continuationToken
1131 */
1132 getResultGroupsByBuild(project, buildId, publishContext, fields, continuationToken) {
1133 return __awaiter(this, void 0, void 0, function* () {
1134 if (buildId == null) {
1135 throw new TypeError('buildId can not be null or undefined');
1136 }
1137 if (publishContext == null) {
1138 throw new TypeError('publishContext can not be null or undefined');
1139 }
1140 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1141 let routeValues = {
1142 project: project
1143 };
1144 let queryValues = {
1145 buildId: buildId,
1146 publishContext: publishContext,
1147 fields: fields && fields.join(","),
1148 continuationToken: continuationToken,
1149 };
1150 try {
1151 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "e49244d1-c49f-49ad-a717-3bbaefe6a201", routeValues, queryValues);
1152 let url = verData.requestUrl;
1153 let options = this.createRequestOptions('application/json', verData.apiVersion);
1154 let res;
1155 res = yield this.rest.get(url, options);
1156 let ret = this.formatResponse(res.result, null, true);
1157 resolve(ret);
1158 }
1159 catch (err) {
1160 reject(err);
1161 }
1162 }));
1163 });
1164 }
1165 /**
1166 * @param {string} project - Project ID or project name
1167 * @param {number} releaseId
1168 * @param {string} publishContext
1169 * @param {number} releaseEnvId
1170 * @param {string[]} fields
1171 * @param {string} continuationToken
1172 */
1173 getResultGroupsByRelease(project, releaseId, publishContext, releaseEnvId, fields, continuationToken) {
1174 return __awaiter(this, void 0, void 0, function* () {
1175 if (releaseId == null) {
1176 throw new TypeError('releaseId can not be null or undefined');
1177 }
1178 if (publishContext == null) {
1179 throw new TypeError('publishContext can not be null or undefined');
1180 }
1181 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1182 let routeValues = {
1183 project: project
1184 };
1185 let queryValues = {
1186 releaseId: releaseId,
1187 publishContext: publishContext,
1188 releaseEnvId: releaseEnvId,
1189 fields: fields && fields.join(","),
1190 continuationToken: continuationToken,
1191 };
1192 try {
1193 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "3c2b6bb0-0620-434a-a5c3-26aa0fcfda15", routeValues, queryValues);
1194 let url = verData.requestUrl;
1195 let options = this.createRequestOptions('application/json', verData.apiVersion);
1196 let res;
1197 res = yield this.rest.get(url, options);
1198 let ret = this.formatResponse(res.result, null, true);
1199 resolve(ret);
1200 }
1201 catch (err) {
1202 reject(err);
1203 }
1204 }));
1205 });
1206 }
1207 /**
1208 * Get list of test Result meta data details for corresponding testcasereferenceId
1209 *
1210 * @param {string[]} testCaseReferenceIds - TestCaseReference Ids of the test Result to be queried, comma separated list of valid ids (limit no. of ids 200).
1211 * @param {string} project - Project ID or project name
1212 * @param {Contracts.ResultMetaDataDetails} detailsToInclude - Details to include with test results metadata. Default is None. Other values are FlakyIdentifiers.
1213 */
1214 queryTestResultsMetaData(testCaseReferenceIds, project, detailsToInclude) {
1215 return __awaiter(this, void 0, void 0, function* () {
1216 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1217 let routeValues = {
1218 project: project
1219 };
1220 let queryValues = {
1221 detailsToInclude: detailsToInclude,
1222 };
1223 try {
1224 let verData = yield this.vsoClient.getVersioningData("7.2-preview.4", "testresults", "b72ff4c0-4341-4213-ba27-f517cf341c95", routeValues, queryValues);
1225 let url = verData.requestUrl;
1226 let options = this.createRequestOptions('application/json', verData.apiVersion);
1227 let res;
1228 res = yield this.rest.create(url, testCaseReferenceIds, options);
1229 let ret = this.formatResponse(res.result, null, true);
1230 resolve(ret);
1231 }
1232 catch (err) {
1233 reject(err);
1234 }
1235 }));
1236 });
1237 }
1238 /**
1239 * Update properties of test result meta data
1240 *
1241 * @param {Contracts.TestResultMetaDataUpdateInput} testResultMetaDataUpdateInput - TestResultMetaData update input TestResultMetaDataUpdateInput
1242 * @param {string} project - Project ID or project name
1243 * @param {number} testCaseReferenceId - TestCaseReference Id of Test Result to be updated.
1244 */
1245 updateTestResultsMetaData(testResultMetaDataUpdateInput, project, testCaseReferenceId) {
1246 return __awaiter(this, void 0, void 0, function* () {
1247 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1248 let routeValues = {
1249 project: project,
1250 testCaseReferenceId: testCaseReferenceId
1251 };
1252 try {
1253 let verData = yield this.vsoClient.getVersioningData("7.2-preview.4", "testresults", "b72ff4c0-4341-4213-ba27-f517cf341c95", routeValues);
1254 let url = verData.requestUrl;
1255 let options = this.createRequestOptions('application/json', verData.apiVersion);
1256 let res;
1257 res = yield this.rest.update(url, testResultMetaDataUpdateInput, options);
1258 let ret = this.formatResponse(res.result, null, false);
1259 resolve(ret);
1260 }
1261 catch (err) {
1262 reject(err);
1263 }
1264 }));
1265 });
1266 }
1267 /**
1268 * @param {Contracts.TestResultsQuery} query
1269 * @param {string} project - Project ID or project name
1270 */
1271 getTestResultsByQuery(query, project) {
1272 return __awaiter(this, void 0, void 0, function* () {
1273 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1274 let routeValues = {
1275 project: project
1276 };
1277 try {
1278 let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "14033a2c-af25-4af1-9e39-8ef6900482e3", routeValues);
1279 let url = verData.requestUrl;
1280 let options = this.createRequestOptions('application/json', verData.apiVersion);
1281 let res;
1282 res = yield this.rest.create(url, query, options);
1283 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestResultsQuery, false);
1284 resolve(ret);
1285 }
1286 catch (err) {
1287 reject(err);
1288 }
1289 }));
1290 });
1291 }
1292 /**
1293 * @param {Contracts.QueryModel} queryModel
1294 * @param {string} project - Project ID or project name
1295 * @param {boolean} includeResultDetails
1296 * @param {boolean} includeIterationDetails
1297 * @param {number} skip
1298 * @param {number} top
1299 */
1300 getTestResultsByQueryWiql(queryModel, project, includeResultDetails, includeIterationDetails, skip, top) {
1301 return __awaiter(this, void 0, void 0, function* () {
1302 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1303 let routeValues = {
1304 project: project
1305 };
1306 let queryValues = {
1307 includeResultDetails: includeResultDetails,
1308 includeIterationDetails: includeIterationDetails,
1309 '$skip': skip,
1310 '$top': top,
1311 };
1312 try {
1313 let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "5ea78be3-2f5a-4110-8034-c27f24c62db1", routeValues, queryValues);
1314 let url = verData.requestUrl;
1315 let options = this.createRequestOptions('application/json', verData.apiVersion);
1316 let res;
1317 res = yield this.rest.create(url, queryModel, options);
1318 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestCaseResult, true);
1319 resolve(ret);
1320 }
1321 catch (err) {
1322 reject(err);
1323 }
1324 }));
1325 });
1326 }
1327 /**
1328 * @param {Contracts.TestCaseResult[]} results
1329 * @param {string} project - Project ID or project name
1330 * @param {number} runId
1331 */
1332 addTestResultsToTestRun(results, project, runId) {
1333 return __awaiter(this, void 0, void 0, function* () {
1334 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1335 let routeValues = {
1336 project: project,
1337 runId: runId
1338 };
1339 try {
1340 let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "02afa165-e79a-4d70-8f0c-2af0f35b4e07", routeValues);
1341 let url = verData.requestUrl;
1342 let options = this.createRequestOptions('application/json', verData.apiVersion);
1343 let res;
1344 res = yield this.rest.create(url, results, options);
1345 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestCaseResult, true);
1346 resolve(ret);
1347 }
1348 catch (err) {
1349 reject(err);
1350 }
1351 }));
1352 });
1353 }
1354 /**
1355 * @param {string} project - Project ID or project name
1356 * @param {number} runId
1357 * @param {number} testResultId
1358 * @param {Contracts.ResultDetails} detailsToInclude
1359 */
1360 getTestResultById(project, runId, testResultId, detailsToInclude) {
1361 return __awaiter(this, void 0, void 0, function* () {
1362 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1363 let routeValues = {
1364 project: project,
1365 runId: runId,
1366 testResultId: testResultId
1367 };
1368 let queryValues = {
1369 detailsToInclude: detailsToInclude,
1370 };
1371 try {
1372 let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "02afa165-e79a-4d70-8f0c-2af0f35b4e07", routeValues, queryValues);
1373 let url = verData.requestUrl;
1374 let options = this.createRequestOptions('application/json', verData.apiVersion);
1375 let res;
1376 res = yield this.rest.get(url, options);
1377 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestCaseResult, false);
1378 resolve(ret);
1379 }
1380 catch (err) {
1381 reject(err);
1382 }
1383 }));
1384 });
1385 }
1386 /**
1387 * @param {string} project - Project ID or project name
1388 * @param {number} runId
1389 * @param {Contracts.ResultDetails} detailsToInclude
1390 * @param {number} skip
1391 * @param {number} top
1392 * @param {Contracts.TestOutcome[]} outcomes
1393 * @param {boolean} newTestsOnly
1394 */
1395 getTestResults(project, runId, detailsToInclude, skip, top, outcomes, newTestsOnly) {
1396 return __awaiter(this, void 0, void 0, function* () {
1397 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1398 let routeValues = {
1399 project: project,
1400 runId: runId
1401 };
1402 let queryValues = {
1403 detailsToInclude: detailsToInclude,
1404 '$skip': skip,
1405 '$top': top,
1406 outcomes: outcomes && outcomes.join(","),
1407 '$newTestsOnly': newTestsOnly,
1408 };
1409 try {
1410 let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "02afa165-e79a-4d70-8f0c-2af0f35b4e07", routeValues, queryValues);
1411 let url = verData.requestUrl;
1412 let options = this.createRequestOptions('application/json', verData.apiVersion);
1413 let res;
1414 res = yield this.rest.get(url, options);
1415 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestCaseResult, true);
1416 resolve(ret);
1417 }
1418 catch (err) {
1419 reject(err);
1420 }
1421 }));
1422 });
1423 }
1424 /**
1425 * @param {Contracts.TestCaseResult[]} results
1426 * @param {string} project - Project ID or project name
1427 * @param {number} runId
1428 */
1429 updateTestResults(results, project, runId) {
1430 return __awaiter(this, void 0, void 0, function* () {
1431 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1432 let routeValues = {
1433 project: project,
1434 runId: runId
1435 };
1436 try {
1437 let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "02afa165-e79a-4d70-8f0c-2af0f35b4e07", routeValues);
1438 let url = verData.requestUrl;
1439 let options = this.createRequestOptions('application/json', verData.apiVersion);
1440 let res;
1441 res = yield this.rest.update(url, results, options);
1442 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestCaseResult, true);
1443 resolve(ret);
1444 }
1445 catch (err) {
1446 reject(err);
1447 }
1448 }));
1449 });
1450 }
1451 /**
1452 * @param {string} project - Project ID or project name
1453 * @param {number} buildId
1454 * @param {string} publishContext
1455 * @param {Contracts.TestOutcome[]} outcomes
1456 * @param {number} top
1457 * @param {string} continuationToken
1458 */
1459 getTestResultsByBuild(project, buildId, publishContext, outcomes, top, continuationToken) {
1460 return __awaiter(this, void 0, void 0, function* () {
1461 if (buildId == null) {
1462 throw new TypeError('buildId can not be null or undefined');
1463 }
1464 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1465 let routeValues = {
1466 project: project
1467 };
1468 let queryValues = {
1469 buildId: buildId,
1470 publishContext: publishContext,
1471 outcomes: outcomes && outcomes.join(","),
1472 '$top': top,
1473 continuationToken: continuationToken,
1474 };
1475 try {
1476 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "f48cc885-dbc4-4efc-ab19-ae8c19d1e02a", routeValues, queryValues);
1477 let url = verData.requestUrl;
1478 let options = this.createRequestOptions('application/json', verData.apiVersion);
1479 let res;
1480 res = yield this.rest.get(url, options);
1481 let ret = this.formatResponse(res.result, null, true);
1482 resolve(ret);
1483 }
1484 catch (err) {
1485 reject(err);
1486 }
1487 }));
1488 });
1489 }
1490 /**
1491 * Get a list of results.
1492 *
1493 * @param {string} project - Project ID or project name
1494 * @param {number} pipelineId - Pipeline Id. This is same as build Id.
1495 * @param {string} stageName - Name of the stage. Maximum supported length for name is 256 character.
1496 * @param {string} phaseName - Name of the phase. Maximum supported length for name is 256 character.
1497 * @param {string} jobName - Matrixing in YAML generates copies of a job with different inputs in matrix. JobName is the name of those input. Maximum supported length for name is 256 character.
1498 * @param {Contracts.TestOutcome[]} outcomes - List of outcome of results
1499 * @param {number} top - Maximum number of results to return
1500 * @param {String} continuationToken - Header to pass the continuationToken
1501 */
1502 getTestResultsByPipeline(customHeaders, project, pipelineId, stageName, phaseName, jobName, outcomes, top, continuationToken) {
1503 return __awaiter(this, void 0, void 0, function* () {
1504 if (pipelineId == null) {
1505 throw new TypeError('pipelineId can not be null or undefined');
1506 }
1507 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1508 let routeValues = {
1509 project: project
1510 };
1511 let queryValues = {
1512 pipelineId: pipelineId,
1513 stageName: stageName,
1514 phaseName: phaseName,
1515 jobName: jobName,
1516 outcomes: outcomes && outcomes.join(","),
1517 '$top': top,
1518 };
1519 customHeaders = customHeaders || {};
1520 customHeaders["x-ms-continuationtoken"] = "continuationToken";
1521 try {
1522 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "80169dc2-30c3-4c25-84b2-dd67d7ff1f52", routeValues, queryValues);
1523 let url = verData.requestUrl;
1524 let options = this.createRequestOptions('application/json', verData.apiVersion);
1525 options.additionalHeaders = customHeaders;
1526 let res;
1527 res = yield this.rest.get(url, options);
1528 let ret = this.formatResponse(res.result, null, true);
1529 resolve(ret);
1530 }
1531 catch (err) {
1532 reject(err);
1533 }
1534 }));
1535 });
1536 }
1537 /**
1538 * @param {string} project - Project ID or project name
1539 * @param {number} releaseId
1540 * @param {number} releaseEnvid
1541 * @param {string} publishContext
1542 * @param {Contracts.TestOutcome[]} outcomes
1543 * @param {number} top
1544 * @param {string} continuationToken
1545 */
1546 getTestResultsByRelease(project, releaseId, releaseEnvid, publishContext, outcomes, top, continuationToken) {
1547 return __awaiter(this, void 0, void 0, function* () {
1548 if (releaseId == null) {
1549 throw new TypeError('releaseId can not be null or undefined');
1550 }
1551 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1552 let routeValues = {
1553 project: project
1554 };
1555 let queryValues = {
1556 releaseId: releaseId,
1557 releaseEnvid: releaseEnvid,
1558 publishContext: publishContext,
1559 outcomes: outcomes && outcomes.join(","),
1560 '$top': top,
1561 continuationToken: continuationToken,
1562 };
1563 try {
1564 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "3994b949-77e5-495d-8034-edf80d95b84e", routeValues, queryValues);
1565 let url = verData.requestUrl;
1566 let options = this.createRequestOptions('application/json', verData.apiVersion);
1567 let res;
1568 res = yield this.rest.get(url, options);
1569 let ret = this.formatResponse(res.result, null, true);
1570 resolve(ret);
1571 }
1572 catch (err) {
1573 reject(err);
1574 }
1575 }));
1576 });
1577 }
1578 /**
1579 * Get all the available groups details and for these groups get failed and aborted results.
1580 *
1581 * @param {string} project - Project ID or project name
1582 * @param {number} pipelineId - Pipeline Id. This is same as build Id.
1583 * @param {string} stageName - Name of the stage. Maximum supported length for name is 256 character.
1584 * @param {string} phaseName - Name of the phase. Maximum supported length for name is 256 character.
1585 * @param {string} jobName - Matrixing in YAML generates copies of a job with different inputs in matrix. JobName is the name of those input. Maximum supported length for name is 256 character.
1586 * @param {boolean} shouldIncludeFailedAndAbortedResults - If true, it will return Ids of failed and aborted results for each test group
1587 * @param {boolean} queryGroupSummaryForInProgress - If true, it will calculate summary for InProgress runs as well.
1588 */
1589 testResultsGroupDetails(project, pipelineId, stageName, phaseName, jobName, shouldIncludeFailedAndAbortedResults, queryGroupSummaryForInProgress) {
1590 return __awaiter(this, void 0, void 0, function* () {
1591 if (pipelineId == null) {
1592 throw new TypeError('pipelineId can not be null or undefined');
1593 }
1594 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1595 let routeValues = {
1596 project: project
1597 };
1598 let queryValues = {
1599 pipelineId: pipelineId,
1600 stageName: stageName,
1601 phaseName: phaseName,
1602 jobName: jobName,
1603 shouldIncludeFailedAndAbortedResults: shouldIncludeFailedAndAbortedResults,
1604 queryGroupSummaryForInProgress: queryGroupSummaryForInProgress,
1605 };
1606 try {
1607 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "f903b850-06af-4b50-a344-d7bbfb19e93b", routeValues, queryValues);
1608 let url = verData.requestUrl;
1609 let options = this.createRequestOptions('application/json', verData.apiVersion);
1610 let res;
1611 res = yield this.rest.get(url, options);
1612 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestResultsDetails, false);
1613 resolve(ret);
1614 }
1615 catch (err) {
1616 reject(err);
1617 }
1618 }));
1619 });
1620 }
1621 /**
1622 * @param {string} project - Project ID or project name
1623 * @param {number} buildId
1624 * @param {string} publishContext
1625 * @param {boolean} includeFailureDetails
1626 * @param {Contracts.BuildReference} buildToCompare
1627 */
1628 queryTestResultsReportForBuild(project, buildId, publishContext, includeFailureDetails, buildToCompare) {
1629 return __awaiter(this, void 0, void 0, function* () {
1630 if (buildId == null) {
1631 throw new TypeError('buildId can not be null or undefined');
1632 }
1633 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1634 let routeValues = {
1635 project: project
1636 };
1637 let queryValues = {
1638 buildId: buildId,
1639 publishContext: publishContext,
1640 includeFailureDetails: includeFailureDetails,
1641 buildToCompare: buildToCompare,
1642 };
1643 try {
1644 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "e009fa95-95a5-4ad4-9681-590043ce2423", routeValues, queryValues);
1645 let url = verData.requestUrl;
1646 let options = this.createRequestOptions('application/json', verData.apiVersion);
1647 let res;
1648 res = yield this.rest.get(url, options);
1649 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestResultSummary, false);
1650 resolve(ret);
1651 }
1652 catch (err) {
1653 reject(err);
1654 }
1655 }));
1656 });
1657 }
1658 /**
1659 * Get summary of test results.
1660 *
1661 * @param {string} project - Project ID or project name
1662 * @param {number} pipelineId - Pipeline Id. This is same as build Id.
1663 * @param {string} stageName - Name of the stage. Maximum supported length for name is 256 character.
1664 * @param {string} phaseName - Name of the phase. Maximum supported length for name is 256 character.
1665 * @param {string} jobName - Matrixing in YAML generates copies of a job with different inputs in matrix. JobName is the name of those input. Maximum supported length for name is 256 character.
1666 * @param {boolean} includeFailureDetails - If true returns failure insights
1667 */
1668 queryTestResultsReportForPipeline(project, pipelineId, stageName, phaseName, jobName, includeFailureDetails) {
1669 return __awaiter(this, void 0, void 0, function* () {
1670 if (pipelineId == null) {
1671 throw new TypeError('pipelineId can not be null or undefined');
1672 }
1673 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1674 let routeValues = {
1675 project: project
1676 };
1677 let queryValues = {
1678 pipelineId: pipelineId,
1679 stageName: stageName,
1680 phaseName: phaseName,
1681 jobName: jobName,
1682 includeFailureDetails: includeFailureDetails,
1683 };
1684 try {
1685 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "71f746a1-7d68-40fe-b705-9d821a73dff2", routeValues, queryValues);
1686 let url = verData.requestUrl;
1687 let options = this.createRequestOptions('application/json', verData.apiVersion);
1688 let res;
1689 res = yield this.rest.get(url, options);
1690 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestResultSummary, false);
1691 resolve(ret);
1692 }
1693 catch (err) {
1694 reject(err);
1695 }
1696 }));
1697 });
1698 }
1699 /**
1700 * @param {string} project - Project ID or project name
1701 * @param {number} releaseId
1702 * @param {number} releaseEnvId
1703 * @param {string} publishContext
1704 * @param {boolean} includeFailureDetails
1705 * @param {Contracts.ReleaseReference} releaseToCompare
1706 */
1707 queryTestResultsReportForRelease(project, releaseId, releaseEnvId, publishContext, includeFailureDetails, releaseToCompare) {
1708 return __awaiter(this, void 0, void 0, function* () {
1709 if (releaseId == null) {
1710 throw new TypeError('releaseId can not be null or undefined');
1711 }
1712 if (releaseEnvId == null) {
1713 throw new TypeError('releaseEnvId can not be null or undefined');
1714 }
1715 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1716 let routeValues = {
1717 project: project
1718 };
1719 let queryValues = {
1720 releaseId: releaseId,
1721 releaseEnvId: releaseEnvId,
1722 publishContext: publishContext,
1723 includeFailureDetails: includeFailureDetails,
1724 releaseToCompare: releaseToCompare,
1725 };
1726 try {
1727 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "f10f9577-2c04-45ab-8c99-b26567a7cd55", routeValues, queryValues);
1728 let url = verData.requestUrl;
1729 let options = this.createRequestOptions('application/json', verData.apiVersion);
1730 let res;
1731 res = yield this.rest.get(url, options);
1732 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestResultSummary, false);
1733 resolve(ret);
1734 }
1735 catch (err) {
1736 reject(err);
1737 }
1738 }));
1739 });
1740 }
1741 /**
1742 * @param {Contracts.ReleaseReference[]} releases
1743 * @param {string} project - Project ID or project name
1744 */
1745 queryTestResultsSummaryForReleases(releases, project) {
1746 return __awaiter(this, void 0, void 0, function* () {
1747 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1748 let routeValues = {
1749 project: project
1750 };
1751 try {
1752 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "f10f9577-2c04-45ab-8c99-b26567a7cd55", routeValues);
1753 let url = verData.requestUrl;
1754 let options = this.createRequestOptions('application/json', verData.apiVersion);
1755 let res;
1756 res = yield this.rest.create(url, releases, options);
1757 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestResultSummary, true);
1758 resolve(ret);
1759 }
1760 catch (err) {
1761 reject(err);
1762 }
1763 }));
1764 });
1765 }
1766 /**
1767 * @param {Contracts.TestResultsContext} resultsContext
1768 * @param {string} project - Project ID or project name
1769 * @param {number[]} workItemIds
1770 */
1771 queryTestSummaryByRequirement(resultsContext, project, workItemIds) {
1772 return __awaiter(this, void 0, void 0, function* () {
1773 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1774 let routeValues = {
1775 project: project
1776 };
1777 let queryValues = {
1778 workItemIds: workItemIds && workItemIds.join(","),
1779 };
1780 try {
1781 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "3b7fd26f-c335-4e55-afc1-a588f5e2af3c", routeValues, queryValues);
1782 let url = verData.requestUrl;
1783 let options = this.createRequestOptions('application/json', verData.apiVersion);
1784 let res;
1785 res = yield this.rest.create(url, resultsContext, options);
1786 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestSummaryForWorkItem, true);
1787 resolve(ret);
1788 }
1789 catch (err) {
1790 reject(err);
1791 }
1792 }));
1793 });
1794 }
1795 /**
1796 * @param {Contracts.TestResultTrendFilter} filter
1797 * @param {string} project - Project ID or project name
1798 */
1799 queryResultTrendForBuild(filter, project) {
1800 return __awaiter(this, void 0, void 0, function* () {
1801 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1802 let routeValues = {
1803 project: project
1804 };
1805 try {
1806 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "0886a7ae-315a-4dba-9122-bcce93301f3a", routeValues);
1807 let url = verData.requestUrl;
1808 let options = this.createRequestOptions('application/json', verData.apiVersion);
1809 let res;
1810 res = yield this.rest.create(url, filter, options);
1811 let ret = this.formatResponse(res.result, Contracts.TypeInfo.AggregatedDataForResultTrend, true);
1812 resolve(ret);
1813 }
1814 catch (err) {
1815 reject(err);
1816 }
1817 }));
1818 });
1819 }
1820 /**
1821 * @param {Contracts.TestResultTrendFilter} filter
1822 * @param {string} project - Project ID or project name
1823 */
1824 queryResultTrendForRelease(filter, project) {
1825 return __awaiter(this, void 0, void 0, function* () {
1826 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1827 let routeValues = {
1828 project: project
1829 };
1830 try {
1831 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "107f23c3-359a-460a-a70c-63ee739f9f9a", routeValues);
1832 let url = verData.requestUrl;
1833 let options = this.createRequestOptions('application/json', verData.apiVersion);
1834 let res;
1835 res = yield this.rest.create(url, filter, options);
1836 let ret = this.formatResponse(res.result, Contracts.TypeInfo.AggregatedDataForResultTrend, true);
1837 resolve(ret);
1838 }
1839 catch (err) {
1840 reject(err);
1841 }
1842 }));
1843 });
1844 }
1845 /**
1846 * @param {Contracts.RunCreateModel} testRun
1847 * @param {string} project - Project ID or project name
1848 */
1849 createTestRun(testRun, project) {
1850 return __awaiter(this, void 0, void 0, function* () {
1851 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1852 let routeValues = {
1853 project: project
1854 };
1855 try {
1856 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "364538f9-8062-4ce0-b024-75a0fb463f0d", routeValues);
1857 let url = verData.requestUrl;
1858 let options = this.createRequestOptions('application/json', verData.apiVersion);
1859 let res;
1860 res = yield this.rest.create(url, testRun, options);
1861 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestRun, false);
1862 resolve(ret);
1863 }
1864 catch (err) {
1865 reject(err);
1866 }
1867 }));
1868 });
1869 }
1870 /**
1871 * @param {string} project - Project ID or project name
1872 * @param {number} runId
1873 */
1874 deleteTestRun(project, runId) {
1875 return __awaiter(this, void 0, void 0, function* () {
1876 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1877 let routeValues = {
1878 project: project,
1879 runId: runId
1880 };
1881 try {
1882 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "364538f9-8062-4ce0-b024-75a0fb463f0d", routeValues);
1883 let url = verData.requestUrl;
1884 let options = this.createRequestOptions('application/json', verData.apiVersion);
1885 let res;
1886 res = yield this.rest.del(url, options);
1887 let ret = this.formatResponse(res.result, null, false);
1888 resolve(ret);
1889 }
1890 catch (err) {
1891 reject(err);
1892 }
1893 }));
1894 });
1895 }
1896 /**
1897 * @param {string} project - Project ID or project name
1898 * @param {number} runId
1899 * @param {boolean} includeDetails
1900 * @param {boolean} includeTags
1901 */
1902 getTestRunById(project, runId, includeDetails, includeTags) {
1903 return __awaiter(this, void 0, void 0, function* () {
1904 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1905 let routeValues = {
1906 project: project,
1907 runId: runId
1908 };
1909 let queryValues = {
1910 includeDetails: includeDetails,
1911 includeTags: includeTags,
1912 };
1913 try {
1914 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "364538f9-8062-4ce0-b024-75a0fb463f0d", routeValues, queryValues);
1915 let url = verData.requestUrl;
1916 let options = this.createRequestOptions('application/json', verData.apiVersion);
1917 let res;
1918 res = yield this.rest.get(url, options);
1919 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestRun, false);
1920 resolve(ret);
1921 }
1922 catch (err) {
1923 reject(err);
1924 }
1925 }));
1926 });
1927 }
1928 /**
1929 * @param {string} project - Project ID or project name
1930 * @param {string} buildUri
1931 * @param {string} owner
1932 * @param {string} tmiRunId
1933 * @param {number} planId
1934 * @param {boolean} includeRunDetails
1935 * @param {boolean} automated
1936 * @param {number} skip
1937 * @param {number} top
1938 */
1939 getTestRuns(project, buildUri, owner, tmiRunId, planId, includeRunDetails, automated, skip, top) {
1940 return __awaiter(this, void 0, void 0, function* () {
1941 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
1942 let routeValues = {
1943 project: project
1944 };
1945 let queryValues = {
1946 buildUri: buildUri,
1947 owner: owner,
1948 tmiRunId: tmiRunId,
1949 planId: planId,
1950 includeRunDetails: includeRunDetails,
1951 automated: automated,
1952 '$skip': skip,
1953 '$top': top,
1954 };
1955 try {
1956 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "364538f9-8062-4ce0-b024-75a0fb463f0d", routeValues, queryValues);
1957 let url = verData.requestUrl;
1958 let options = this.createRequestOptions('application/json', verData.apiVersion);
1959 let res;
1960 res = yield this.rest.get(url, options);
1961 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestRun, true);
1962 resolve(ret);
1963 }
1964 catch (err) {
1965 reject(err);
1966 }
1967 }));
1968 });
1969 }
1970 /**
1971 * Query Test Runs based on filters. Mandatory fields are minLastUpdatedDate and maxLastUpdatedDate.
1972 *
1973 * @param {string} project - Project ID or project name
1974 * @param {Date} minLastUpdatedDate - Minimum Last Modified Date of run to be queried (Mandatory).
1975 * @param {Date} maxLastUpdatedDate - Maximum Last Modified Date of run to be queried (Mandatory, difference between min and max date can be atmost 7 days).
1976 * @param {Contracts.TestRunState} state - Current state of the Runs to be queried.
1977 * @param {number[]} planIds - Plan Ids of the Runs to be queried, comma separated list of valid ids.
1978 * @param {boolean} isAutomated - Automation type of the Runs to be queried.
1979 * @param {Contracts.TestRunPublishContext} publishContext - PublishContext of the Runs to be queried.
1980 * @param {number[]} buildIds - Build Ids of the Runs to be queried, comma separated list of valid ids.
1981 * @param {number[]} buildDefIds - Build Definition Ids of the Runs to be queried, comma separated list of valid ids.
1982 * @param {string} branchName - Source Branch name of the Runs to be queried.
1983 * @param {number[]} releaseIds - Release Ids of the Runs to be queried, comma separated list of valid ids.
1984 * @param {number[]} releaseDefIds - Release Definition Ids of the Runs to be queried, comma separated list of valid ids.
1985 * @param {number[]} releaseEnvIds - Release Environment Ids of the Runs to be queried, comma separated list of valid ids.
1986 * @param {number[]} releaseEnvDefIds - Release Environment Definition Ids of the Runs to be queried, comma separated list of valid ids.
1987 * @param {string} runTitle - Run Title of the Runs to be queried.
1988 * @param {number} top - Number of runs to be queried. Limit is 100
1989 * @param {string} continuationToken - continuationToken received from previous batch or null for first batch. It is not supposed to be created (or altered, if received from last batch) by user.
1990 */
1991 queryTestRuns(project, minLastUpdatedDate, maxLastUpdatedDate, state, planIds, isAutomated, publishContext, buildIds, buildDefIds, branchName, releaseIds, releaseDefIds, releaseEnvIds, releaseEnvDefIds, runTitle, top, continuationToken) {
1992 return __awaiter(this, void 0, void 0, function* () {
1993 if (minLastUpdatedDate == null) {
1994 throw new TypeError('minLastUpdatedDate can not be null or undefined');
1995 }
1996 if (maxLastUpdatedDate == null) {
1997 throw new TypeError('maxLastUpdatedDate can not be null or undefined');
1998 }
1999 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2000 let routeValues = {
2001 project: project
2002 };
2003 let queryValues = {
2004 minLastUpdatedDate: minLastUpdatedDate,
2005 maxLastUpdatedDate: maxLastUpdatedDate,
2006 state: state,
2007 planIds: planIds && planIds.join(","),
2008 isAutomated: isAutomated,
2009 publishContext: publishContext,
2010 buildIds: buildIds && buildIds.join(","),
2011 buildDefIds: buildDefIds && buildDefIds.join(","),
2012 branchName: branchName,
2013 releaseIds: releaseIds && releaseIds.join(","),
2014 releaseDefIds: releaseDefIds && releaseDefIds.join(","),
2015 releaseEnvIds: releaseEnvIds && releaseEnvIds.join(","),
2016 releaseEnvDefIds: releaseEnvDefIds && releaseEnvDefIds.join(","),
2017 runTitle: runTitle,
2018 '$top': top,
2019 continuationToken: continuationToken,
2020 };
2021 try {
2022 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "364538f9-8062-4ce0-b024-75a0fb463f0d", routeValues, queryValues);
2023 let url = verData.requestUrl;
2024 let options = this.createRequestOptions('application/json', verData.apiVersion);
2025 let res;
2026 res = yield this.rest.get(url, options);
2027 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestRun, true);
2028 resolve(ret);
2029 }
2030 catch (err) {
2031 reject(err);
2032 }
2033 }));
2034 });
2035 }
2036 /**
2037 * @param {Contracts.RunUpdateModel} runUpdateModel
2038 * @param {string} project - Project ID or project name
2039 * @param {number} runId
2040 */
2041 updateTestRun(runUpdateModel, project, runId) {
2042 return __awaiter(this, void 0, void 0, function* () {
2043 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2044 let routeValues = {
2045 project: project,
2046 runId: runId
2047 };
2048 try {
2049 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "364538f9-8062-4ce0-b024-75a0fb463f0d", routeValues);
2050 let url = verData.requestUrl;
2051 let options = this.createRequestOptions('application/json', verData.apiVersion);
2052 let res;
2053 res = yield this.rest.update(url, runUpdateModel, options);
2054 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestRun, false);
2055 resolve(ret);
2056 }
2057 catch (err) {
2058 reject(err);
2059 }
2060 }));
2061 });
2062 }
2063 /**
2064 * Get test run summary, used when we want to get summary of a run by outcome. Test run should be in completed state.
2065 *
2066 * @param {string} project - Project ID or project name
2067 * @param {number} runId - ID of the run to get.
2068 */
2069 getTestRunSummaryByOutcome(project, runId) {
2070 return __awaiter(this, void 0, void 0, function* () {
2071 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2072 let routeValues = {
2073 project: project,
2074 runId: runId
2075 };
2076 try {
2077 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "5c6a250c-53b7-4851-990c-42a7a00c8b39", routeValues);
2078 let url = verData.requestUrl;
2079 let options = this.createRequestOptions('application/json', verData.apiVersion);
2080 let res;
2081 res = yield this.rest.get(url, options);
2082 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestRunStatistic, false);
2083 resolve(ret);
2084 }
2085 catch (err) {
2086 reject(err);
2087 }
2088 }));
2089 });
2090 }
2091 /**
2092 * Get TestResultsSettings data
2093 *
2094 * @param {string} project - Project ID or project name
2095 * @param {Contracts.TestResultsSettingsType} settingsType
2096 */
2097 getTestResultsSettings(project, settingsType) {
2098 return __awaiter(this, void 0, void 0, function* () {
2099 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2100 let routeValues = {
2101 project: project
2102 };
2103 let queryValues = {
2104 settingsType: settingsType,
2105 };
2106 try {
2107 let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "testresults", "7319952e-e5a9-4e19-a006-84f3be8b7c68", routeValues, queryValues);
2108 let url = verData.requestUrl;
2109 let options = this.createRequestOptions('application/json', verData.apiVersion);
2110 let res;
2111 res = yield this.rest.get(url, options);
2112 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestResultsSettings, false);
2113 resolve(ret);
2114 }
2115 catch (err) {
2116 reject(err);
2117 }
2118 }));
2119 });
2120 }
2121 /**
2122 * Update project settings of test results
2123 *
2124 * @param {Contracts.TestResultsUpdateSettings} testResultsUpdateSettings
2125 * @param {string} project - Project ID or project name
2126 */
2127 updatePipelinesTestSettings(testResultsUpdateSettings, project) {
2128 return __awaiter(this, void 0, void 0, function* () {
2129 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2130 let routeValues = {
2131 project: project
2132 };
2133 try {
2134 let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "testresults", "7319952e-e5a9-4e19-a006-84f3be8b7c68", routeValues);
2135 let url = verData.requestUrl;
2136 let options = this.createRequestOptions('application/json', verData.apiVersion);
2137 let res;
2138 res = yield this.rest.update(url, testResultsUpdateSettings, options);
2139 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestResultsSettings, false);
2140 resolve(ret);
2141 }
2142 catch (err) {
2143 reject(err);
2144 }
2145 }));
2146 });
2147 }
2148 /**
2149 * Gets the list of results whose failure matches with the provided one.
2150 *
2151 * @param {string} project - Project ID or project name
2152 * @param {number} runId - id of test run
2153 * @param {number} testResultId - id of test result inside a test run
2154 * @param {number} testSubResultId - id of subresult inside a test result
2155 * @param {number} top - Maximum number of results to return
2156 * @param {String} continuationToken - Header to pass the continuationToken
2157 */
2158 getSimilarTestResults(customHeaders, project, runId, testResultId, testSubResultId, top, continuationToken) {
2159 return __awaiter(this, void 0, void 0, function* () {
2160 if (testSubResultId == null) {
2161 throw new TypeError('testSubResultId can not be null or undefined');
2162 }
2163 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2164 let routeValues = {
2165 project: project,
2166 runId: runId,
2167 testResultId: testResultId
2168 };
2169 let queryValues = {
2170 testSubResultId: testSubResultId,
2171 '$top': top,
2172 };
2173 customHeaders = customHeaders || {};
2174 customHeaders["x-ms-continuationtoken"] = "continuationToken";
2175 try {
2176 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "67d0a074-b255-4902-a639-e3e6de7a3de6", routeValues, queryValues);
2177 let url = verData.requestUrl;
2178 let options = this.createRequestOptions('application/json', verData.apiVersion);
2179 options.additionalHeaders = customHeaders;
2180 let res;
2181 res = yield this.rest.get(url, options);
2182 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestCaseResult, true);
2183 resolve(ret);
2184 }
2185 catch (err) {
2186 reject(err);
2187 }
2188 }));
2189 });
2190 }
2191 /**
2192 * Get test run statistics , used when we want to get summary of a run by outcome.
2193 *
2194 * @param {string} project - Project ID or project name
2195 * @param {number} runId - ID of the run to get.
2196 */
2197 getTestRunStatistics(project, runId) {
2198 return __awaiter(this, void 0, void 0, function* () {
2199 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2200 let routeValues = {
2201 project: project,
2202 runId: runId
2203 };
2204 try {
2205 let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "82b986e8-ca9e-4a89-b39e-f65c69bc104a", routeValues);
2206 let url = verData.requestUrl;
2207 let options = this.createRequestOptions('application/json', verData.apiVersion);
2208 let res;
2209 res = yield this.rest.get(url, options);
2210 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestRunStatistic, false);
2211 resolve(ret);
2212 }
2213 catch (err) {
2214 reject(err);
2215 }
2216 }));
2217 });
2218 }
2219 /**
2220 * <p>Gets the coverage status for the last successful build of a definition, optionally scoped to a specific branch</p>
2221 *
2222 * @param {string} project - Project ID or project name
2223 * @param {string} definition - The ID or name of the definition.
2224 * @param {string} branchName - The branch name.
2225 * @param {string} label - The String to replace the default text on the left side of the badge.
2226 */
2227 getCoverageStatusBadge(project, definition, branchName, label) {
2228 return __awaiter(this, void 0, void 0, function* () {
2229 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2230 let routeValues = {
2231 project: project,
2232 definition: definition
2233 };
2234 let queryValues = {
2235 branchName: branchName,
2236 label: label,
2237 };
2238 try {
2239 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "73b7c9d8-defb-4b60-b3d6-2162d60d6b13", routeValues, queryValues);
2240 let url = verData.requestUrl;
2241 let options = this.createRequestOptions('application/json', verData.apiVersion);
2242 let res;
2243 res = yield this.rest.get(url, options);
2244 let ret = this.formatResponse(res.result, null, false);
2245 resolve(ret);
2246 }
2247 catch (err) {
2248 reject(err);
2249 }
2250 }));
2251 });
2252 }
2253 /**
2254 * Get all the tags in a build.
2255 *
2256 * @param {string} project - Project ID or project name
2257 * @param {number} buildId - Build ID
2258 */
2259 getTestTagsForBuild(project, buildId) {
2260 return __awaiter(this, void 0, void 0, function* () {
2261 if (buildId == null) {
2262 throw new TypeError('buildId can not be null or undefined');
2263 }
2264 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2265 let routeValues = {
2266 project: project
2267 };
2268 let queryValues = {
2269 buildId: buildId,
2270 };
2271 try {
2272 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "52ee2057-4b54-41a6-a18c-ed4375a00f8d", routeValues, queryValues);
2273 let url = verData.requestUrl;
2274 let options = this.createRequestOptions('application/json', verData.apiVersion);
2275 let res;
2276 res = yield this.rest.get(url, options);
2277 let ret = this.formatResponse(res.result, null, true);
2278 resolve(ret);
2279 }
2280 catch (err) {
2281 reject(err);
2282 }
2283 }));
2284 });
2285 }
2286 /**
2287 * Get all the tags in a release.
2288 *
2289 * @param {string} project - Project ID or project name
2290 * @param {number} releaseId - Release ID
2291 * @param {number} releaseEnvId - Release environment ID
2292 */
2293 getTestTagsForRelease(project, releaseId, releaseEnvId) {
2294 return __awaiter(this, void 0, void 0, function* () {
2295 if (releaseId == null) {
2296 throw new TypeError('releaseId can not be null or undefined');
2297 }
2298 if (releaseEnvId == null) {
2299 throw new TypeError('releaseEnvId can not be null or undefined');
2300 }
2301 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2302 let routeValues = {
2303 project: project
2304 };
2305 let queryValues = {
2306 releaseId: releaseId,
2307 releaseEnvId: releaseEnvId,
2308 };
2309 try {
2310 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "52ee2057-4b54-41a6-a18c-ed4375a00f8d", routeValues, queryValues);
2311 let url = verData.requestUrl;
2312 let options = this.createRequestOptions('application/json', verData.apiVersion);
2313 let res;
2314 res = yield this.rest.get(url, options);
2315 let ret = this.formatResponse(res.result, null, true);
2316 resolve(ret);
2317 }
2318 catch (err) {
2319 reject(err);
2320 }
2321 }));
2322 });
2323 }
2324 /**
2325 * Update tags of a run, Tags can be Added and Deleted
2326 *
2327 * @param {Contracts.TestTagsUpdateModel} testTagsUpdateModel - TestTagsUpdateModel
2328 * @param {string} project - Project ID or project name
2329 * @param {number} runId - RunId of the run
2330 */
2331 updateTestRunTags(testTagsUpdateModel, project, runId) {
2332 return __awaiter(this, void 0, void 0, function* () {
2333 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2334 let routeValues = {
2335 project: project,
2336 runId: runId
2337 };
2338 try {
2339 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "a5e2f411-2b43-45f3-989c-05b71339f5b8", routeValues);
2340 let url = verData.requestUrl;
2341 let options = this.createRequestOptions('application/json', verData.apiVersion);
2342 let res;
2343 res = yield this.rest.update(url, testTagsUpdateModel, options);
2344 let ret = this.formatResponse(res.result, null, true);
2345 resolve(ret);
2346 }
2347 catch (err) {
2348 reject(err);
2349 }
2350 }));
2351 });
2352 }
2353 /**
2354 * Get all the tags in a build.
2355 *
2356 * @param {string} project - Project ID or project name
2357 * @param {number} buildId - Build ID
2358 */
2359 getTestTagSummaryForBuild(project, buildId) {
2360 return __awaiter(this, void 0, void 0, function* () {
2361 if (buildId == null) {
2362 throw new TypeError('buildId can not be null or undefined');
2363 }
2364 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2365 let routeValues = {
2366 project: project
2367 };
2368 let queryValues = {
2369 buildId: buildId,
2370 };
2371 try {
2372 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "655a8f6b-fec7-4b46-b672-68b44141b498", routeValues, queryValues);
2373 let url = verData.requestUrl;
2374 let options = this.createRequestOptions('application/json', verData.apiVersion);
2375 let res;
2376 res = yield this.rest.get(url, options);
2377 let ret = this.formatResponse(res.result, null, false);
2378 resolve(ret);
2379 }
2380 catch (err) {
2381 reject(err);
2382 }
2383 }));
2384 });
2385 }
2386 /**
2387 * Get all the tags in a release.
2388 *
2389 * @param {string} project - Project ID or project name
2390 * @param {number} releaseId - Release ID
2391 * @param {number} releaseEnvId - Release environment ID
2392 */
2393 getTestTagSummaryForRelease(project, releaseId, releaseEnvId) {
2394 return __awaiter(this, void 0, void 0, function* () {
2395 if (releaseId == null) {
2396 throw new TypeError('releaseId can not be null or undefined');
2397 }
2398 if (releaseEnvId == null) {
2399 throw new TypeError('releaseEnvId can not be null or undefined');
2400 }
2401 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2402 let routeValues = {
2403 project: project
2404 };
2405 let queryValues = {
2406 releaseId: releaseId,
2407 releaseEnvId: releaseEnvId,
2408 };
2409 try {
2410 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "655a8f6b-fec7-4b46-b672-68b44141b498", routeValues, queryValues);
2411 let url = verData.requestUrl;
2412 let options = this.createRequestOptions('application/json', verData.apiVersion);
2413 let res;
2414 res = yield this.rest.get(url, options);
2415 let ret = this.formatResponse(res.result, null, false);
2416 resolve(ret);
2417 }
2418 catch (err) {
2419 reject(err);
2420 }
2421 }));
2422 });
2423 }
2424 /**
2425 * Creates an attachment in the LogStore for the specified buildId.
2426 *
2427 * @param {Contracts.TestAttachmentRequestModel} attachmentRequestModel - Contains attachment info like stream, filename, comment, attachmentType
2428 * @param {string} project - Project ID or project name
2429 * @param {number} buildId - BuildId
2430 */
2431 createBuildAttachmentInLogStore(attachmentRequestModel, project, buildId) {
2432 return __awaiter(this, void 0, void 0, function* () {
2433 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2434 let routeValues = {
2435 project: project,
2436 buildId: buildId
2437 };
2438 try {
2439 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "6f747e16-18c2-435a-b4fb-fa05d6845fee", routeValues);
2440 let url = verData.requestUrl;
2441 let options = this.createRequestOptions('application/json', verData.apiVersion);
2442 let res;
2443 res = yield this.rest.create(url, attachmentRequestModel, options);
2444 let ret = this.formatResponse(res.result, null, false);
2445 resolve(ret);
2446 }
2447 catch (err) {
2448 reject(err);
2449 }
2450 }));
2451 });
2452 }
2453 /**
2454 * Creates an attachment in the LogStore for the specified runId.
2455 *
2456 * @param {Contracts.TestAttachmentRequestModel} attachmentRequestModel - Contains attachment info like stream, filename, comment, attachmentType
2457 * @param {string} project - Project ID or project name
2458 * @param {number} runId - Test RunId
2459 */
2460 createTestRunLogStoreAttachment(attachmentRequestModel, project, runId) {
2461 return __awaiter(this, void 0, void 0, function* () {
2462 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2463 let routeValues = {
2464 project: project,
2465 runId: runId
2466 };
2467 try {
2468 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "1026d5de-4b0b-46ae-a31f-7c59b6af51ef", routeValues);
2469 let url = verData.requestUrl;
2470 let options = this.createRequestOptions('application/json', verData.apiVersion);
2471 let res;
2472 res = yield this.rest.create(url, attachmentRequestModel, options);
2473 let ret = this.formatResponse(res.result, null, false);
2474 resolve(ret);
2475 }
2476 catch (err) {
2477 reject(err);
2478 }
2479 }));
2480 });
2481 }
2482 /**
2483 * Deletes the attachment with the specified filename for the specified runId from the LogStore.
2484 *
2485 * @param {string} project - Project ID or project name
2486 * @param {number} runId - Test RunId
2487 * @param {string} filename - Attachment FileName
2488 */
2489 deleteTestRunLogStoreAttachment(project, runId, filename) {
2490 return __awaiter(this, void 0, void 0, function* () {
2491 if (filename == null) {
2492 throw new TypeError('filename can not be null or undefined');
2493 }
2494 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2495 let routeValues = {
2496 project: project,
2497 runId: runId
2498 };
2499 let queryValues = {
2500 filename: filename,
2501 };
2502 try {
2503 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "1026d5de-4b0b-46ae-a31f-7c59b6af51ef", routeValues, queryValues);
2504 let url = verData.requestUrl;
2505 let options = this.createRequestOptions('application/json', verData.apiVersion);
2506 let res;
2507 res = yield this.rest.del(url, options);
2508 let ret = this.formatResponse(res.result, null, false);
2509 resolve(ret);
2510 }
2511 catch (err) {
2512 reject(err);
2513 }
2514 }));
2515 });
2516 }
2517 /**
2518 * Returns the attachment with the specified filename for the specified runId from the LogStore.
2519 *
2520 * @param {string} project - Project ID or project name
2521 * @param {number} runId - Test RunId
2522 * @param {string} filename - Attachment FileName
2523 */
2524 getTestRunLogStoreAttachmentContent(project, runId, filename) {
2525 return __awaiter(this, void 0, void 0, function* () {
2526 if (filename == null) {
2527 throw new TypeError('filename can not be null or undefined');
2528 }
2529 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2530 let routeValues = {
2531 project: project,
2532 runId: runId
2533 };
2534 let queryValues = {
2535 filename: filename,
2536 };
2537 try {
2538 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "1026d5de-4b0b-46ae-a31f-7c59b6af51ef", routeValues, queryValues);
2539 let url = verData.requestUrl;
2540 let apiVersion = verData.apiVersion;
2541 let accept = this.createAcceptHeader("application/octet-stream", apiVersion);
2542 resolve((yield this.http.get(url, { "Accept": accept })).message);
2543 }
2544 catch (err) {
2545 reject(err);
2546 }
2547 }));
2548 });
2549 }
2550 /**
2551 * Returns a list of attachments for the specified runId from the LogStore.
2552 *
2553 * @param {string} project - Project ID or project name
2554 * @param {number} runId - Test RunId
2555 */
2556 getTestRunLogStoreAttachments(project, runId) {
2557 return __awaiter(this, void 0, void 0, function* () {
2558 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2559 let routeValues = {
2560 project: project,
2561 runId: runId
2562 };
2563 try {
2564 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "1026d5de-4b0b-46ae-a31f-7c59b6af51ef", routeValues);
2565 let url = verData.requestUrl;
2566 let options = this.createRequestOptions('application/json', verData.apiVersion);
2567 let res;
2568 res = yield this.rest.get(url, options);
2569 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestLogStoreAttachment, true);
2570 resolve(ret);
2571 }
2572 catch (err) {
2573 reject(err);
2574 }
2575 }));
2576 });
2577 }
2578 /**
2579 * Returns the attachment with the specified filename for the specified runId from the LogStore.
2580 *
2581 * @param {string} project - Project ID or project name
2582 * @param {number} runId - Test RunId
2583 * @param {string} filename - Attachment FileName
2584 */
2585 getTestRunLogStoreAttachmentZip(project, runId, filename) {
2586 return __awaiter(this, void 0, void 0, function* () {
2587 if (filename == null) {
2588 throw new TypeError('filename can not be null or undefined');
2589 }
2590 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2591 let routeValues = {
2592 project: project,
2593 runId: runId
2594 };
2595 let queryValues = {
2596 filename: filename,
2597 };
2598 try {
2599 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "1026d5de-4b0b-46ae-a31f-7c59b6af51ef", routeValues, queryValues);
2600 let url = verData.requestUrl;
2601 let apiVersion = verData.apiVersion;
2602 let accept = this.createAcceptHeader("application/zip", apiVersion);
2603 resolve((yield this.http.get(url, { "Accept": accept })).message);
2604 }
2605 catch (err) {
2606 reject(err);
2607 }
2608 }));
2609 });
2610 }
2611 /**
2612 * Creates a new test failure type
2613 *
2614 * @param {Contracts.TestResultFailureTypeRequestModel} testResultFailureType
2615 * @param {string} project - Project ID or project name
2616 */
2617 createFailureType(testResultFailureType, project) {
2618 return __awaiter(this, void 0, void 0, function* () {
2619 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2620 let routeValues = {
2621 project: project
2622 };
2623 try {
2624 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "c4ac0486-830c-4a2a-9ef9-e8a1791a70fd", routeValues);
2625 let url = verData.requestUrl;
2626 let options = this.createRequestOptions('application/json', verData.apiVersion);
2627 let res;
2628 res = yield this.rest.create(url, testResultFailureType, options);
2629 let ret = this.formatResponse(res.result, null, false);
2630 resolve(ret);
2631 }
2632 catch (err) {
2633 reject(err);
2634 }
2635 }));
2636 });
2637 }
2638 /**
2639 * Deletes a test failure type with specified failureTypeId
2640 *
2641 * @param {string} project - Project ID or project name
2642 * @param {number} failureTypeId
2643 */
2644 deleteFailureType(project, failureTypeId) {
2645 return __awaiter(this, void 0, void 0, function* () {
2646 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2647 let routeValues = {
2648 project: project,
2649 failureTypeId: failureTypeId
2650 };
2651 try {
2652 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "c4ac0486-830c-4a2a-9ef9-e8a1791a70fd", routeValues);
2653 let url = verData.requestUrl;
2654 let options = this.createRequestOptions('application/json', verData.apiVersion);
2655 let res;
2656 res = yield this.rest.del(url, options);
2657 let ret = this.formatResponse(res.result, null, false);
2658 resolve(ret);
2659 }
2660 catch (err) {
2661 reject(err);
2662 }
2663 }));
2664 });
2665 }
2666 /**
2667 * Returns the list of test failure types.
2668 *
2669 * @param {string} project - Project ID or project name
2670 */
2671 getFailureTypes(project) {
2672 return __awaiter(this, void 0, void 0, function* () {
2673 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2674 let routeValues = {
2675 project: project
2676 };
2677 try {
2678 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "c4ac0486-830c-4a2a-9ef9-e8a1791a70fd", routeValues);
2679 let url = verData.requestUrl;
2680 let options = this.createRequestOptions('application/json', verData.apiVersion);
2681 let res;
2682 res = yield this.rest.get(url, options);
2683 let ret = this.formatResponse(res.result, null, true);
2684 resolve(ret);
2685 }
2686 catch (err) {
2687 reject(err);
2688 }
2689 }));
2690 });
2691 }
2692 /**
2693 * Get history of a test method using TestHistoryQuery
2694 *
2695 * @param {Contracts.TestHistoryQuery} filter - TestHistoryQuery to get history
2696 * @param {string} project - Project ID or project name
2697 */
2698 queryTestHistory(filter, project) {
2699 return __awaiter(this, void 0, void 0, function* () {
2700 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2701 let routeValues = {
2702 project: project
2703 };
2704 try {
2705 let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "2a41bd6a-8118-4403-b74e-5ba7492aed9d", routeValues);
2706 let url = verData.requestUrl;
2707 let options = this.createRequestOptions('application/json', verData.apiVersion);
2708 let res;
2709 res = yield this.rest.create(url, filter, options);
2710 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestHistoryQuery, false);
2711 resolve(ret);
2712 }
2713 catch (err) {
2714 reject(err);
2715 }
2716 }));
2717 });
2718 }
2719 /**
2720 * Get list of build attachments reference
2721 *
2722 * @param {string} project - Project ID or project name
2723 * @param {number} buildId - Id of the build to get
2724 * @param {Contracts.TestLogType} type - type of the attachment to get
2725 * @param {string} directoryPath - directory path for which attachments are needed
2726 * @param {string} fileNamePrefix - file name prefix to filter the list of attachment
2727 * @param {boolean} fetchMetaData - Default is false, set if metadata is needed
2728 * @param {number} top - Number of test attachments reference to return
2729 * @param {String} continuationToken - Header to pass the continuationToken
2730 */
2731 getTestLogsForBuild(customHeaders, project, buildId, type, directoryPath, fileNamePrefix, fetchMetaData, top, continuationToken) {
2732 return __awaiter(this, void 0, void 0, function* () {
2733 if (buildId == null) {
2734 throw new TypeError('buildId can not be null or undefined');
2735 }
2736 if (type == null) {
2737 throw new TypeError('type can not be null or undefined');
2738 }
2739 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2740 let routeValues = {
2741 project: project
2742 };
2743 let queryValues = {
2744 buildId: buildId,
2745 type: type,
2746 directoryPath: directoryPath,
2747 fileNamePrefix: fileNamePrefix,
2748 fetchMetaData: fetchMetaData,
2749 top: top,
2750 };
2751 customHeaders = customHeaders || {};
2752 customHeaders["x-ms-continuationtoken"] = "continuationToken";
2753 try {
2754 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "dff8ce3a-e539-4817-a405-d968491a88f1", routeValues, queryValues);
2755 let url = verData.requestUrl;
2756 let options = this.createRequestOptions('application/json', verData.apiVersion);
2757 options.additionalHeaders = customHeaders;
2758 let res;
2759 res = yield this.rest.get(url, options);
2760 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestLog, true);
2761 resolve(ret);
2762 }
2763 catch (err) {
2764 reject(err);
2765 }
2766 }));
2767 });
2768 }
2769 /**
2770 * Get list of test result attachments reference
2771 *
2772 * @param {string} project - Project ID or project name
2773 * @param {number} runId - Id of the test run that contains the result
2774 * @param {number} resultId - Id of the test result
2775 * @param {Contracts.TestLogType} type - type of attachments to get
2776 * @param {string} directoryPath - directory path of attachments to get
2777 * @param {string} fileNamePrefix - file name prefix to filter the list of attachment
2778 * @param {boolean} fetchMetaData - Default is false, set if metadata is needed
2779 * @param {number} top - Numbe of attachments reference to return
2780 * @param {String} continuationToken - Header to pass the continuationToken
2781 */
2782 getTestResultLogs(customHeaders, project, runId, resultId, type, directoryPath, fileNamePrefix, fetchMetaData, top, continuationToken) {
2783 return __awaiter(this, void 0, void 0, function* () {
2784 if (type == null) {
2785 throw new TypeError('type can not be null or undefined');
2786 }
2787 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2788 let routeValues = {
2789 project: project,
2790 runId: runId,
2791 resultId: resultId
2792 };
2793 let queryValues = {
2794 type: type,
2795 directoryPath: directoryPath,
2796 fileNamePrefix: fileNamePrefix,
2797 fetchMetaData: fetchMetaData,
2798 top: top,
2799 };
2800 customHeaders = customHeaders || {};
2801 customHeaders["x-ms-continuationtoken"] = "continuationToken";
2802 try {
2803 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "714caaac-ae1e-4869-8323-9bc0f5120dbf", routeValues, queryValues);
2804 let url = verData.requestUrl;
2805 let options = this.createRequestOptions('application/json', verData.apiVersion);
2806 options.additionalHeaders = customHeaders;
2807 let res;
2808 res = yield this.rest.get(url, options);
2809 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestLog, true);
2810 resolve(ret);
2811 }
2812 catch (err) {
2813 reject(err);
2814 }
2815 }));
2816 });
2817 }
2818 /**
2819 * Get list of test subresult attachments reference
2820 *
2821 * @param {string} project - Project ID or project name
2822 * @param {number} runId - Id of the test run that contains the results
2823 * @param {number} resultId - Id of the test result that contains subresult
2824 * @param {number} subResultId - Id of the test subresult
2825 * @param {Contracts.TestLogType} type - type of the attachments to get
2826 * @param {string} directoryPath - directory path of the attachment to get
2827 * @param {string} fileNamePrefix - file name prefix to filter the list of attachments
2828 * @param {boolean} fetchMetaData - Default is false, set if metadata is needed
2829 * @param {number} top - Number of attachments reference to return
2830 * @param {String} continuationToken - Header to pass the continuationToken
2831 */
2832 getTestSubResultLogs(customHeaders, project, runId, resultId, subResultId, type, directoryPath, fileNamePrefix, fetchMetaData, top, continuationToken) {
2833 return __awaiter(this, void 0, void 0, function* () {
2834 if (subResultId == null) {
2835 throw new TypeError('subResultId can not be null or undefined');
2836 }
2837 if (type == null) {
2838 throw new TypeError('type can not be null or undefined');
2839 }
2840 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2841 let routeValues = {
2842 project: project,
2843 runId: runId,
2844 resultId: resultId
2845 };
2846 let queryValues = {
2847 subResultId: subResultId,
2848 type: type,
2849 directoryPath: directoryPath,
2850 fileNamePrefix: fileNamePrefix,
2851 fetchMetaData: fetchMetaData,
2852 top: top,
2853 };
2854 customHeaders = customHeaders || {};
2855 customHeaders["x-ms-continuationtoken"] = "continuationToken";
2856 try {
2857 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "714caaac-ae1e-4869-8323-9bc0f5120dbf", routeValues, queryValues);
2858 let url = verData.requestUrl;
2859 let options = this.createRequestOptions('application/json', verData.apiVersion);
2860 options.additionalHeaders = customHeaders;
2861 let res;
2862 res = yield this.rest.get(url, options);
2863 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestLog, true);
2864 resolve(ret);
2865 }
2866 catch (err) {
2867 reject(err);
2868 }
2869 }));
2870 });
2871 }
2872 /**
2873 * Get list of test run attachments reference
2874 *
2875 * @param {string} project - Project ID or project name
2876 * @param {number} runId - Id of the test run
2877 * @param {Contracts.TestLogType} type - type of the attachments to get
2878 * @param {string} directoryPath - directory path for which attachments are needed
2879 * @param {string} fileNamePrefix - file name prefix to filter the list of attachment
2880 * @param {boolean} fetchMetaData - Default is false, set if metadata is needed
2881 * @param {number} top - Number of attachments reference to return
2882 * @param {String} continuationToken - Header to pass the continuationToken
2883 */
2884 getTestRunLogs(customHeaders, project, runId, type, directoryPath, fileNamePrefix, fetchMetaData, top, continuationToken) {
2885 return __awaiter(this, void 0, void 0, function* () {
2886 if (type == null) {
2887 throw new TypeError('type can not be null or undefined');
2888 }
2889 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2890 let routeValues = {
2891 project: project,
2892 runId: runId
2893 };
2894 let queryValues = {
2895 type: type,
2896 directoryPath: directoryPath,
2897 fileNamePrefix: fileNamePrefix,
2898 fetchMetaData: fetchMetaData,
2899 top: top,
2900 };
2901 customHeaders = customHeaders || {};
2902 customHeaders["x-ms-continuationtoken"] = "continuationToken";
2903 try {
2904 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "5b47b946-e875-4c9a-acdc-2a20996caebe", routeValues, queryValues);
2905 let url = verData.requestUrl;
2906 let options = this.createRequestOptions('application/json', verData.apiVersion);
2907 options.additionalHeaders = customHeaders;
2908 let res;
2909 res = yield this.rest.get(url, options);
2910 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestLog, true);
2911 resolve(ret);
2912 }
2913 catch (err) {
2914 reject(err);
2915 }
2916 }));
2917 });
2918 }
2919 /**
2920 * Get SAS Uri of a build attachment
2921 *
2922 * @param {string} project - Project ID or project name
2923 * @param {number} build - Id of the build to get
2924 * @param {Contracts.TestLogType} type - type of the file
2925 * @param {string} filePath - filePath for which sas uri is needed
2926 */
2927 getTestLogStoreEndpointDetailsForBuildLog(project, build, type, filePath) {
2928 return __awaiter(this, void 0, void 0, function* () {
2929 if (build == null) {
2930 throw new TypeError('build can not be null or undefined');
2931 }
2932 if (type == null) {
2933 throw new TypeError('type can not be null or undefined');
2934 }
2935 if (filePath == null) {
2936 throw new TypeError('filePath can not be null or undefined');
2937 }
2938 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2939 let routeValues = {
2940 project: project
2941 };
2942 let queryValues = {
2943 build: build,
2944 type: type,
2945 filePath: filePath,
2946 };
2947 try {
2948 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "39b09be7-f0c9-4a83-a513-9ae31b45c56f", routeValues, queryValues);
2949 let url = verData.requestUrl;
2950 let options = this.createRequestOptions('application/json', verData.apiVersion);
2951 let res;
2952 res = yield this.rest.get(url, options);
2953 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestLogStoreEndpointDetails, false);
2954 resolve(ret);
2955 }
2956 catch (err) {
2957 reject(err);
2958 }
2959 }));
2960 });
2961 }
2962 /**
2963 * Create and Get sas uri of the build container
2964 *
2965 * @param {string} project - Project ID or project name
2966 * @param {number} buildId - Id of the build to get
2967 * @param {Contracts.TestLogStoreOperationType} testLogStoreOperationType - Type of operation to perform using sas uri
2968 */
2969 testLogStoreEndpointDetailsForBuild(project, buildId, testLogStoreOperationType) {
2970 return __awaiter(this, void 0, void 0, function* () {
2971 if (buildId == null) {
2972 throw new TypeError('buildId can not be null or undefined');
2973 }
2974 if (testLogStoreOperationType == null) {
2975 throw new TypeError('testLogStoreOperationType can not be null or undefined');
2976 }
2977 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2978 let routeValues = {
2979 project: project
2980 };
2981 let queryValues = {
2982 buildId: buildId,
2983 testLogStoreOperationType: testLogStoreOperationType,
2984 };
2985 try {
2986 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "39b09be7-f0c9-4a83-a513-9ae31b45c56f", routeValues, queryValues);
2987 let url = verData.requestUrl;
2988 let options = this.createRequestOptions('application/json', verData.apiVersion);
2989 let res;
2990 res = yield this.rest.create(url, null, options);
2991 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestLogStoreEndpointDetails, false);
2992 resolve(ret);
2993 }
2994 catch (err) {
2995 reject(err);
2996 }
2997 }));
2998 });
2999 }
3000 /**
3001 * Get SAS Uri of a test results attachment
3002 *
3003 * @param {string} project - Project ID or project name
3004 * @param {number} runId - Id of the test run that contains result
3005 * @param {number} resultId - Id of the test result whose files need to be downloaded
3006 * @param {Contracts.TestLogType} type - type of the file
3007 * @param {string} filePath - filePath for which sas uri is needed
3008 */
3009 getTestLogStoreEndpointDetailsForResultLog(project, runId, resultId, type, filePath) {
3010 return __awaiter(this, void 0, void 0, function* () {
3011 if (type == null) {
3012 throw new TypeError('type can not be null or undefined');
3013 }
3014 if (filePath == null) {
3015 throw new TypeError('filePath can not be null or undefined');
3016 }
3017 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
3018 let routeValues = {
3019 project: project,
3020 runId: runId,
3021 resultId: resultId
3022 };
3023 let queryValues = {
3024 type: type,
3025 filePath: filePath,
3026 };
3027 try {
3028 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "da630b37-1236-45b5-945e-1d7bdb673850", routeValues, queryValues);
3029 let url = verData.requestUrl;
3030 let options = this.createRequestOptions('application/json', verData.apiVersion);
3031 let res;
3032 res = yield this.rest.get(url, options);
3033 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestLogStoreEndpointDetails, false);
3034 resolve(ret);
3035 }
3036 catch (err) {
3037 reject(err);
3038 }
3039 }));
3040 });
3041 }
3042 /**
3043 * Get SAS Uri of a test subresults attachment
3044 *
3045 * @param {string} project - Project ID or project name
3046 * @param {number} runId - Id of the test run that contains result
3047 * @param {number} resultId - Id of the test result that contains subresult
3048 * @param {number} subResultId - Id of the test subresult whose file sas uri is needed
3049 * @param {Contracts.TestLogType} type - type of the file
3050 * @param {string} filePath - filePath for which sas uri is needed
3051 */
3052 getTestLogStoreEndpointDetailsForSubResultLog(project, runId, resultId, subResultId, type, filePath) {
3053 return __awaiter(this, void 0, void 0, function* () {
3054 if (subResultId == null) {
3055 throw new TypeError('subResultId can not be null or undefined');
3056 }
3057 if (type == null) {
3058 throw new TypeError('type can not be null or undefined');
3059 }
3060 if (filePath == null) {
3061 throw new TypeError('filePath can not be null or undefined');
3062 }
3063 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
3064 let routeValues = {
3065 project: project,
3066 runId: runId,
3067 resultId: resultId
3068 };
3069 let queryValues = {
3070 subResultId: subResultId,
3071 type: type,
3072 filePath: filePath,
3073 };
3074 try {
3075 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "da630b37-1236-45b5-945e-1d7bdb673850", routeValues, queryValues);
3076 let url = verData.requestUrl;
3077 let options = this.createRequestOptions('application/json', verData.apiVersion);
3078 let res;
3079 res = yield this.rest.get(url, options);
3080 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestLogStoreEndpointDetails, false);
3081 resolve(ret);
3082 }
3083 catch (err) {
3084 reject(err);
3085 }
3086 }));
3087 });
3088 }
3089 /**
3090 * Create empty file for a result and Get Sas uri for the file
3091 *
3092 * @param {string} project - Project ID or project name
3093 * @param {number} runId - Id of the test run that contains the result
3094 * @param {number} resultId - Id of the test results that contains sub result
3095 * @param {number} subResultId - Id of the test sub result whose file sas uri is needed
3096 * @param {string} filePath - file path inside the sub result for which sas uri is needed
3097 * @param {Contracts.TestLogType} type - Type of the file for download
3098 */
3099 testLogStoreEndpointDetailsForResult(project, runId, resultId, subResultId, filePath, type) {
3100 return __awaiter(this, void 0, void 0, function* () {
3101 if (subResultId == null) {
3102 throw new TypeError('subResultId can not be null or undefined');
3103 }
3104 if (filePath == null) {
3105 throw new TypeError('filePath can not be null or undefined');
3106 }
3107 if (type == null) {
3108 throw new TypeError('type can not be null or undefined');
3109 }
3110 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
3111 let routeValues = {
3112 project: project,
3113 runId: runId,
3114 resultId: resultId
3115 };
3116 let queryValues = {
3117 subResultId: subResultId,
3118 filePath: filePath,
3119 type: type,
3120 };
3121 try {
3122 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "da630b37-1236-45b5-945e-1d7bdb673850", routeValues, queryValues);
3123 let url = verData.requestUrl;
3124 let options = this.createRequestOptions('application/json', verData.apiVersion);
3125 let res;
3126 res = yield this.rest.create(url, null, options);
3127 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestLogStoreEndpointDetails, false);
3128 resolve(ret);
3129 }
3130 catch (err) {
3131 reject(err);
3132 }
3133 }));
3134 });
3135 }
3136 /**
3137 * Get SAS Uri of a test run attachment
3138 *
3139 * @param {string} project - Project ID or project name
3140 * @param {number} runId - Id of the test run whose file has to be downloaded
3141 * @param {Contracts.TestLogType} type - type of the file
3142 * @param {string} filePath - filePath for which sas uri is needed
3143 */
3144 getTestLogStoreEndpointDetailsForRunLog(project, runId, type, filePath) {
3145 return __awaiter(this, void 0, void 0, function* () {
3146 if (type == null) {
3147 throw new TypeError('type can not be null or undefined');
3148 }
3149 if (filePath == null) {
3150 throw new TypeError('filePath can not be null or undefined');
3151 }
3152 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
3153 let routeValues = {
3154 project: project,
3155 runId: runId
3156 };
3157 let queryValues = {
3158 type: type,
3159 filePath: filePath,
3160 };
3161 try {
3162 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "67eb3f92-6c97-4fd9-8b63-6cbdc7e526ea", routeValues, queryValues);
3163 let url = verData.requestUrl;
3164 let options = this.createRequestOptions('application/json', verData.apiVersion);
3165 let res;
3166 res = yield this.rest.get(url, options);
3167 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestLogStoreEndpointDetails, false);
3168 resolve(ret);
3169 }
3170 catch (err) {
3171 reject(err);
3172 }
3173 }));
3174 });
3175 }
3176 /**
3177 * Create empty file for a run and Get Sas uri for the file
3178 *
3179 * @param {string} project - Project ID or project name
3180 * @param {number} runId - Id of the run to get endpoint details
3181 * @param {Contracts.TestLogStoreOperationType} testLogStoreOperationType - Type of operation to perform using sas uri
3182 * @param {string} filePath - file path to create an empty file
3183 * @param {Contracts.TestLogType} type - Default is GeneralAttachment, type of empty file to be created
3184 */
3185 testLogStoreEndpointDetailsForRun(project, runId, testLogStoreOperationType, filePath, type) {
3186 return __awaiter(this, void 0, void 0, function* () {
3187 if (testLogStoreOperationType == null) {
3188 throw new TypeError('testLogStoreOperationType can not be null or undefined');
3189 }
3190 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
3191 let routeValues = {
3192 project: project,
3193 runId: runId
3194 };
3195 let queryValues = {
3196 testLogStoreOperationType: testLogStoreOperationType,
3197 filePath: filePath,
3198 type: type,
3199 };
3200 try {
3201 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "67eb3f92-6c97-4fd9-8b63-6cbdc7e526ea", routeValues, queryValues);
3202 let url = verData.requestUrl;
3203 let options = this.createRequestOptions('application/json', verData.apiVersion);
3204 let res;
3205 res = yield this.rest.create(url, null, options);
3206 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestLogStoreEndpointDetails, false);
3207 resolve(ret);
3208 }
3209 catch (err) {
3210 reject(err);
3211 }
3212 }));
3213 });
3214 }
3215 /**
3216 * Retrieves Test runs associated to a session
3217 *
3218 * @param {string} project - Project ID or project name
3219 * @param {number} sessionId - Id of TestResults session to obtain Test Runs for.
3220 */
3221 getTestRunsBySessionId(project, sessionId) {
3222 return __awaiter(this, void 0, void 0, function* () {
3223 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
3224 let routeValues = {
3225 project: project,
3226 sessionId: sessionId
3227 };
3228 try {
3229 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "6efc2c12-d4bf-4e86-ae37-b502e57a84c7", routeValues);
3230 let url = verData.requestUrl;
3231 let options = this.createRequestOptions('application/json', verData.apiVersion);
3232 let res;
3233 res = yield this.rest.get(url, options);
3234 let ret = this.formatResponse(res.result, null, true);
3235 resolve(ret);
3236 }
3237 catch (err) {
3238 reject(err);
3239 }
3240 }));
3241 });
3242 }
3243 /**
3244 * Creates TestResultsSession object in TCM data store
3245 *
3246 * @param {Contracts.TestResultsSession} session - Received session object.
3247 * @param {string} project - Project ID or project name
3248 */
3249 createTestSession(session, project) {
3250 return __awaiter(this, void 0, void 0, function* () {
3251 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
3252 let routeValues = {
3253 project: project
3254 };
3255 try {
3256 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "531e61ce-580d-4962-8591-0b2942b6bf78", routeValues);
3257 let url = verData.requestUrl;
3258 let options = this.createRequestOptions('application/json', verData.apiVersion);
3259 let res;
3260 res = yield this.rest.create(url, session, options);
3261 let ret = this.formatResponse(res.result, null, false);
3262 resolve(ret);
3263 }
3264 catch (err) {
3265 reject(err);
3266 }
3267 }));
3268 });
3269 }
3270 /**
3271 * Retrieves TestResultsSession metadata object in TCM data store
3272 *
3273 * @param {string} project - Project ID or project name
3274 * @param {number} buildId
3275 */
3276 getTestSession(project, buildId) {
3277 return __awaiter(this, void 0, void 0, function* () {
3278 if (buildId == null) {
3279 throw new TypeError('buildId can not be null or undefined');
3280 }
3281 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
3282 let routeValues = {
3283 project: project
3284 };
3285 let queryValues = {
3286 buildId: buildId,
3287 };
3288 try {
3289 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "531e61ce-580d-4962-8591-0b2942b6bf78", routeValues, queryValues);
3290 let url = verData.requestUrl;
3291 let options = this.createRequestOptions('application/json', verData.apiVersion);
3292 let res;
3293 res = yield this.rest.get(url, options);
3294 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestResultsSession, true);
3295 resolve(ret);
3296 }
3297 catch (err) {
3298 reject(err);
3299 }
3300 }));
3301 });
3302 }
3303 /**
3304 * Retrieves TestResultsSession Layout object in TCM data store
3305 *
3306 * @param {string} project - Project ID or project name
3307 * @param {string} sessionId
3308 */
3309 getTestSessionLayout(project, sessionId) {
3310 return __awaiter(this, void 0, void 0, function* () {
3311 if (sessionId == null) {
3312 throw new TypeError('sessionId can not be null or undefined');
3313 }
3314 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
3315 let routeValues = {
3316 project: project
3317 };
3318 let queryValues = {
3319 sessionId: sessionId,
3320 };
3321 try {
3322 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "531e61ce-580d-4962-8591-0b2942b6bf78", routeValues, queryValues);
3323 let url = verData.requestUrl;
3324 let options = this.createRequestOptions('application/json', verData.apiVersion);
3325 let res;
3326 res = yield this.rest.get(url, options);
3327 let ret = this.formatResponse(res.result, null, true);
3328 resolve(ret);
3329 }
3330 catch (err) {
3331 reject(err);
3332 }
3333 }));
3334 });
3335 }
3336 /**
3337 * Creates Environment object in TCM data store
3338 *
3339 * @param {Contracts.TestSessionEnvironment[]} environments - Received Environment object.
3340 * @param {string} project - Project ID or project name
3341 */
3342 createEnvironment(environments, project) {
3343 return __awaiter(this, void 0, void 0, function* () {
3344 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
3345 let routeValues = {
3346 project: project
3347 };
3348 try {
3349 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "f9c2e9e4-9c9a-4c1d-9a7d-2b4c8a6f0d5f", routeValues);
3350 let url = verData.requestUrl;
3351 let options = this.createRequestOptions('application/json', verData.apiVersion);
3352 let res;
3353 res = yield this.rest.create(url, environments, options);
3354 let ret = this.formatResponse(res.result, null, false);
3355 resolve(ret);
3356 }
3357 catch (err) {
3358 reject(err);
3359 }
3360 }));
3361 });
3362 }
3363 /**
3364 * Creates Notification object in TCM data store for a given session
3365 *
3366 * @param {Contracts.TestSessionNotification[]} notifications - Notification(s) to add for the specified sessionId
3367 * @param {string} project - Project ID or project name
3368 * @param {number} sessionId - ID of Session to add Notification
3369 */
3370 createNotification(notifications, project, sessionId) {
3371 return __awaiter(this, void 0, void 0, function* () {
3372 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
3373 let routeValues = {
3374 project: project,
3375 sessionId: sessionId
3376 };
3377 try {
3378 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "ebff1c56-2188-4082-9d0e-1838a396f0c8", routeValues);
3379 let url = verData.requestUrl;
3380 let options = this.createRequestOptions('application/json', verData.apiVersion);
3381 let res;
3382 res = yield this.rest.create(url, notifications, options);
3383 let ret = this.formatResponse(res.result, null, true);
3384 resolve(ret);
3385 }
3386 catch (err) {
3387 reject(err);
3388 }
3389 }));
3390 });
3391 }
3392 /**
3393 * Retrieves TestResultsSession Notification objects in TCM data store
3394 *
3395 * @param {string} project - Project ID or project name
3396 * @param {number} sessionId - Id of TestResults session to obtain Notifications for.
3397 */
3398 getSessionNotifications(project, sessionId) {
3399 return __awaiter(this, void 0, void 0, function* () {
3400 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
3401 let routeValues = {
3402 project: project,
3403 sessionId: sessionId
3404 };
3405 try {
3406 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "ebff1c56-2188-4082-9d0e-1838a396f0c8", routeValues);
3407 let url = verData.requestUrl;
3408 let options = this.createRequestOptions('application/json', verData.apiVersion);
3409 let res;
3410 res = yield this.rest.get(url, options);
3411 let ret = this.formatResponse(res.result, null, true);
3412 resolve(ret);
3413 }
3414 catch (err) {
3415 reject(err);
3416 }
3417 }));
3418 });
3419 }
3420 /**
3421 * Add Test Results to test run session
3422 *
3423 * @param {Contracts.TestCaseResult[]} results
3424 * @param {string} project - Project ID or project name
3425 * @param {number} runId - RunId of test run
3426 */
3427 addTestResultsToTestRunSession(results, project, runId) {
3428 return __awaiter(this, void 0, void 0, function* () {
3429 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
3430 let routeValues = {
3431 project: project,
3432 runId: runId
3433 };
3434 try {
3435 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "ee6d95bf-7506-4c47-8100-9fed82cdc2f7", routeValues);
3436 let url = verData.requestUrl;
3437 let options = this.createRequestOptions('application/json', verData.apiVersion);
3438 let res;
3439 res = yield this.rest.create(url, results, options);
3440 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestCaseResult, true);
3441 resolve(ret);
3442 }
3443 catch (err) {
3444 reject(err);
3445 }
3446 }));
3447 });
3448 }
3449 /**
3450 * @param {string} project - Project ID or project name
3451 * @param {number} runId
3452 * @param {Contracts.ResultDetails} detailsToInclude
3453 * @param {number} skip
3454 * @param {number} top
3455 * @param {Contracts.TestOutcome[]} outcomes
3456 * @param {boolean} newTestsOnly
3457 */
3458 getTestSessionResults(project, runId, detailsToInclude, skip, top, outcomes, newTestsOnly) {
3459 return __awaiter(this, void 0, void 0, function* () {
3460 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
3461 let routeValues = {
3462 project: project,
3463 runId: runId
3464 };
3465 let queryValues = {
3466 detailsToInclude: detailsToInclude,
3467 '$skip': skip,
3468 '$top': top,
3469 outcomes: outcomes && outcomes.join(","),
3470 '$newTestsOnly': newTestsOnly,
3471 };
3472 try {
3473 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "ee6d95bf-7506-4c47-8100-9fed82cdc2f7", routeValues, queryValues);
3474 let url = verData.requestUrl;
3475 let options = this.createRequestOptions('application/json', verData.apiVersion);
3476 let res;
3477 res = yield this.rest.get(url, options);
3478 let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestCaseResult, true);
3479 resolve(ret);
3480 }
3481 catch (err) {
3482 reject(err);
3483 }
3484 }));
3485 });
3486 }
3487 /**
3488 * Creates TestResultsMRX objects in TCM data store for existing test results
3489 *
3490 * @param {Contracts.TestCaseResult[]} results - Results object with only test results MRX properties and existing testResultId
3491 * @param {string} project - Project ID or project name
3492 * @param {number} runId - RunId of test run
3493 */
3494 updateTestResultsToTestRunSession(results, project, runId) {
3495 return __awaiter(this, void 0, void 0, function* () {
3496 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
3497 let routeValues = {
3498 project: project,
3499 runId: runId
3500 };
3501 try {
3502 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "ee6d95bf-7506-4c47-8100-9fed82cdc2f7", routeValues);
3503 let url = verData.requestUrl;
3504 let options = this.createRequestOptions('application/json', verData.apiVersion);
3505 let res;
3506 res = yield this.rest.update(url, results, options);
3507 let ret = this.formatResponse(res.result, null, true);
3508 resolve(ret);
3509 }
3510 catch (err) {
3511 reject(err);
3512 }
3513 }));
3514 });
3515 }
3516 /**
3517 * @param {Contracts.TestSettings} testSettings
3518 * @param {string} project - Project ID or project name
3519 */
3520 createTestSettings(testSettings, project) {
3521 return __awaiter(this, void 0, void 0, function* () {
3522 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
3523 let routeValues = {
3524 project: project
3525 };
3526 try {
3527 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "930bad47-f826-4099-9597-f44d0a9c735c", routeValues);
3528 let url = verData.requestUrl;
3529 let options = this.createRequestOptions('application/json', verData.apiVersion);
3530 let res;
3531 res = yield this.rest.create(url, testSettings, options);
3532 let ret = this.formatResponse(res.result, null, false);
3533 resolve(ret);
3534 }
3535 catch (err) {
3536 reject(err);
3537 }
3538 }));
3539 });
3540 }
3541 /**
3542 * @param {string} project - Project ID or project name
3543 * @param {number} testSettingsId
3544 */
3545 deleteTestSettings(project, testSettingsId) {
3546 return __awaiter(this, void 0, void 0, function* () {
3547 if (testSettingsId == null) {
3548 throw new TypeError('testSettingsId can not be null or undefined');
3549 }
3550 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
3551 let routeValues = {
3552 project: project
3553 };
3554 let queryValues = {
3555 testSettingsId: testSettingsId,
3556 };
3557 try {
3558 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "930bad47-f826-4099-9597-f44d0a9c735c", routeValues, queryValues);
3559 let url = verData.requestUrl;
3560 let options = this.createRequestOptions('application/json', verData.apiVersion);
3561 let res;
3562 res = yield this.rest.del(url, options);
3563 let ret = this.formatResponse(res.result, null, false);
3564 resolve(ret);
3565 }
3566 catch (err) {
3567 reject(err);
3568 }
3569 }));
3570 });
3571 }
3572 /**
3573 * @param {string} project - Project ID or project name
3574 * @param {number} testSettingsId
3575 */
3576 getTestSettingsById(project, testSettingsId) {
3577 return __awaiter(this, void 0, void 0, function* () {
3578 if (testSettingsId == null) {
3579 throw new TypeError('testSettingsId can not be null or undefined');
3580 }
3581 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
3582 let routeValues = {
3583 project: project
3584 };
3585 let queryValues = {
3586 testSettingsId: testSettingsId,
3587 };
3588 try {
3589 let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "930bad47-f826-4099-9597-f44d0a9c735c", routeValues, queryValues);
3590 let url = verData.requestUrl;
3591 let options = this.createRequestOptions('application/json', verData.apiVersion);
3592 let res;
3593 res = yield this.rest.get(url, options);
3594 let ret = this.formatResponse(res.result, null, false);
3595 resolve(ret);
3596 }
3597 catch (err) {
3598 reject(err);
3599 }
3600 }));
3601 });
3602 }
3603 /**
3604 * @param {Contracts.WorkItemToTestLinks} workItemToTestLinks
3605 * @param {string} project - Project ID or project name
3606 */
3607 addWorkItemToTestLinks(workItemToTestLinks, project) {
3608 return __awaiter(this, void 0, void 0, function* () {
3609 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
3610 let routeValues = {
3611 project: project
3612 };
3613 try {
3614 let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "4e3abe63-ca46-4fe0-98b2-363f7ec7aa5f", routeValues);
3615 let url = verData.requestUrl;
3616 let options = this.createRequestOptions('application/json', verData.apiVersion);
3617 let res;
3618 res = yield this.rest.create(url, workItemToTestLinks, options);
3619 let ret = this.formatResponse(res.result, Contracts.TypeInfo.WorkItemToTestLinks, false);
3620 resolve(ret);
3621 }
3622 catch (err) {
3623 reject(err);
3624 }
3625 }));
3626 });
3627 }
3628 /**
3629 * @param {string} project - Project ID or project name
3630 * @param {string} testName
3631 * @param {number} workItemId
3632 */
3633 deleteTestMethodToWorkItemLink(project, testName, workItemId) {
3634 return __awaiter(this, void 0, void 0, function* () {
3635 if (testName == null) {
3636 throw new TypeError('testName can not be null or undefined');
3637 }
3638 if (workItemId == null) {
3639 throw new TypeError('workItemId can not be null or undefined');
3640 }
3641 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
3642 let routeValues = {
3643 project: project
3644 };
3645 let queryValues = {
3646 testName: testName,
3647 workItemId: workItemId,
3648 };
3649 try {
3650 let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "cbd50bd7-f7ed-4e35-b127-4408ae6bfa2c", routeValues, queryValues);
3651 let url = verData.requestUrl;
3652 let options = this.createRequestOptions('application/json', verData.apiVersion);
3653 let res;
3654 res = yield this.rest.del(url, options);
3655 let ret = this.formatResponse(res.result, null, false);
3656 resolve(ret);
3657 }
3658 catch (err) {
3659 reject(err);
3660 }
3661 }));
3662 });
3663 }
3664 /**
3665 * @param {string} project - Project ID or project name
3666 * @param {string} testName
3667 */
3668 queryTestMethodLinkedWorkItems(project, testName) {
3669 return __awaiter(this, void 0, void 0, function* () {
3670 if (testName == null) {
3671 throw new TypeError('testName can not be null or undefined');
3672 }
3673 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
3674 let routeValues = {
3675 project: project
3676 };
3677 let queryValues = {
3678 testName: testName,
3679 };
3680 try {
3681 let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "cbd50bd7-f7ed-4e35-b127-4408ae6bfa2c", routeValues, queryValues);
3682 let url = verData.requestUrl;
3683 let options = this.createRequestOptions('application/json', verData.apiVersion);
3684 let res;
3685 res = yield this.rest.create(url, null, options);
3686 let ret = this.formatResponse(res.result, null, false);
3687 resolve(ret);
3688 }
3689 catch (err) {
3690 reject(err);
3691 }
3692 }));
3693 });
3694 }
3695 /**
3696 * @param {string} project - Project ID or project name
3697 * @param {number} runId
3698 * @param {number} testCaseResultId
3699 */
3700 getTestResultWorkItemsById(project, runId, testCaseResultId) {
3701 return __awaiter(this, void 0, void 0, function* () {
3702 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
3703 let routeValues = {
3704 project: project,
3705 runId: runId,
3706 testCaseResultId: testCaseResultId
3707 };
3708 try {
3709 let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "3d032fd6-e7a0-468b-b105-75d206f99aad", routeValues);
3710 let url = verData.requestUrl;
3711 let options = this.createRequestOptions('application/json', verData.apiVersion);
3712 let res;
3713 res = yield this.rest.get(url, options);
3714 let ret = this.formatResponse(res.result, null, true);
3715 resolve(ret);
3716 }
3717 catch (err) {
3718 reject(err);
3719 }
3720 }));
3721 });
3722 }
3723 /**
3724 * Query Test Result WorkItems based on filter
3725 *
3726 * @param {string} project - Project ID or project name
3727 * @param {string} workItemCategory - can take values Microsoft.BugCategory or all(for getting all workitems)
3728 * @param {string} automatedTestName
3729 * @param {number} testCaseId
3730 * @param {Date} maxCompleteDate
3731 * @param {number} days
3732 * @param {number} workItemCount
3733 */
3734 queryTestResultWorkItems(project, workItemCategory, automatedTestName, testCaseId, maxCompleteDate, days, workItemCount) {
3735 return __awaiter(this, void 0, void 0, function* () {
3736 if (workItemCategory == null) {
3737 throw new TypeError('workItemCategory can not be null or undefined');
3738 }
3739 return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
3740 let routeValues = {
3741 project: project
3742 };
3743 let queryValues = {
3744 workItemCategory: workItemCategory,
3745 automatedTestName: automatedTestName,
3746 testCaseId: testCaseId,
3747 maxCompleteDate: maxCompleteDate,
3748 days: days,
3749 '$workItemCount': workItemCount,
3750 };
3751 try {
3752 let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "f7401a26-331b-44fe-a470-f7ed35138e4a", routeValues, queryValues);
3753 let url = verData.requestUrl;
3754 let options = this.createRequestOptions('application/json', verData.apiVersion);
3755 let res;
3756 res = yield this.rest.get(url, options);
3757 let ret = this.formatResponse(res.result, null, true);
3758 resolve(ret);
3759 }
3760 catch (err) {
3761 reject(err);
3762 }
3763 }));
3764 });
3765 }
3766}
3767exports.TestResultsApi = TestResultsApi;
3768TestResultsApi.RESOURCE_AREA_ID = "c83eaf52-edf3-4034-ae11-17d38f25404c";