UNPKG

zephyr-scale-api

Version:

Zephyr Scale API SDK to simplify automated testing development.

294 lines (293 loc) 9.03 kB
import "dotenv/config"; declare type ListPayload = { maxResults?: number; startAt?: number; }; declare type ListWithProjectKeyPayload = ListPayload & { projectKey?: string; }; declare type CreateCustomExecutionsMetaPayload = { projectKey: string; autoCreateTestCases?: boolean; }; declare type CreateCustomExecutionsBodyPayload = { file: string; testCycle?: { name: string; description: string; jiraProjectVersion: number; folderId: number; customFields: any; }; }; declare type TestCaseKey = { testCaseKey: string; }; declare type TestCycleIdOrKey = { testCycleIdOrKey: string; }; interface Zephyr { auth: (token: string | undefined) => null; listEnvironments: (payload?: ListWithProjectKeyPayload) => any; getEnvironment: (payload: { environmentId: number; }) => any; listFolders: (payload?: ListWithProjectKeyPayload & { folderType?: string; }) => any; createFolder: (payload: { folderType: string; name: string; projectKey: string; parentId?: number; }) => any; getFolder: (payload: { folderId: number; }) => any; listTestPlans: (payload?: ListWithProjectKeyPayload) => any; deleteLink: (payload: { linkId: number; }) => any; healthcheck: () => any; getPriority: (payload?: ListWithProjectKeyPayload) => any; listPriorities: (payload: { priorityId: number; }) => any; listProjects: (payload?: ListPayload) => any; getProject: (payload: { projectIdOrKey: string; }) => any; listStatuses: (payload?: ListWithProjectKeyPayload & { statusType?: string; }) => any; getStatus: (payload: { statusId: number; }) => any; createCustomExecutions: (payloadBody: CreateCustomExecutionsBodyPayload, payloadMeta: CreateCustomExecutionsMetaPayload) => any; createCucumberExecutions: (payloadBody: CreateCustomExecutionsBodyPayload, payloadMeta: CreateCustomExecutionsMetaPayload) => any; createJUnitExecutions: (payloadBody: CreateCustomExecutionsBodyPayload, payloadMeta: CreateCustomExecutionsMetaPayload) => any; retrieveBDDTestCases: (payload: { projectKey: string; }) => any; listTestCases: (payload?: ListWithProjectKeyPayload & { folderId?: number; }) => any; createTestCase: (payload: { name: string; projectKey: string; objective?: string; precondition?: string; estimatedTime?: number; componentId?: number; priorityName?: string; statusName?: string; folderId?: number; ownerId?: string; labels?: string[]; customFields?: {}; }) => any; getTestCase: (payload: TestCaseKey) => any; updateTestCase: (payloadBody: { id: number; key: string; name: string; project: { id: number; self?: string; }; priority: { id: number; self?: string; }; status: { id: number; self?: string; }; createdOn?: string; objective?: string; precondition?: string; estimatedTime?: number; labels?: string[]; component?: { id: number; self?: string; }; folder?: { id: number; self?: string; }; owner?: { accountId: string; self?: string; }; testScript?: { self?: string; }; customFields?: {}; links?: { self?: string; issues?: { self?: string; issueId: number; id: number; target: string; type: "COVERAGE" | "BLOCKS" | "RELATED"; }[]; webLinks?: { self?: string; description?: string; url: string; id: number; type: "COVERAGE" | "BLOCKS" | "RELATED"; }[]; }; }, payloadMeta: TestCaseKey) => any; getTestCaseLinks: (payload: TestCaseKey) => any; createTestCaseIssueLinks: (payloadBody: { issueId: number; }, payloadMeta: TestCaseKey) => any; createTestCaseWebLinks: (payloadBody: { url: string; description?: string; }, payloadMeta: TestCaseKey) => any; listTestCaseVersions: (payload: ListPayload & TestCaseKey) => any; getTestCaseVersion: (payload: TestCaseKey & { version: string; }) => any; getTestCaseTestScript: (payload: TestCaseKey) => any; createTestCaseTestScript: (payloadBody: { text: string; type: string; }, payloadMeta: TestCaseKey) => any; getTestCaseTestSteps: (payload: ListPayload & TestCaseKey) => any; createTestCaseTestSteps: (payloadBody: { mode: "APPEND" | "OVERWRITE"; items: { inline?: { description?: string; testData?: string; expectedResult?: string; customFields?: {}; }; testCase?: { testCaseKey: string; self?: string; }; }[]; }, payloadMeta: TestCaseKey) => any; listTestCycles: (payload: ListWithProjectKeyPayload & { folderId: number; }) => any; createTestCycle: (payload: { name: string; projectKey: string; description?: string; plannedStartDate?: string; plannedEndDate?: string; jiraProjectVersion?: number; statusName?: string; folderId?: number; ownerId?: string; customFields?: {}; }) => any; getTestCycle: (payload: TestCycleIdOrKey) => any; updateTestCycle: (payloadBody: { id: number; key: string; name: string; project: { id: number; self?: string; }; status: { id: number; self?: string; }; jiraProjectVersion?: { id: number; self?: string; }; folder?: { id: number; self?: string; }; description?: string; plannedStartDate?: string; plannedEndDate?: string; owner?: { accountId: string; self?: string; }; customFields?: {}; links?: { self?: string; issues?: { self?: string; issueId: number; id: number; target: string; type: "COVERAGE" | "BLOCKS" | "RELATED"; }[]; webLinks?: { self?: string; description?: string; url: string; id: number; type: "COVERAGE" | "BLOCKS" | "RELATED"; }[]; testPlans: { id: number; self?: string; type: "COVERAGE" | "BLOCKS" | "RELATED"; testPlanId: number; }[]; }; }, payloadMeta: TestCycleIdOrKey) => any; getTestCycleLinks: (payload: TestCycleIdOrKey) => any; createTestCycleIssueLink: (payloadBody: { issueId: number; }, payloadMeta: TestCycleIdOrKey) => any; createTestCycleWebLink: (payloadBody: { url: string; description?: string; }, payloadMeta: TestCycleIdOrKey) => any; listTestExecutions: (payload: ListWithProjectKeyPayload & { testCycle?: string; testCase?: string; actualEndDateAfter?: string; actualEndDateBefore?: string; includeStepLinks?: boolean; }) => any; createTestExecution: (payload: { projectKey: string; statusName: string; testCaseKey: string; testCycleKey: string; testScriptResults?: { statusName: string; actualEndDate?: string; actualResult?: string; }[]; environmentName?: string; actualEndDate?: string; executionTime?: number; executedById?: string; assignedToId?: string; comment?: string; customFields?: {}; }) => any; getTestExecution: (payload: { includeStepLinks?: boolean; testExecutionIdOrKey: string; }) => any; listTestExecutionLinks: (payload: { testExecutionIdOrKey: string; }) => any; createTestExecutionIssueLink: (payloadBody: { issueId: number; }, payloadMeta: { testExecutionIdOrKey: string; }) => any; } declare const zephyr: Zephyr; export = zephyr;