TestPlanRestClient class
Base class that should be used (derived from) to make requests to VSS REST apis
- Extends
Constructors
Test |
Methods
Constructor Details
TestPlanRestClient(IVssRestClientOptions)
Method Details
addTestCasesToSuite(SuiteTestCaseCreateUpdateParameters[], string, number, number)
Add test cases to a suite with specified configurations
function addTestCasesToSuite(suiteTestCaseCreateUpdateParameters: SuiteTestCaseCreateUpdateParameters[], project: string, planId: number, suiteId: number): Promise<TestCase[]>
Parameters
- suiteTestCaseCreateUpdateParameters
SuiteTestCaseCreateUpdateParameters object.
- project
-
string
Project ID or project name
- planId
-
number
ID of the test plan to which test cases are to be added.
- suiteId
-
number
ID of the test suite to which test cases are to be added.
Returns
Promise<TestCase[]>
cloneTestCase(CloneTestCaseParams, string)
function cloneTestCase(cloneRequestBody: CloneTestCaseParams, project: string): Promise<CloneTestCaseOperationInformation>
Parameters
- cloneRequestBody
- CloneTestCaseParams
- project
-
string
Project ID or project name
Returns
Promise<CloneTestCaseOperationInformation>
cloneTestPlan(CloneTestPlanParams, string, boolean)
Clone test plan
function cloneTestPlan(cloneRequestBody: CloneTestPlanParams, project: string, deepClone?: boolean): Promise<CloneTestPlanOperationInformation>
Parameters
- cloneRequestBody
- CloneTestPlanParams
Plan Clone Request Body detail TestPlanCloneRequest
- project
-
string
Project ID or project name
- deepClone
-
boolean
Clones all the associated test cases as well
Returns
Promise<CloneTestPlanOperationInformation>
cloneTestSuite(CloneTestSuiteParams, string, boolean)
Clone test suite
function cloneTestSuite(cloneRequestBody: CloneTestSuiteParams, project: string, deepClone?: boolean): Promise<CloneTestSuiteOperationInformation>
Parameters
- cloneRequestBody
- CloneTestSuiteParams
Suite Clone Request Body detail TestSuiteCloneRequest
- project
-
string
Project ID or project name
- deepClone
-
boolean
Clones all the associated test cases as well
Returns
Promise<CloneTestSuiteOperationInformation>
createBulkTestSuites(TestSuiteCreateParams[], string, number, number)
Create bulk requirement based test suites.
function createBulkTestSuites(testSuiteCreateParams: TestSuiteCreateParams[], project: string, planId: number, parentSuiteId: number): Promise<TestSuite[]>
Parameters
- testSuiteCreateParams
Parameters for suite creation
- project
-
string
Project ID or project name
- planId
-
number
ID of the test plan where requirement based suites need to be created.
- parentSuiteId
-
number
ID of the parent suite under which requirement based suites will be created
Returns
Promise<TestSuite[]>
createTestConfiguration(TestConfigurationCreateUpdateParameters, string)
Create a test configuration.
function createTestConfiguration(testConfigurationCreateUpdateParameters: TestConfigurationCreateUpdateParameters, project: string): Promise<TestConfiguration>
Parameters
- testConfigurationCreateUpdateParameters
- TestConfigurationCreateUpdateParameters
TestConfigurationCreateUpdateParameters
- project
-
string
Project ID or project name
Returns
Promise<TestConfiguration>
createTestPlan(TestPlanCreateParams, string)
Create a test plan.
function createTestPlan(testPlanCreateParams: TestPlanCreateParams, project: string): Promise<TestPlan>
Parameters
- testPlanCreateParams
- TestPlanCreateParams
A testPlanCreateParams object.TestPlanCreateParams
- project
-
string
Project ID or project name
Returns
Promise<TestPlan>
createTestSuite(TestSuiteCreateParams, string, number)
Create test suite.
function createTestSuite(testSuiteCreateParams: TestSuiteCreateParams, project: string, planId: number): Promise<TestSuite>
Parameters
- testSuiteCreateParams
- TestSuiteCreateParams
Parameters for suite creation
- project
-
string
Project ID or project name
- planId
-
number
ID of the test plan that contains the suites.
Returns
Promise<TestSuite>
createTestVariable(TestVariableCreateUpdateParameters, string)
Create a test variable.
function createTestVariable(testVariableCreateUpdateParameters: TestVariableCreateUpdateParameters, project: string): Promise<TestVariable>
Parameters
- testVariableCreateUpdateParameters
- TestVariableCreateUpdateParameters
TestVariableCreateUpdateParameters
- project
-
string
Project ID or project name
Returns
Promise<TestVariable>
deleteTestCase(string, number)
Delete a test case.
function deleteTestCase(project: string, testCaseId: number): Promise<void>
Parameters
- project
-
string
Project ID or project name
- testCaseId
-
number
Id of test case to be deleted.
Returns
Promise<void>
deleteTestConfguration(string, number)
Delete a test configuration by its ID.
function deleteTestConfguration(project: string, testConfiguartionId: number): Promise<void>
Parameters
- project
-
string
Project ID or project name
- testConfiguartionId
-
number
ID of the test configuration to delete.
Returns
Promise<void>
deleteTestPlan(string, number)
Delete a test plan.
function deleteTestPlan(project: string, planId: number): Promise<void>
Parameters
- project
-
string
Project ID or project name
- planId
-
number
ID of the test plan to be deleted.
Returns
Promise<void>
deleteTestSuite(string, number, number)
Delete test suite.
function deleteTestSuite(project: string, planId: number, suiteId: number): Promise<void>
Parameters
- project
-
string
Project ID or project name
- planId
-
number
ID of the test plan that contains the suite.
- suiteId
-
number
ID of the test suite to delete.
Returns
Promise<void>
deleteTestVariable(string, number)
Delete a test variable by its ID.
function deleteTestVariable(project: string, testVariableId: number): Promise<void>
Parameters
- project
-
string
Project ID or project name
- testVariableId
-
number
ID of the test variable to delete.
Returns
Promise<void>
exportTestCases(ExportTestCaseParams, string)
Exports a set of test cases from a suite to a file. Currently supported formats: xlsx
function exportTestCases(exportTestCaseRequestBody: ExportTestCaseParams, project: string): Promise<ArrayBuffer>
Parameters
- exportTestCaseRequestBody
- ExportTestCaseParams
A ExportTestCaseParams object.ExportTestCaseParams
- project
-
string
Project ID or project name
Returns
Promise<ArrayBuffer>
getCloneInformation(string, number)
Get clone information.
function getCloneInformation(project: string, cloneOperationId: number): Promise<CloneTestPlanOperationInformation>
Parameters
- project
-
string
Project ID or project name
- cloneOperationId
-
number
Operation ID returned when we queue a clone operation
Returns
Promise<CloneTestPlanOperationInformation>
getDeletedTestPlans(string, string)
Get a list of deleted test plans
function getDeletedTestPlans(project: string, continuationToken?: string): Promise<PagedList<TestPlan>>
Parameters
- project
-
string
Project ID or project name
- continuationToken
-
string
If the list of plans returned is not complete, a continuation token to query next batch of plans is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test plans.
Returns
getPoints(string, number, number, string, boolean, boolean)
Get a particular Test Point from a suite.
function getPoints(project: string, planId: number, suiteId: number, pointId: string, returnIdentityRef?: boolean, includePointDetails?: boolean): Promise<TestPoint[]>
Parameters
- project
-
string
Project ID or project name
- planId
-
number
ID of the test plan for which test points are requested.
- suiteId
-
number
ID of the test suite for which test points are requested.
- pointId
-
string
ID of test point to be fetched.
- returnIdentityRef
-
boolean
If set to true, returns the AssignedTo field in TestCaseReference as IdentityRef object.
- includePointDetails
-
boolean
If set to false, will get a smaller payload containing only basic details about the test point object
Returns
Promise<TestPoint[]>
getPointsList(string, number, number, string, string, string, boolean, boolean, boolean)
Get all the points inside a suite based on some filters
function getPointsList(project: string, planId: number, suiteId: number, testPointIds?: string, testCaseId?: string, continuationToken?: string, returnIdentityRef?: boolean, includePointDetails?: boolean, isRecursive?: boolean): Promise<PagedList<TestPoint>>
Parameters
- project
-
string
Project ID or project name
- planId
-
number
ID of the test plan for which test points are requested.
- suiteId
-
number
ID of the test suite for which test points are requested
- testPointIds
-
string
ID of test points to fetch.
- testCaseId
-
string
Get Test Points for specific test case Ids.
- continuationToken
-
string
If the list of test point returned is not complete, a continuation token to query next batch of test points is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test points.
- returnIdentityRef
-
boolean
If set to true, returns the AssignedTo field in TestCaseReference as IdentityRef object.
- includePointDetails
-
boolean
If set to false, will get a smaller payload containing only basic details about the test point object
- isRecursive
-
boolean
If set to true, will also fetch test points belonging to child suites recursively.
Returns
getSuiteCloneInformation(string, number)
Get clone information.
function getSuiteCloneInformation(project: string, cloneOperationId: number): Promise<CloneTestSuiteOperationInformation>
Parameters
- project
-
string
Project ID or project name
- cloneOperationId
-
number
Operation ID returned when we queue a clone operation
Returns
Promise<CloneTestSuiteOperationInformation>
getSuiteEntries(string, number, SuiteEntryTypes)
Get a list of test suite entries in the test suite.
function getSuiteEntries(project: string, suiteId: number, suiteEntryType?: SuiteEntryTypes): Promise<SuiteEntry[]>
Parameters
- project
-
string
Project ID or project name
- suiteId
-
number
Id of the parent suite.
- suiteEntryType
- SuiteEntryTypes
Returns
Promise<SuiteEntry[]>
getSuitesByTestCaseId(number)
Find the list of all test suites in which a given test case is present. This is helpful if you need to find out which test suites are using a test case, when you need to make changes to a test case.
function getSuitesByTestCaseId(testCaseId: number): Promise<TestSuite[]>
Parameters
- testCaseId
-
number
ID of the test case for which suites need to be fetched.
Returns
Promise<TestSuite[]>
getTestCase(string, number, number, string, string, boolean)
Get a particular Test Case from a Suite.
function getTestCase(project: string, planId: number, suiteId: number, testCaseId: string, witFields?: string, returnIdentityRef?: boolean): Promise<TestCase[]>
Parameters
- project
-
string
Project ID or project name
- planId
-
number
ID of the test plan for which test cases are requested.
- suiteId
-
number
ID of the test suite for which test cases are requested.
- testCaseId
-
string
Test Case Id to be fetched.
- witFields
-
string
Get the list of witFields.
- returnIdentityRef
-
boolean
If set to true, returns all identity fields, like AssignedTo, ActivatedBy etc., as IdentityRef objects. If set to false, these fields are returned as unique names in string format. This is false by default.
Returns
Promise<TestCase[]>
getTestCaseCloneInformation(string, number)
Get clone information.
function getTestCaseCloneInformation(project: string, cloneOperationId: number): Promise<CloneTestCaseOperationInformation>
Parameters
- project
-
string
Project ID or project name
- cloneOperationId
-
number
Operation ID returned when we queue a clone operation
Returns
Promise<CloneTestCaseOperationInformation>
getTestCaseList(string, number, number, string, string, string, string, boolean, boolean, ExcludeFlags, boolean)
Get Test Case List return those test cases which have all the configuration Ids as mentioned in the optional parameter. If configuration Ids is null, it return all the test cases
function getTestCaseList(project: string, planId: number, suiteId: number, testIds?: string, configurationIds?: string, witFields?: string, continuationToken?: string, returnIdentityRef?: boolean, expand?: boolean, excludeFlags?: ExcludeFlags, isRecursive?: boolean): Promise<PagedList<TestCase>>
Parameters
- project
-
string
Project ID or project name
- planId
-
number
ID of the test plan for which test cases are requested.
- suiteId
-
number
ID of the test suite for which test cases are requested.
- testIds
-
string
Test Case Ids to be fetched.
- configurationIds
-
string
Fetch Test Cases which contains all the configuration Ids specified.
- witFields
-
string
Get the list of witFields.
- continuationToken
-
string
If the list of test cases returned is not complete, a continuation token to query next batch of test cases is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test cases.
- returnIdentityRef
-
boolean
If set to true, returns all identity fields, like AssignedTo, ActivatedBy etc., as IdentityRef objects. If set to false, these fields are returned as unique names in string format. This is false by default.
- expand
-
boolean
If set to false, will get a smaller payload containing only basic details about the suite test case object
- excludeFlags
- ExcludeFlags
Flag to exclude various values from payload. For example to remove point assignments pass exclude = 1. To remove extra information (links, test plan , test suite) pass exclude = 2. To remove both extra information and point assignments pass exclude = 3 (1 + 2).
- isRecursive
-
boolean
Returns
getTestConfigurationById(string, number)
Get a test configuration
function getTestConfigurationById(project: string, testConfigurationId: number): Promise<TestConfiguration>
Parameters
- project
-
string
Project ID or project name
- testConfigurationId
-
number
ID of the test configuration to get.
Returns
Promise<TestConfiguration>
getTestConfigurations(string, string)
Get a list of test configurations.
function getTestConfigurations(project: string, continuationToken?: string): Promise<PagedList<TestConfiguration>>
Parameters
- project
-
string
Project ID or project name
- continuationToken
-
string
If the list of configurations returned is not complete, a continuation token to query next batch of configurations is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test configurations.
Returns
Promise<PagedList<TestConfiguration>>
getTestEntityCountByPlanId(string, number, string, UserFriendlyTestOutcome, string, string, string, TestEntityTypes)
function getTestEntityCountByPlanId(project: string, planId: number, states?: string, outcome?: UserFriendlyTestOutcome, configurations?: string, testers?: string, assignedTo?: string, entity?: TestEntityTypes): Promise<TestEntityCount[]>
Parameters
- project
-
string
Project ID or project name
- planId
-
number
- states
-
string
- outcome
- UserFriendlyTestOutcome
- configurations
-
string
- testers
-
string
- assignedTo
-
string
- entity
- TestEntityTypes
Returns
Promise<TestEntityCount[]>
getTestPlanById(string, number)
Get a test plan by Id.
function getTestPlanById(project: string, planId: number): Promise<TestPlan>
Parameters
- project
-
string
Project ID or project name
- planId
-
number
ID of the test plan to get.
Returns
Promise<TestPlan>
getTestPlans(string, string, string, boolean, boolean)
Get a list of test plans
function getTestPlans(project: string, owner?: string, continuationToken?: string, includePlanDetails?: boolean, filterActivePlans?: boolean): Promise<PagedList<TestPlan>>
Parameters
- project
-
string
Project ID or project name
- owner
-
string
Filter for test plan by owner ID or name
- continuationToken
-
string
If the list of plans returned is not complete, a continuation token to query next batch of plans is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test plans.
- includePlanDetails
-
boolean
Get all properties of the test plan
- filterActivePlans
-
boolean
Get just the active plans
Returns
getTestSuiteById(string, number, number, SuiteExpand)
Get test suite by suite id.
function getTestSuiteById(project: string, planId: number, suiteId: number, expand?: SuiteExpand): Promise<TestSuite>
Parameters
- project
-
string
Project ID or project name
- planId
-
number
ID of the test plan that contains the suites.
- suiteId
-
number
ID of the suite to get.
- expand
- SuiteExpand
Include the children suites and testers details
Returns
Promise<TestSuite>
getTestSuitesForPlan(string, number, SuiteExpand, string, boolean)
Get test suites for plan.
function getTestSuitesForPlan(project: string, planId: number, expand?: SuiteExpand, continuationToken?: string, asTreeView?: boolean): Promise<PagedList<TestSuite>>
Parameters
- project
-
string
Project ID or project name
- planId
-
number
ID of the test plan for which suites are requested.
- expand
- SuiteExpand
Include the children suites and testers details.
- continuationToken
-
string
If the list of suites returned is not complete, a continuation token to query next batch of suites is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test suites.
- asTreeView
-
boolean
If the suites returned should be in a tree structure.
Returns
getTestVariableById(string, number)
Get a test variable by its ID.
function getTestVariableById(project: string, testVariableId: number): Promise<TestVariable>
Parameters
- project
-
string
Project ID or project name
- testVariableId
-
number
ID of the test variable to get.
Returns
Promise<TestVariable>
getTestVariables(string, string)
Get a list of test variables.
function getTestVariables(project: string, continuationToken?: string): Promise<PagedList<TestVariable>>
Parameters
- project
-
string
Project ID or project name
- continuationToken
-
string
If the list of variables returned is not complete, a continuation token to query next batch of variables is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test variables.
Returns
Promise<PagedList<TestVariable>>
removeTestCasesFromSuite(string, number, number, string)
Removes test cases from a suite based on the list of test case Ids provided.
function removeTestCasesFromSuite(project: string, planId: number, suiteId: number, testCaseIds: string): Promise<void>
Parameters
- project
-
string
Project ID or project name
- planId
-
number
ID of the test plan from which test cases are to be removed.
- suiteId
-
number
ID of the test suite from which test cases are to be removed.
- testCaseIds
-
string
Test Case Ids to be removed.
Returns
Promise<void>
removeTestCasesListFromSuite(string, number, number, string)
Removes test cases from a suite based on the list of test case Ids provided. This API can be used to remove a larger number of test cases.
function removeTestCasesListFromSuite(project: string, planId: number, suiteId: number, testIds: string): Promise<void>
Parameters
- project
-
string
Project ID or project name
- planId
-
number
ID of the test plan from which test cases are to be removed.
- suiteId
-
number
ID of the test suite from which test cases are to be removed.
- testIds
-
string
Comma separated string of Test Case Ids to be removed.
Returns
Promise<void>
reorderSuiteEntries(SuiteEntryUpdateParams[], string, number)
Reorder test suite entries in the test suite.
function reorderSuiteEntries(suiteEntries: SuiteEntryUpdateParams[], project: string, suiteId: number): Promise<SuiteEntry[]>
Parameters
- suiteEntries
List of SuiteEntry to reorder.
- project
-
string
Project ID or project name
- suiteId
-
number
Id of the parent test suite.
Returns
Promise<SuiteEntry[]>
restoreDeletedTestPlan(TestPlanAndSuiteRestoreModel, string, number)
Restores the deleted test plan
function restoreDeletedTestPlan(restoreModel: TestPlanAndSuiteRestoreModel, project: string, planId: number): Promise<void>
Parameters
- restoreModel
- TestPlanAndSuiteRestoreModel
The model containing the restore information
- project
-
string
Project ID or project name
- planId
-
number
The ID of the test plan to restore
Returns
Promise<void>
restoreDeletedTestSuite(TestPlanAndSuiteRestoreModel, string, number)
Restores the deleted test suite
function restoreDeletedTestSuite(payload: TestPlanAndSuiteRestoreModel, project: string, suiteId: number): Promise<void>
Parameters
- payload
- TestPlanAndSuiteRestoreModel
The model containing the restore information
- project
-
string
Project ID or project name
- suiteId
-
number
The ID of the test suite to restore
Returns
Promise<void>
updateSuiteTestCases(SuiteTestCaseCreateUpdateParameters[], string, number, number)
Update the configurations for test cases
function updateSuiteTestCases(suiteTestCaseCreateUpdateParameters: SuiteTestCaseCreateUpdateParameters[], project: string, planId: number, suiteId: number): Promise<TestCase[]>
Parameters
- suiteTestCaseCreateUpdateParameters
A SuiteTestCaseCreateUpdateParameters object.
- project
-
string
Project ID or project name
- planId
-
number
ID of the test plan to which test cases are to be updated.
- suiteId
-
number
ID of the test suite to which test cases are to be updated.
Returns
Promise<TestCase[]>
updateTestConfiguration(TestConfigurationCreateUpdateParameters, string, number)
Update a test configuration by its ID.
function updateTestConfiguration(testConfigurationCreateUpdateParameters: TestConfigurationCreateUpdateParameters, project: string, testConfiguartionId: number): Promise<TestConfiguration>
Parameters
- testConfigurationCreateUpdateParameters
- TestConfigurationCreateUpdateParameters
TestConfigurationCreateUpdateParameters
- project
-
string
Project ID or project name
- testConfiguartionId
-
number
ID of the test configuration to update.
Returns
Promise<TestConfiguration>
updateTestPlan(TestPlanUpdateParams, string, number)
Update a test plan.
function updateTestPlan(testPlanUpdateParams: TestPlanUpdateParams, project: string, planId: number): Promise<TestPlan>
Parameters
- testPlanUpdateParams
- TestPlanUpdateParams
A testPlanUpdateParams object.TestPlanUpdateParams
- project
-
string
Project ID or project name
- planId
-
number
ID of the test plan to be updated.
Returns
Promise<TestPlan>
updateTestPoints(TestPointUpdateParams[], string, number, number, boolean, boolean)
Update Test Points. This is used to Reset test point to active, update the outcome of a test point or update the tester of a test point
function updateTestPoints(testPointUpdateParams: TestPointUpdateParams[], project: string, planId: number, suiteId: number, includePointDetails?: boolean, returnIdentityRef?: boolean): Promise<TestPoint[]>
Parameters
- testPointUpdateParams
A TestPointUpdateParams Object.
- project
-
string
Project ID or project name
- planId
-
number
ID of the test plan for which test points are requested.
- suiteId
-
number
ID of the test suite for which test points are requested.
- includePointDetails
-
boolean
If set to false, will get a smaller payload containing only basic details about the test point object
- returnIdentityRef
-
boolean
If set to true, returns the AssignedTo field in TestCaseReference as IdentityRef object.
Returns
Promise<TestPoint[]>
updateTestSuite(TestSuiteUpdateParams, string, number, number)
Update test suite.
function updateTestSuite(testSuiteUpdateParams: TestSuiteUpdateParams, project: string, planId: number, suiteId: number): Promise<TestSuite>
Parameters
- testSuiteUpdateParams
- TestSuiteUpdateParams
Parameters for suite updation
- project
-
string
Project ID or project name
- planId
-
number
ID of the test plan that contains the suites.
- suiteId
-
number
ID of the parent suite.
Returns
Promise<TestSuite>
updateTestVariable(TestVariableCreateUpdateParameters, string, number)
Update a test variable by its ID.
function updateTestVariable(testVariableCreateUpdateParameters: TestVariableCreateUpdateParameters, project: string, testVariableId: number): Promise<TestVariable>
Parameters
- testVariableCreateUpdateParameters
- TestVariableCreateUpdateParameters
TestVariableCreateUpdateParameters
- project
-
string
Project ID or project name
- testVariableId
-
number
ID of the test variable to update.
Returns
Promise<TestVariable>