azure-devops-node-api
Version:
Node client for Azure DevOps and TFS REST APIs
1,043 lines (1,042 loc) • 120 kB
JavaScript
"use strict";
/*
* ---------------------------------------------------------
* Copyright(C) Microsoft Corporation. All rights reserved.
* ---------------------------------------------------------
*
* ---------------------------------------------------------
* Generated file, DO NOT EDIT
* ---------------------------------------------------------
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TestApi = void 0;
const basem = require("./ClientApiBases");
const TestInterfaces = require("./interfaces/TestInterfaces");
class TestApi extends basem.ClientApiBase {
constructor(baseUrl, handlers, options) {
super(baseUrl, handlers, 'node-Test-api', options);
}
/**
* Attach a file to test step result
*
* @param {TestInterfaces.TestAttachmentRequestModel} attachmentRequestModel - Attachment details TestAttachmentRequestModel
* @param {string} project - Project ID or project name
* @param {number} runId - ID of the test run that contains the result.
* @param {number} testCaseResultId - ID of the test result that contains the iteration
* @param {number} iterationId - ID of the test result iteration.
* @param {string} actionPath - Hex value of test result action path.
*/
createTestIterationResultAttachment(attachmentRequestModel, project, runId, testCaseResultId, iterationId, actionPath) {
return __awaiter(this, void 0, void 0, function* () {
if (iterationId == null) {
throw new TypeError('iterationId can not be null or undefined');
}
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project,
runId: runId,
testCaseResultId: testCaseResultId
};
let queryValues = {
iterationId: iterationId,
actionPath: actionPath,
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", routeValues, queryValues);
let url = verData.requestUrl;
let options = this.createRequestOptions('application/json', verData.apiVersion);
let res;
res = yield this.rest.create(url, attachmentRequestModel, options);
let ret = this.formatResponse(res.result, null, false);
resolve(ret);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* Attach a file to a test result.
*
* @param {TestInterfaces.TestAttachmentRequestModel} attachmentRequestModel - Attachment details TestAttachmentRequestModel
* @param {string} project - Project ID or project name
* @param {number} runId - ID of the test run that contains the result.
* @param {number} testCaseResultId - ID of the test result against which attachment has to be uploaded.
*/
createTestResultAttachment(attachmentRequestModel, project, runId, testCaseResultId) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project,
runId: runId,
testCaseResultId: testCaseResultId
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", routeValues);
let url = verData.requestUrl;
let options = this.createRequestOptions('application/json', verData.apiVersion);
let res;
res = yield this.rest.create(url, attachmentRequestModel, options);
let ret = this.formatResponse(res.result, null, false);
resolve(ret);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* Attach a file to a test result
*
* @param {TestInterfaces.TestAttachmentRequestModel} attachmentRequestModel - Attachment Request Model.
* @param {string} project - Project ID or project name
* @param {number} runId - ID of the test run that contains the result.
* @param {number} testCaseResultId - ID of the test results that contains sub result.
* @param {number} testSubResultId - ID of the test sub results against which attachment has to be uploaded.
*/
createTestSubResultAttachment(attachmentRequestModel, project, runId, testCaseResultId, testSubResultId) {
return __awaiter(this, void 0, void 0, function* () {
if (testSubResultId == null) {
throw new TypeError('testSubResultId can not be null or undefined');
}
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project,
runId: runId,
testCaseResultId: testCaseResultId
};
let queryValues = {
testSubResultId: testSubResultId,
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", routeValues, queryValues);
let url = verData.requestUrl;
let options = this.createRequestOptions('application/json', verData.apiVersion);
let res;
res = yield this.rest.create(url, attachmentRequestModel, options);
let ret = this.formatResponse(res.result, null, false);
resolve(ret);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* Download a test result attachment by its ID.
*
* @param {string} project - Project ID or project name
* @param {number} runId - ID of the test run that contains the testCaseResultId.
* @param {number} testCaseResultId - ID of the test result whose attachment has to be downloaded.
* @param {number} attachmentId - ID of the test result attachment to be downloaded.
*/
getTestResultAttachmentContent(project, runId, testCaseResultId, attachmentId) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project,
runId: runId,
testCaseResultId: testCaseResultId,
attachmentId: attachmentId
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", routeValues);
let url = verData.requestUrl;
let apiVersion = verData.apiVersion;
let accept = this.createAcceptHeader("application/octet-stream", apiVersion);
resolve((yield this.http.get(url, { "Accept": accept })).message);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* Get list of test result attachments reference.
*
* @param {string} project - Project ID or project name
* @param {number} runId - ID of the test run that contains the result.
* @param {number} testCaseResultId - ID of the test result.
*/
getTestResultAttachments(project, runId, testCaseResultId) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project,
runId: runId,
testCaseResultId: testCaseResultId
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", routeValues);
let url = verData.requestUrl;
let options = this.createRequestOptions('application/json', verData.apiVersion);
let res;
res = yield this.rest.get(url, options);
let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestAttachment, true);
resolve(ret);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* Download a test result attachment by its ID.
*
* @param {string} project - Project ID or project name
* @param {number} runId - ID of the test run that contains the testCaseResultId.
* @param {number} testCaseResultId - ID of the test result whose attachment has to be downloaded.
* @param {number} attachmentId - ID of the test result attachment to be downloaded.
*/
getTestResultAttachmentZip(project, runId, testCaseResultId, attachmentId) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project,
runId: runId,
testCaseResultId: testCaseResultId,
attachmentId: attachmentId
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", routeValues);
let url = verData.requestUrl;
let apiVersion = verData.apiVersion;
let accept = this.createAcceptHeader("application/zip", apiVersion);
resolve((yield this.http.get(url, { "Accept": accept })).message);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* Download a test sub result attachment
*
* @param {string} project - Project ID or project name
* @param {number} runId - ID of the test run that contains the result.
* @param {number} testCaseResultId - ID of the test results that contains sub result.
* @param {number} attachmentId - ID of the test result attachment to be downloaded
* @param {number} testSubResultId - ID of the test sub result whose attachment has to be downloaded
*/
getTestSubResultAttachmentContent(project, runId, testCaseResultId, attachmentId, testSubResultId) {
return __awaiter(this, void 0, void 0, function* () {
if (testSubResultId == null) {
throw new TypeError('testSubResultId can not be null or undefined');
}
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project,
runId: runId,
testCaseResultId: testCaseResultId,
attachmentId: attachmentId
};
let queryValues = {
testSubResultId: testSubResultId,
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", routeValues, queryValues);
let url = verData.requestUrl;
let apiVersion = verData.apiVersion;
let accept = this.createAcceptHeader("application/octet-stream", apiVersion);
resolve((yield this.http.get(url, { "Accept": accept })).message);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* Get list of test sub result attachments
*
* @param {string} project - Project ID or project name
* @param {number} runId - ID of the test run that contains the result.
* @param {number} testCaseResultId - ID of the test results that contains sub result.
* @param {number} testSubResultId - ID of the test sub result whose attachment has to be downloaded
*/
getTestSubResultAttachments(project, runId, testCaseResultId, testSubResultId) {
return __awaiter(this, void 0, void 0, function* () {
if (testSubResultId == null) {
throw new TypeError('testSubResultId can not be null or undefined');
}
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project,
runId: runId,
testCaseResultId: testCaseResultId
};
let queryValues = {
testSubResultId: testSubResultId,
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", routeValues, queryValues);
let url = verData.requestUrl;
let options = this.createRequestOptions('application/json', verData.apiVersion);
let res;
res = yield this.rest.get(url, options);
let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestAttachment, true);
resolve(ret);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* Download a test sub result attachment
*
* @param {string} project - Project ID or project name
* @param {number} runId - ID of the test run that contains the result.
* @param {number} testCaseResultId - ID of the test results that contains sub result.
* @param {number} attachmentId - ID of the test result attachment to be downloaded
* @param {number} testSubResultId - ID of the test sub result whose attachment has to be downloaded
*/
getTestSubResultAttachmentZip(project, runId, testCaseResultId, attachmentId, testSubResultId) {
return __awaiter(this, void 0, void 0, function* () {
if (testSubResultId == null) {
throw new TypeError('testSubResultId can not be null or undefined');
}
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project,
runId: runId,
testCaseResultId: testCaseResultId,
attachmentId: attachmentId
};
let queryValues = {
testSubResultId: testSubResultId,
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", routeValues, queryValues);
let url = verData.requestUrl;
let apiVersion = verData.apiVersion;
let accept = this.createAcceptHeader("application/zip", apiVersion);
resolve((yield this.http.get(url, { "Accept": accept })).message);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* Attach a file to a test run.
*
* @param {TestInterfaces.TestAttachmentRequestModel} attachmentRequestModel - Attachment details TestAttachmentRequestModel
* @param {string} project - Project ID or project name
* @param {number} runId - ID of the test run against which attachment has to be uploaded.
*/
createTestRunAttachment(attachmentRequestModel, project, runId) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project,
runId: runId
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "4f004af4-a507-489c-9b13-cb62060beb11", routeValues);
let url = verData.requestUrl;
let options = this.createRequestOptions('application/json', verData.apiVersion);
let res;
res = yield this.rest.create(url, attachmentRequestModel, options);
let ret = this.formatResponse(res.result, null, false);
resolve(ret);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* Download a test run attachment by its ID.
*
* @param {string} project - Project ID or project name
* @param {number} runId - ID of the test run whose attachment has to be downloaded.
* @param {number} attachmentId - ID of the test run attachment to be downloaded.
*/
getTestRunAttachmentContent(project, runId, attachmentId) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project,
runId: runId,
attachmentId: attachmentId
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "4f004af4-a507-489c-9b13-cb62060beb11", routeValues);
let url = verData.requestUrl;
let apiVersion = verData.apiVersion;
let accept = this.createAcceptHeader("application/octet-stream", apiVersion);
resolve((yield this.http.get(url, { "Accept": accept })).message);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* Get list of test run attachments reference.
*
* @param {string} project - Project ID or project name
* @param {number} runId - ID of the test run.
*/
getTestRunAttachments(project, runId) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project,
runId: runId
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "4f004af4-a507-489c-9b13-cb62060beb11", routeValues);
let url = verData.requestUrl;
let options = this.createRequestOptions('application/json', verData.apiVersion);
let res;
res = yield this.rest.get(url, options);
let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestAttachment, true);
resolve(ret);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* Download a test run attachment by its ID.
*
* @param {string} project - Project ID or project name
* @param {number} runId - ID of the test run whose attachment has to be downloaded.
* @param {number} attachmentId - ID of the test run attachment to be downloaded.
*/
getTestRunAttachmentZip(project, runId, attachmentId) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project,
runId: runId,
attachmentId: attachmentId
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "4f004af4-a507-489c-9b13-cb62060beb11", routeValues);
let url = verData.requestUrl;
let apiVersion = verData.apiVersion;
let accept = this.createAcceptHeader("application/zip", apiVersion);
resolve((yield this.http.get(url, { "Accept": accept })).message);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* @param {string} project - Project ID or project name
* @param {number} runId
* @param {number} testCaseResultId
*/
getBugsLinkedToTestResult(project, runId, testCaseResultId) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project,
runId: runId,
testCaseResultId: testCaseResultId
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "6de20ca2-67de-4faf-97fa-38c5d585eb00", routeValues);
let url = verData.requestUrl;
let options = this.createRequestOptions('application/json', verData.apiVersion);
let res;
res = yield this.rest.get(url, options);
let ret = this.formatResponse(res.result, null, true);
resolve(ret);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* Get code coverage data for a build.
*
* @param {string} project - Project ID or project name
* @param {number} buildId - ID of the build for which code coverage data needs to be fetched.
* @param {number} flags - Value of flags determine the level of code coverage details to be fetched. Flags are additive. Expected Values are 1 for Modules, 2 for Functions, 4 for BlockData.
*/
getBuildCodeCoverage(project, buildId, flags) {
return __awaiter(this, void 0, void 0, function* () {
if (buildId == null) {
throw new TypeError('buildId can not be null or undefined');
}
if (flags == null) {
throw new TypeError('flags can not be null or undefined');
}
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project
};
let queryValues = {
buildId: buildId,
flags: flags,
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "77560e8a-4e8c-4d59-894e-a5f264c24444", routeValues, queryValues);
let url = verData.requestUrl;
let options = this.createRequestOptions('application/json', verData.apiVersion);
let res;
res = yield this.rest.get(url, options);
let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.BuildCoverage, true);
resolve(ret);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* Get Code Coverage Summary for Build.
*
* @param {string} project - Project ID or project name
* @param {number} buildId - ID of the build for which code coverage data needs to be fetched.
* @param {number} deltaBuildId - Delta Build id (optional)
*/
getCodeCoverageSummary(project, buildId, deltaBuildId) {
return __awaiter(this, void 0, void 0, function* () {
if (buildId == null) {
throw new TypeError('buildId can not be null or undefined');
}
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project
};
let queryValues = {
buildId: buildId,
deltaBuildId: deltaBuildId,
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "77560e8a-4e8c-4d59-894e-a5f264c24444", routeValues, queryValues);
let url = verData.requestUrl;
let options = this.createRequestOptions('application/json', verData.apiVersion);
let res;
res = yield this.rest.get(url, options);
let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.CodeCoverageSummary, false);
resolve(ret);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* http://(tfsserver):8080/tfs/DefaultCollection/_apis/test/CodeCoverage?buildId=10 Request: Json of code coverage summary
*
* @param {TestInterfaces.CodeCoverageData} coverageData
* @param {string} project - Project ID or project name
* @param {number} buildId
*/
updateCodeCoverageSummary(coverageData, project, buildId) {
return __awaiter(this, void 0, void 0, function* () {
if (buildId == null) {
throw new TypeError('buildId can not be null or undefined');
}
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project
};
let queryValues = {
buildId: buildId,
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "77560e8a-4e8c-4d59-894e-a5f264c24444", routeValues, queryValues);
let url = verData.requestUrl;
let options = this.createRequestOptions('application/json', verData.apiVersion);
let res;
res = yield this.rest.create(url, coverageData, options);
let ret = this.formatResponse(res.result, null, false);
resolve(ret);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* Get code coverage data for a test run
*
* @param {string} project - Project ID or project name
* @param {number} runId - ID of the test run for which code coverage data needs to be fetched.
* @param {number} flags - Value of flags determine the level of code coverage details to be fetched. Flags are additive. Expected Values are 1 for Modules, 2 for Functions, 4 for BlockData.
*/
getTestRunCodeCoverage(project, runId, flags) {
return __awaiter(this, void 0, void 0, function* () {
if (flags == null) {
throw new TypeError('flags can not be null or undefined');
}
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project,
runId: runId
};
let queryValues = {
flags: flags,
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "9629116f-3b89-4ed8-b358-d4694efda160", routeValues, queryValues);
let url = verData.requestUrl;
let options = this.createRequestOptions('application/json', verData.apiVersion);
let res;
res = yield this.rest.get(url, options);
let ret = this.formatResponse(res.result, null, true);
resolve(ret);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* @param {TestInterfaces.CustomTestFieldDefinition[]} newFields
* @param {string} project - Project ID or project name
*/
addCustomFields(newFields, project) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "8ce1923b-f4c7-4e22-b93b-f6284e525ec2", routeValues);
let url = verData.requestUrl;
let options = this.createRequestOptions('application/json', verData.apiVersion);
let res;
res = yield this.rest.create(url, newFields, options);
let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.CustomTestFieldDefinition, true);
resolve(ret);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* @param {string} project - Project ID or project name
* @param {TestInterfaces.CustomTestFieldScope} scopeFilter
*/
queryCustomFields(project, scopeFilter) {
return __awaiter(this, void 0, void 0, function* () {
if (scopeFilter == null) {
throw new TypeError('scopeFilter can not be null or undefined');
}
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project
};
let queryValues = {
scopeFilter: scopeFilter,
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "8ce1923b-f4c7-4e22-b93b-f6284e525ec2", routeValues, queryValues);
let url = verData.requestUrl;
let options = this.createRequestOptions('application/json', verData.apiVersion);
let res;
res = yield this.rest.get(url, options);
let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.CustomTestFieldDefinition, true);
resolve(ret);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* @param {TestInterfaces.ResultsFilter} filter
* @param {string} project - Project ID or project name
*/
queryTestResultHistory(filter, project) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "234616f5-429c-4e7b-9192-affd76731dfd", routeValues);
let url = verData.requestUrl;
let options = this.createRequestOptions('application/json', verData.apiVersion);
let res;
res = yield this.rest.create(url, filter, options);
let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestResultHistory, false);
resolve(ret);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* Get iteration for a result
*
* @param {string} project - Project ID or project name
* @param {number} runId - ID of the test run that contains the result.
* @param {number} testCaseResultId - ID of the test result that contains the iterations.
* @param {number} iterationId - Id of the test results Iteration.
* @param {boolean} includeActionResults - Include result details for each action performed in the test iteration. ActionResults refer to outcome (pass/fail) of test steps that are executed as part of a running a manual test. Including the ActionResults flag gets the outcome of test steps in the actionResults section and test parameters in the parameters section for each test iteration.
*/
getTestIteration(project, runId, testCaseResultId, iterationId, includeActionResults) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project,
runId: runId,
testCaseResultId: testCaseResultId,
iterationId: iterationId
};
let queryValues = {
includeActionResults: includeActionResults,
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Test", "73eb9074-3446-4c44-8296-2f811950ff8d", routeValues, queryValues);
let url = verData.requestUrl;
let options = this.createRequestOptions('application/json', verData.apiVersion);
let res;
res = yield this.rest.get(url, options);
let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestIterationDetailsModel, false);
resolve(ret);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* Get iterations for a result
*
* @param {string} project - Project ID or project name
* @param {number} runId - ID of the test run that contains the result.
* @param {number} testCaseResultId - ID of the test result that contains the iterations.
* @param {boolean} includeActionResults - Include result details for each action performed in the test iteration. ActionResults refer to outcome (pass/fail) of test steps that are executed as part of a running a manual test. Including the ActionResults flag gets the outcome of test steps in the actionResults section and test parameters in the parameters section for each test iteration.
*/
getTestIterations(project, runId, testCaseResultId, includeActionResults) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project,
runId: runId,
testCaseResultId: testCaseResultId
};
let queryValues = {
includeActionResults: includeActionResults,
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Test", "73eb9074-3446-4c44-8296-2f811950ff8d", routeValues, queryValues);
let url = verData.requestUrl;
let options = this.createRequestOptions('application/json', verData.apiVersion);
let res;
res = yield this.rest.get(url, options);
let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestIterationDetailsModel, true);
resolve(ret);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* @param {TestInterfaces.LinkedWorkItemsQuery} workItemQuery
* @param {string} project - Project ID or project name
*/
getLinkedWorkItemsByQuery(workItemQuery, project) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "a4dcb25b-9878-49ea-abfd-e440bd9b1dcd", routeValues);
let url = verData.requestUrl;
let options = this.createRequestOptions('application/json', verData.apiVersion);
let res;
res = yield this.rest.create(url, workItemQuery, options);
let ret = this.formatResponse(res.result, null, true);
resolve(ret);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* Get test run message logs
*
* @param {string} project - Project ID or project name
* @param {number} runId - ID of the run to get.
*/
getTestRunLogs(project, runId) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project,
runId: runId
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "a1e55200-637e-42e9-a7c0-7e5bfdedb1b3", routeValues);
let url = verData.requestUrl;
let options = this.createRequestOptions('application/json', verData.apiVersion);
let res;
res = yield this.rest.get(url, options);
let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestMessageLogDetails, true);
resolve(ret);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* Get a test point.
*
* @param {string} project - Project ID or project name
* @param {number} planId - ID of the test plan.
* @param {number} suiteId - ID of the suite that contains the point.
* @param {number} pointIds - ID of the test point to get.
* @param {string} witFields - Comma-separated list of work item field names.
*/
getPoint(project, planId, suiteId, pointIds, witFields) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project,
planId: planId,
suiteId: suiteId,
pointIds: pointIds
};
let queryValues = {
witFields: witFields,
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Test", "3bcfd5c8-be62-488e-b1da-b8289ce9299c", routeValues, queryValues);
let url = verData.requestUrl;
let options = this.createRequestOptions('application/json', verData.apiVersion);
let res;
res = yield this.rest.get(url, options);
let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestPoint, false);
resolve(ret);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* Get a list of test points.
*
* @param {string} project - Project ID or project name
* @param {number} planId - ID of the test plan.
* @param {number} suiteId - ID of the suite that contains the points.
* @param {string} witFields - Comma-separated list of work item field names.
* @param {string} configurationId - Get test points for specific configuration.
* @param {string} testCaseId - Get test points for a specific test case, valid when configurationId is not set.
* @param {string} testPointIds - Get test points for comma-separated list of test point IDs, valid only when configurationId and testCaseId are not set.
* @param {boolean} includePointDetails - Include all properties for the test point.
* @param {number} skip - Number of test points to skip..
* @param {number} top - Number of test points to return.
*/
getPoints(project, planId, suiteId, witFields, configurationId, testCaseId, testPointIds, includePointDetails, skip, top) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project,
planId: planId,
suiteId: suiteId
};
let queryValues = {
witFields: witFields,
configurationId: configurationId,
testCaseId: testCaseId,
testPointIds: testPointIds,
includePointDetails: includePointDetails,
'$skip': skip,
'$top': top,
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Test", "3bcfd5c8-be62-488e-b1da-b8289ce9299c", routeValues, queryValues);
let url = verData.requestUrl;
let options = this.createRequestOptions('application/json', verData.apiVersion);
let res;
res = yield this.rest.get(url, options);
let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestPoint, true);
resolve(ret);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* Update test points.
*
* @param {TestInterfaces.PointUpdateModel} pointUpdateModel - Data to update.
* @param {string} project - Project ID or project name
* @param {number} planId - ID of the test plan.
* @param {number} suiteId - ID of the suite that contains the points.
* @param {string} pointIds - ID of the test point to get. Use a comma-separated list of IDs to update multiple test points.
*/
updateTestPoints(pointUpdateModel, project, planId, suiteId, pointIds) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project,
planId: planId,
suiteId: suiteId,
pointIds: pointIds
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Test", "3bcfd5c8-be62-488e-b1da-b8289ce9299c", routeValues);
let url = verData.requestUrl;
let options = this.createRequestOptions('application/json', verData.apiVersion);
let res;
res = yield this.rest.update(url, pointUpdateModel, options);
let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestPoint, true);
resolve(ret);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* Get test points using query.
*
* @param {TestInterfaces.TestPointsQuery} query - TestPointsQuery to get test points.
* @param {string} project - Project ID or project name
* @param {number} skip - Number of test points to skip..
* @param {number} top - Number of test points to return.
*/
getPointsByQuery(query, project, skip, top) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project
};
let queryValues = {
'$skip': skip,
'$top': top,
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Test", "b4264fd0-a5d1-43e2-82a5-b9c46b7da9ce", routeValues, queryValues);
let url = verData.requestUrl;
let options = this.createRequestOptions('application/json', verData.apiVersion);
let res;
res = yield this.rest.create(url, query, options);
let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestPointsQuery, false);
resolve(ret);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* @param {string} project - Project ID or project name
* @param {number} buildId
* @param {string} publishContext
* @param {string} groupBy
* @param {string} filter
* @param {string} orderby
* @param {boolean} shouldIncludeResults
* @param {boolean} queryRunSummaryForInProgress
*/
getTestResultDetailsForBuild(project, buildId, publishContext, groupBy, filter, orderby, shouldIncludeResults, queryRunSummaryForInProgress) {
return __awaiter(this, void 0, void 0, function* () {
if (buildId == null) {
throw new TypeError('buildId can not be null or undefined');
}
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project
};
let queryValues = {
buildId: buildId,
publishContext: publishContext,
groupBy: groupBy,
'$filter': filter,
'$orderby': orderby,
shouldIncludeResults: shouldIncludeResults,
queryRunSummaryForInProgress: queryRunSummaryForInProgress,
};
try {
let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Test", "efb387b0-10d5-42e7-be40-95e06ee9430f", routeValues, queryValues);
let url = verData.requestUrl;
let options = this.createRequestOptions('application/json', verData.apiVersion);
let res;
res = yield this.rest.get(url, options);
let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestResultsDetails, false);
resolve(ret);
}
catch (err) {
reject(err);
}
}));
});
}
/**
* @param {string} project - Project ID or project name
* @param {number} releaseId
* @param {number} releaseEnvId
* @param {string} publishContext
* @param {string} groupBy
* @param {string} filter
* @param {string} orderby
* @param {boolean} shouldIncludeResults
* @param {boolean} queryRunSummaryForInProgress
*/
getTestResultDetailsForRelease(project, releaseId, releaseEnvId, publishContext, groupBy, filter, orderby, shouldIncludeResults, queryRunSummaryForInProgress) {
return __awaiter(this, void 0, void 0, function* () {
if (releaseId == null) {
throw new TypeError('releaseId can not be null or undefined');
}
if (releaseEnvId == null) {
throw new TypeError('releaseEnvId can not be null or undefined');
}
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let routeValues = {
project: project
};
let queryValues = {
releaseId: releaseId,
releaseEnvId: releaseEnvId,
publishContext: publishContext,