UNPKG

azure-devops-test-helper

Version:

Import JSON result with attachments into Azure Test Plan

15 lines (14 loc) 600 B
export async function getTestCasesByPlanID(axiosClient, planId, suiteId) { let continuationToken = ""; const testCases = []; do { const response = await axiosClient .get(`testplan/Plans/${planId}/Suites/${suiteId}/TestCase?isRecursive=true&continuationToken=${continuationToken}&api-version=7.0`) .catch((error) => { throw new Error(error); }); testCases.push(...response.data.value); continuationToken = response.headers["x-ms-continuationtoken"]; } while (continuationToken !== undefined); return testCases; }