@rbaileysr/zephyr-managed-api 1.3.6 → 1.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +215 -3
- package/dist/README.md +215 -3
- package/dist/groups/All.d.ts +1 -1
- package/dist/groups/All.d.ts.map +1 -1
- package/dist/groups/Private/PrivateConfig.d.ts +26 -10
- package/dist/groups/Private/PrivateConfig.d.ts.map +1 -1
- package/dist/groups/Private/PrivateConfig.js +36 -12
- package/dist/groups/Private/PrivateExtendedData.d.ts +229 -0
- package/dist/groups/Private/PrivateExtendedData.d.ts.map +1 -0
- package/dist/groups/Private/PrivateExtendedData.js +543 -0
- package/dist/groups/Private/PrivateTestCaseArchiving.d.ts +123 -0
- package/dist/groups/Private/PrivateTestCaseArchiving.d.ts.map +1 -0
- package/dist/groups/Private/PrivateTestCaseArchiving.js +265 -0
- package/dist/groups/Private.d.ts +12 -0
- package/dist/groups/Private.d.ts.map +1 -1
- package/dist/groups/Private.js +4 -0
- package/dist/groups/TestExecution.d.ts +4 -2
- package/dist/groups/TestExecution.d.ts.map +1 -1
- package/dist/groups/TestExecution.js +6 -2
- package/dist/package.json +1 -2
- package/dist/types.d.ts +263 -3
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -2
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright Adaptavist 2025 (c) All rights reserved
|
|
3
|
+
*/
|
|
4
|
+
import { PrivateBase } from './PrivateBase';
|
|
5
|
+
import { BadRequestError, UnauthorizedError, ForbiddenError, NotFoundError, ServerError, UnexpectedError, } from '../../utils';
|
|
6
|
+
export class PrivateTestCaseArchiving extends PrivateBase {
|
|
7
|
+
constructor(apiConnection) {
|
|
8
|
+
super(apiConnection);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Get archived test cases using private API
|
|
12
|
+
*
|
|
13
|
+
* Retrieves a paginated list of archived test cases for a project.
|
|
14
|
+
* The archived flag is not available in the public API, so this method
|
|
15
|
+
* provides access to archived test cases.
|
|
16
|
+
*
|
|
17
|
+
* ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
|
|
18
|
+
* The endpoint may change or be removed at any time without notice.
|
|
19
|
+
*
|
|
20
|
+
* @param credentials - Private API credentials
|
|
21
|
+
* @param request - Get archived test cases request
|
|
22
|
+
* @param request.projectId - Jira project ID (numeric, not the project key)
|
|
23
|
+
* @param request.maxResults - Maximum number of results to return (default: 50)
|
|
24
|
+
* @param request.startAt - Zero-indexed starting position (default: 0)
|
|
25
|
+
* @param request.query - Optional query string for filtering (e.g., "testCase.name CONTAINS 'test'")
|
|
26
|
+
* @returns Paginated list of archived test cases
|
|
27
|
+
* @throws {BadRequestError} If the request is invalid
|
|
28
|
+
* @throws {UnauthorizedError} If authentication fails
|
|
29
|
+
* @throws {ForbiddenError} If the user doesn't have permission
|
|
30
|
+
* @throws {ServerError} If the server returns an error
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* // Get first page of archived test cases
|
|
35
|
+
* const archived = await api.Private.TestCaseArchiving.getArchivedTestCases(credentials, {
|
|
36
|
+
* projectId: 10316,
|
|
37
|
+
* maxResults: 50,
|
|
38
|
+
* startAt: 0
|
|
39
|
+
* });
|
|
40
|
+
*
|
|
41
|
+
* // Get archived test cases with custom query
|
|
42
|
+
* const filtered = await api.Private.TestCaseArchiving.getArchivedTestCases(credentials, {
|
|
43
|
+
* projectId: 10316,
|
|
44
|
+
* query: "testCase.name CONTAINS 'migration'"
|
|
45
|
+
* });
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
async getArchivedTestCases(credentials, request) {
|
|
49
|
+
// Get Context JWT
|
|
50
|
+
const contextJwt = await this.getContextJwt(credentials);
|
|
51
|
+
// Build query string
|
|
52
|
+
const maxResults = request.maxResults ?? 50;
|
|
53
|
+
const startAt = request.startAt ?? 0;
|
|
54
|
+
const query = request.query ?? `testCase.projectId IN (${request.projectId}) ORDER BY testCase.name ASC`;
|
|
55
|
+
// Build fields list (matching the example)
|
|
56
|
+
const fields = 'id,key,projectId,name,averageTime,estimatedTime,labels,folderId,componentId,status(id,name,i18nKey,color),priority(id,name,i18nKey,color),lastTestResultStatus(name,i18nKey,color),majorVersion,createdOn,createdBy,updatedOn,updatedBy,customFieldValues,owner,folderId';
|
|
57
|
+
// Build URL
|
|
58
|
+
const params = new URLSearchParams({
|
|
59
|
+
fields,
|
|
60
|
+
query,
|
|
61
|
+
startAt: String(startAt),
|
|
62
|
+
maxResults: String(maxResults),
|
|
63
|
+
archived: 'true',
|
|
64
|
+
});
|
|
65
|
+
const url = `${this.privateApiBaseUrl}/testcase/search?${params.toString()}`;
|
|
66
|
+
const headers = {
|
|
67
|
+
accept: 'application/json',
|
|
68
|
+
authorization: `JWT ${contextJwt}`,
|
|
69
|
+
'jira-project-id': String(request.projectId),
|
|
70
|
+
};
|
|
71
|
+
try {
|
|
72
|
+
const response = await fetch(url, {
|
|
73
|
+
method: 'GET',
|
|
74
|
+
headers,
|
|
75
|
+
});
|
|
76
|
+
if (!response.ok) {
|
|
77
|
+
if (response.status === 400) {
|
|
78
|
+
throw new BadRequestError(`Invalid request parameters for getting archived test cases.`);
|
|
79
|
+
}
|
|
80
|
+
if (response.status === 401) {
|
|
81
|
+
throw new UnauthorizedError('Failed to authenticate. Please check your credentials.');
|
|
82
|
+
}
|
|
83
|
+
if (response.status === 403) {
|
|
84
|
+
throw new ForbiddenError('Insufficient permissions to get archived test cases.');
|
|
85
|
+
}
|
|
86
|
+
throw new ServerError(`Failed to get archived test cases. Status: ${response.status}`, response.status, response.statusText);
|
|
87
|
+
}
|
|
88
|
+
const data = (await response.json());
|
|
89
|
+
return data;
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
if (error instanceof BadRequestError ||
|
|
93
|
+
error instanceof UnauthorizedError ||
|
|
94
|
+
error instanceof ForbiddenError ||
|
|
95
|
+
error instanceof NotFoundError ||
|
|
96
|
+
error instanceof ServerError ||
|
|
97
|
+
error instanceof UnexpectedError) {
|
|
98
|
+
throw error;
|
|
99
|
+
}
|
|
100
|
+
throw new UnexpectedError(`Unexpected error while getting archived test cases for project ${request.projectId}`, error);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Archive test cases using private API
|
|
105
|
+
*
|
|
106
|
+
* Archives one or more test cases. This is a bulk operation that accepts
|
|
107
|
+
* an array of test case IDs.
|
|
108
|
+
*
|
|
109
|
+
* ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
|
|
110
|
+
* The endpoint may change or be removed at any time without notice.
|
|
111
|
+
*
|
|
112
|
+
* @param credentials - Private API credentials
|
|
113
|
+
* @param request - Archive test cases request
|
|
114
|
+
* @param request.projectId - Jira project ID (numeric, not the project key)
|
|
115
|
+
* @param request.testCaseIds - Array of test case IDs to archive
|
|
116
|
+
* @throws {BadRequestError} If the request is invalid
|
|
117
|
+
* @throws {UnauthorizedError} If authentication fails
|
|
118
|
+
* @throws {ForbiddenError} If the user doesn't have permission
|
|
119
|
+
* @throws {ServerError} If the server returns an error
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```typescript
|
|
123
|
+
* // Archive a single test case
|
|
124
|
+
* await api.Private.TestCaseArchiving.archiveTestCases(credentials, {
|
|
125
|
+
* projectId: 10316,
|
|
126
|
+
* testCaseIds: [288004503]
|
|
127
|
+
* });
|
|
128
|
+
*
|
|
129
|
+
* // Archive multiple test cases
|
|
130
|
+
* await api.Private.TestCaseArchiving.archiveTestCases(credentials, {
|
|
131
|
+
* projectId: 10316,
|
|
132
|
+
* testCaseIds: [288004503, 288004504, 288004505]
|
|
133
|
+
* });
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
async archiveTestCases(credentials, request) {
|
|
137
|
+
// Get Context JWT
|
|
138
|
+
const contextJwt = await this.getContextJwt(credentials);
|
|
139
|
+
// Validate input
|
|
140
|
+
if (!request.testCaseIds || request.testCaseIds.length === 0) {
|
|
141
|
+
throw new BadRequestError('At least one test case ID is required for archiving.');
|
|
142
|
+
}
|
|
143
|
+
const url = `${this.privateApiBaseUrl}/testcase/bulk/archive`;
|
|
144
|
+
const headers = {
|
|
145
|
+
'Content-Type': 'application/json',
|
|
146
|
+
accept: 'application/json',
|
|
147
|
+
authorization: `JWT ${contextJwt}`,
|
|
148
|
+
'jira-project-id': String(request.projectId),
|
|
149
|
+
};
|
|
150
|
+
// Body is an array of test case IDs
|
|
151
|
+
const body = JSON.stringify(request.testCaseIds);
|
|
152
|
+
try {
|
|
153
|
+
const response = await fetch(url, {
|
|
154
|
+
method: 'POST',
|
|
155
|
+
headers,
|
|
156
|
+
body,
|
|
157
|
+
});
|
|
158
|
+
if (!response.ok) {
|
|
159
|
+
if (response.status === 400) {
|
|
160
|
+
throw new BadRequestError(`Invalid request parameters for archiving test cases.`);
|
|
161
|
+
}
|
|
162
|
+
if (response.status === 401) {
|
|
163
|
+
throw new UnauthorizedError('Failed to authenticate. Please check your credentials.');
|
|
164
|
+
}
|
|
165
|
+
if (response.status === 403) {
|
|
166
|
+
throw new ForbiddenError('Insufficient permissions to archive test cases.');
|
|
167
|
+
}
|
|
168
|
+
throw new ServerError(`Failed to archive test cases. Status: ${response.status}`, response.status, response.statusText);
|
|
169
|
+
}
|
|
170
|
+
// Response is empty on success
|
|
171
|
+
}
|
|
172
|
+
catch (error) {
|
|
173
|
+
if (error instanceof BadRequestError ||
|
|
174
|
+
error instanceof UnauthorizedError ||
|
|
175
|
+
error instanceof ForbiddenError ||
|
|
176
|
+
error instanceof NotFoundError ||
|
|
177
|
+
error instanceof ServerError ||
|
|
178
|
+
error instanceof UnexpectedError) {
|
|
179
|
+
throw error;
|
|
180
|
+
}
|
|
181
|
+
throw new UnexpectedError(`Unexpected error while archiving test cases for project ${request.projectId}`, error);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Unarchive test cases using private API
|
|
186
|
+
*
|
|
187
|
+
* Unarchives one or more test cases. This is a bulk operation that accepts
|
|
188
|
+
* an array of test case IDs.
|
|
189
|
+
*
|
|
190
|
+
* ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
|
|
191
|
+
* The endpoint may change or be removed at any time without notice.
|
|
192
|
+
*
|
|
193
|
+
* @param credentials - Private API credentials
|
|
194
|
+
* @param request - Unarchive test cases request
|
|
195
|
+
* @param request.projectId - Jira project ID (numeric, not the project key)
|
|
196
|
+
* @param request.testCaseIds - Array of test case IDs to unarchive
|
|
197
|
+
* @throws {BadRequestError} If the request is invalid
|
|
198
|
+
* @throws {UnauthorizedError} If authentication fails
|
|
199
|
+
* @throws {ForbiddenError} If the user doesn't have permission
|
|
200
|
+
* @throws {ServerError} If the server returns an error
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* ```typescript
|
|
204
|
+
* // Unarchive a single test case
|
|
205
|
+
* await api.Private.TestCaseArchiving.unarchiveTestCases(credentials, {
|
|
206
|
+
* projectId: 10316,
|
|
207
|
+
* testCaseIds: [288004503]
|
|
208
|
+
* });
|
|
209
|
+
*
|
|
210
|
+
* // Unarchive multiple test cases
|
|
211
|
+
* await api.Private.TestCaseArchiving.unarchiveTestCases(credentials, {
|
|
212
|
+
* projectId: 10316,
|
|
213
|
+
* testCaseIds: [288004503, 288004504, 288004505]
|
|
214
|
+
* });
|
|
215
|
+
* ```
|
|
216
|
+
*/
|
|
217
|
+
async unarchiveTestCases(credentials, request) {
|
|
218
|
+
// Get Context JWT
|
|
219
|
+
const contextJwt = await this.getContextJwt(credentials);
|
|
220
|
+
// Validate input
|
|
221
|
+
if (!request.testCaseIds || request.testCaseIds.length === 0) {
|
|
222
|
+
throw new BadRequestError('At least one test case ID is required for unarchiving.');
|
|
223
|
+
}
|
|
224
|
+
const url = `${this.privateApiBaseUrl}/testcase/bulk/unarchive`;
|
|
225
|
+
const headers = {
|
|
226
|
+
'Content-Type': 'application/json',
|
|
227
|
+
accept: 'application/json',
|
|
228
|
+
authorization: `JWT ${contextJwt}`,
|
|
229
|
+
'jira-project-id': String(request.projectId),
|
|
230
|
+
};
|
|
231
|
+
// Body is an array of test case IDs
|
|
232
|
+
const body = JSON.stringify(request.testCaseIds);
|
|
233
|
+
try {
|
|
234
|
+
const response = await fetch(url, {
|
|
235
|
+
method: 'POST',
|
|
236
|
+
headers,
|
|
237
|
+
body,
|
|
238
|
+
});
|
|
239
|
+
if (!response.ok) {
|
|
240
|
+
if (response.status === 400) {
|
|
241
|
+
throw new BadRequestError(`Invalid request parameters for unarchiving test cases.`);
|
|
242
|
+
}
|
|
243
|
+
if (response.status === 401) {
|
|
244
|
+
throw new UnauthorizedError('Failed to authenticate. Please check your credentials.');
|
|
245
|
+
}
|
|
246
|
+
if (response.status === 403) {
|
|
247
|
+
throw new ForbiddenError('Insufficient permissions to unarchive test cases.');
|
|
248
|
+
}
|
|
249
|
+
throw new ServerError(`Failed to unarchive test cases. Status: ${response.status}`, response.status, response.statusText);
|
|
250
|
+
}
|
|
251
|
+
// Response is empty on success
|
|
252
|
+
}
|
|
253
|
+
catch (error) {
|
|
254
|
+
if (error instanceof BadRequestError ||
|
|
255
|
+
error instanceof UnauthorizedError ||
|
|
256
|
+
error instanceof ForbiddenError ||
|
|
257
|
+
error instanceof NotFoundError ||
|
|
258
|
+
error instanceof ServerError ||
|
|
259
|
+
error instanceof UnexpectedError) {
|
|
260
|
+
throw error;
|
|
261
|
+
}
|
|
262
|
+
throw new UnexpectedError(`Unexpected error while unarchiving test cases for project ${request.projectId}`, error);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
package/dist/groups/Private.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ import { PrivateVersions } from './Private/PrivateVersions';
|
|
|
9
9
|
import { PrivateAttachments } from './Private/PrivateAttachments';
|
|
10
10
|
import { PrivateAuthentication } from './Private/PrivateAuthentication';
|
|
11
11
|
import { PrivateVersionControl } from './Private/PrivateVersionControl';
|
|
12
|
+
import { PrivateExtendedData } from './Private/PrivateExtendedData';
|
|
13
|
+
import { PrivateTestCaseArchiving } from './Private/PrivateTestCaseArchiving';
|
|
12
14
|
/**
|
|
13
15
|
* Private API group for accessing Zephyr's private/unofficial endpoints
|
|
14
16
|
*
|
|
@@ -40,6 +42,16 @@ export declare class PrivateGroup extends PrivateBase {
|
|
|
40
42
|
* Version Control sub-group - Get version-specific data (links, test script, test steps)
|
|
41
43
|
*/
|
|
42
44
|
readonly VersionControl: PrivateVersionControl;
|
|
45
|
+
/**
|
|
46
|
+
* Extended Data sub-group - Get and set extended data (iterations, versions) for Test Cycles and Test Executions
|
|
47
|
+
* Supplements public API with extended data not available in public endpoints
|
|
48
|
+
*/
|
|
49
|
+
readonly ExtendedData: PrivateExtendedData;
|
|
50
|
+
/**
|
|
51
|
+
* Test Case Archiving sub-group - List, archive, and unarchive test cases
|
|
52
|
+
* Provides access to archived test cases and archiving operations not available in public API
|
|
53
|
+
*/
|
|
54
|
+
readonly TestCaseArchiving: PrivateTestCaseArchiving;
|
|
43
55
|
constructor(apiConnection?: ZephyrApiConnection);
|
|
44
56
|
}
|
|
45
57
|
//# sourceMappingURL=Private.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Private.d.ts","sourceRoot":"","sources":["../../groups/Private.ts"],"names":[],"mappings":"AAAA;;GAEG;AAyDH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC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+8,8 @@ import { PrivateVersions } from './Private/PrivateVersions';
|
|
|
8
8
|
import { PrivateAttachments } from './Private/PrivateAttachments';
|
|
9
9
|
import { PrivateAuthentication } from './Private/PrivateAuthentication';
|
|
10
10
|
import { PrivateVersionControl } from './Private/PrivateVersionControl';
|
|
11
|
+
import { PrivateExtendedData } from './Private/PrivateExtendedData';
|
|
12
|
+
import { PrivateTestCaseArchiving } from './Private/PrivateTestCaseArchiving';
|
|
11
13
|
/**
|
|
12
14
|
* Private API group for accessing Zephyr's private/unofficial endpoints
|
|
13
15
|
*
|
|
@@ -23,5 +25,7 @@ export class PrivateGroup extends PrivateBase {
|
|
|
23
25
|
this.Versions = new PrivateVersions(apiConnection);
|
|
24
26
|
this.Attachments = new PrivateAttachments(apiConnection);
|
|
25
27
|
this.VersionControl = new PrivateVersionControl(apiConnection);
|
|
28
|
+
this.ExtendedData = new PrivateExtendedData(apiConnection);
|
|
29
|
+
this.TestCaseArchiving = new PrivateTestCaseArchiving(apiConnection);
|
|
26
30
|
}
|
|
27
31
|
}
|
|
@@ -68,6 +68,8 @@ export declare class TestExecutionGroup {
|
|
|
68
68
|
* Creates a new test execution for a test case within a test cycle. Required fields include projectKey, testCaseKey, testCycleKey, and statusName.
|
|
69
69
|
* Optional fields include environmentName, actualEndDate, executionTime, executedById, assignedToId, comment, and customFields.
|
|
70
70
|
*
|
|
71
|
+
* Note: This API returns an empty response. To get the created test execution details, use listTestExecutions() or getTestExecution().
|
|
72
|
+
*
|
|
71
73
|
* @param request - Create test execution request
|
|
72
74
|
* @param request.body - Test execution data
|
|
73
75
|
* @param request.body.projectKey - Jira project key (required)
|
|
@@ -81,11 +83,11 @@ export declare class TestExecutionGroup {
|
|
|
81
83
|
* @param request.body.assignedToId - Account ID of user assigned to the test (optional)
|
|
82
84
|
* @param request.body.comment - Comment added against overall test case execution (optional)
|
|
83
85
|
* @param request.body.customFields - Custom field values (optional)
|
|
84
|
-
* @returns
|
|
86
|
+
* @returns Promise that resolves when creation is complete
|
|
85
87
|
*
|
|
86
88
|
* @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Executions/operation/createTestExecution Official API Documentation}
|
|
87
89
|
*/
|
|
88
|
-
createTestExecution(request: CreateTestExecutionRequest): Promise<
|
|
90
|
+
createTestExecution(request: CreateTestExecutionRequest): Promise<void>;
|
|
89
91
|
/**
|
|
90
92
|
* Update a test execution
|
|
91
93
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestExecution.d.ts","sourceRoot":"","sources":["../../groups/TestExecution.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AAEH,OAAO,KAAK,EACX,aAAa,EACb,iBAAiB,EACjB,4BAA4B,EAC5B,yBAAyB,EACzB,gCAAgC,EAChC,uBAAuB,EACvB,0BAA0B,EAC1B,0BAA0B,EAC1B,gCAAgC,EAChC,gCAAgC,EAChC,8BAA8B,EAC9B,mCAAmC,EACnC,qBAAqB,EACrB,0BAA0B,EAC1B,IAAI,EACJ,eAAe,EACf,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,qBAAa,kBAAkB;IAClB,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,mBAAmB;IAE5C;;;;;;;;;;;;;;;;;;OAkBG;IACG,kBAAkB,CAAC,OAAO,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAMzF;;;;;;;;;;;;;;;;;OAiBG;IACG,yBAAyB,CAAC,OAAO,CAAC,EAAE,gCAAgC,GAAG,OAAO,CAAC,4BAA4B,CAAC;IAMlH;;;;;;;;;;;OAWG;IACG,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,aAAa,CAAC;IAUhF
|
|
1
|
+
{"version":3,"file":"TestExecution.d.ts","sourceRoot":"","sources":["../../groups/TestExecution.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;G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;IAOrF;;;;;;;;;OASG;IACG,sBAAsB,CAAC,oBAAoB,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAKnG;;;;;;;;;;;;;OAaG;IACG,4BAA4B,CAAC,OAAO,EAAE,mCAAmC,GAAG,OAAO,CAAC,eAAe,CAAC;CAQ1G"}
|
|
@@ -80,6 +80,8 @@ export class TestExecutionGroup {
|
|
|
80
80
|
* Creates a new test execution for a test case within a test cycle. Required fields include projectKey, testCaseKey, testCycleKey, and statusName.
|
|
81
81
|
* Optional fields include environmentName, actualEndDate, executionTime, executedById, assignedToId, comment, and customFields.
|
|
82
82
|
*
|
|
83
|
+
* Note: This API returns an empty response. To get the created test execution details, use listTestExecutions() or getTestExecution().
|
|
84
|
+
*
|
|
83
85
|
* @param request - Create test execution request
|
|
84
86
|
* @param request.body - Test execution data
|
|
85
87
|
* @param request.body.projectKey - Jira project key (required)
|
|
@@ -93,7 +95,7 @@ export class TestExecutionGroup {
|
|
|
93
95
|
* @param request.body.assignedToId - Account ID of user assigned to the test (optional)
|
|
94
96
|
* @param request.body.comment - Comment added against overall test case execution (optional)
|
|
95
97
|
* @param request.body.customFields - Custom field values (optional)
|
|
96
|
-
* @returns
|
|
98
|
+
* @returns Promise that resolves when creation is complete
|
|
97
99
|
*
|
|
98
100
|
* @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Executions/operation/createTestExecution Official API Documentation}
|
|
99
101
|
*/
|
|
@@ -103,7 +105,9 @@ export class TestExecutionGroup {
|
|
|
103
105
|
headers: { 'Content-Type': 'application/json' },
|
|
104
106
|
body: buildRequestBody(request.body),
|
|
105
107
|
});
|
|
106
|
-
|
|
108
|
+
if (!response.ok) {
|
|
109
|
+
await parseResponse(response);
|
|
110
|
+
}
|
|
107
111
|
}
|
|
108
112
|
/**
|
|
109
113
|
* Update a test execution
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rbaileysr/zephyr-managed-api",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.8",
|
|
4
4
|
"description": "Managed API wrapper for Zephyr Cloud REST API v2 - Comprehensive type-safe access to all Zephyr API endpoints for ScriptRunner Connect",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -43,4 +43,3 @@
|
|
|
43
43
|
"README.md"
|
|
44
44
|
]
|
|
45
45
|
}
|
|
46
|
-
|
package/dist/types.d.ts
CHANGED
|
@@ -1967,17 +1967,17 @@ export interface GetDataSetsRequest {
|
|
|
1967
1967
|
/**
|
|
1968
1968
|
* Config type for archive/unarchive operations
|
|
1969
1969
|
*/
|
|
1970
|
-
export type ConfigType = 'Environment' | 'Iteration';
|
|
1970
|
+
export type ConfigType = 'Environment' | 'Iteration' | 'TestCaseStatus' | 'TestPlanStatus' | 'TestCycleStatus' | 'TestExecutionStatus';
|
|
1971
1971
|
/**
|
|
1972
1972
|
* Archive config request for private API
|
|
1973
1973
|
*/
|
|
1974
1974
|
export interface ArchiveConfigRequest {
|
|
1975
1975
|
/**
|
|
1976
|
-
* Type of config item: 'Environment' or '
|
|
1976
|
+
* Type of config item: 'Environment', 'Iteration', 'TestCaseStatus', 'TestPlanStatus', 'TestCycleStatus', or 'TestExecutionStatus'
|
|
1977
1977
|
*/
|
|
1978
1978
|
type: ConfigType;
|
|
1979
1979
|
/**
|
|
1980
|
-
* Numeric ID of the
|
|
1980
|
+
* Numeric ID of the config item to archive/unarchive
|
|
1981
1981
|
*/
|
|
1982
1982
|
id: number;
|
|
1983
1983
|
/**
|
|
@@ -2078,4 +2078,264 @@ export interface TestExecutionStepIssueLink {
|
|
|
2078
2078
|
* Test execution step issue link list
|
|
2079
2079
|
*/
|
|
2080
2080
|
export type TestExecutionStepIssueLinkList = TestExecutionStepIssueLink[];
|
|
2081
|
+
/**
|
|
2082
|
+
* Get test cycle iteration request for private API
|
|
2083
|
+
* Supplements public getTestCycle() with iteration data
|
|
2084
|
+
*/
|
|
2085
|
+
export interface GetTestCycleIterationRequest {
|
|
2086
|
+
/**
|
|
2087
|
+
* Test cycle key (e.g., "M12-R1")
|
|
2088
|
+
*/
|
|
2089
|
+
testCycleKey: string;
|
|
2090
|
+
/**
|
|
2091
|
+
* Jira project ID (numeric, not the project key)
|
|
2092
|
+
*/
|
|
2093
|
+
projectId: number;
|
|
2094
|
+
}
|
|
2095
|
+
/**
|
|
2096
|
+
* Test cycle iteration response from private API
|
|
2097
|
+
*/
|
|
2098
|
+
export interface TestCycleIterationResponse {
|
|
2099
|
+
/**
|
|
2100
|
+
* Numeric ID of the test cycle
|
|
2101
|
+
*/
|
|
2102
|
+
id: number;
|
|
2103
|
+
/**
|
|
2104
|
+
* Test cycle key (e.g., "M12-R1")
|
|
2105
|
+
*/
|
|
2106
|
+
key: string;
|
|
2107
|
+
/**
|
|
2108
|
+
* Iteration ID if set, null if not set
|
|
2109
|
+
*/
|
|
2110
|
+
iterationId: number | null;
|
|
2111
|
+
}
|
|
2112
|
+
/**
|
|
2113
|
+
* Update test cycle iteration request for private API
|
|
2114
|
+
* Supplements public updateTestCycle() with iteration data
|
|
2115
|
+
*/
|
|
2116
|
+
export interface UpdateTestCycleIterationRequest {
|
|
2117
|
+
/**
|
|
2118
|
+
* Test cycle key (e.g., "M12-R1")
|
|
2119
|
+
*/
|
|
2120
|
+
testCycleKey: string;
|
|
2121
|
+
/**
|
|
2122
|
+
* Jira project ID (numeric, not the project key)
|
|
2123
|
+
*/
|
|
2124
|
+
projectId: number;
|
|
2125
|
+
/**
|
|
2126
|
+
* Iteration ID to set, or null to clear the iteration
|
|
2127
|
+
*/
|
|
2128
|
+
iterationId: number | null;
|
|
2129
|
+
}
|
|
2130
|
+
/**
|
|
2131
|
+
* Get test execution iteration request for private API
|
|
2132
|
+
* Supplements public getTestExecution() with iteration data
|
|
2133
|
+
*/
|
|
2134
|
+
export interface GetTestExecutionIterationRequest {
|
|
2135
|
+
/**
|
|
2136
|
+
* Test execution key (e.g., "M12-E1")
|
|
2137
|
+
*/
|
|
2138
|
+
testExecutionKey: string;
|
|
2139
|
+
/**
|
|
2140
|
+
* Jira project ID (numeric, not the project key)
|
|
2141
|
+
*/
|
|
2142
|
+
projectId: number;
|
|
2143
|
+
}
|
|
2144
|
+
/**
|
|
2145
|
+
* Test execution iteration response from private API
|
|
2146
|
+
*/
|
|
2147
|
+
export interface TestExecutionIterationResponse {
|
|
2148
|
+
/**
|
|
2149
|
+
* Numeric ID of the test execution
|
|
2150
|
+
*/
|
|
2151
|
+
id: number;
|
|
2152
|
+
/**
|
|
2153
|
+
* Test execution key (e.g., "M12-E1")
|
|
2154
|
+
*/
|
|
2155
|
+
key: string;
|
|
2156
|
+
/**
|
|
2157
|
+
* Iteration ID if set, null if not set
|
|
2158
|
+
*/
|
|
2159
|
+
iterationId: number | null;
|
|
2160
|
+
}
|
|
2161
|
+
/**
|
|
2162
|
+
* Update test execution iteration request for private API
|
|
2163
|
+
* Supplements public updateTestExecution() with iteration data
|
|
2164
|
+
*/
|
|
2165
|
+
export interface UpdateTestExecutionIterationRequest {
|
|
2166
|
+
/**
|
|
2167
|
+
* Test execution key (e.g., "M12-E1")
|
|
2168
|
+
*/
|
|
2169
|
+
testExecutionKey: string;
|
|
2170
|
+
/**
|
|
2171
|
+
* Jira project ID (numeric, not the project key)
|
|
2172
|
+
*/
|
|
2173
|
+
projectId: number;
|
|
2174
|
+
/**
|
|
2175
|
+
* Iteration ID to set, or null to clear the iteration
|
|
2176
|
+
*/
|
|
2177
|
+
iterationId: number | null;
|
|
2178
|
+
}
|
|
2179
|
+
/**
|
|
2180
|
+
* Get test execution version request for private API
|
|
2181
|
+
* Supplements public getTestExecution() with version data
|
|
2182
|
+
*/
|
|
2183
|
+
export interface GetTestExecutionVersionRequest {
|
|
2184
|
+
/**
|
|
2185
|
+
* Test execution key (e.g., "M12-E1")
|
|
2186
|
+
*/
|
|
2187
|
+
testExecutionKey: string;
|
|
2188
|
+
/**
|
|
2189
|
+
* Jira project ID (numeric, not the project key)
|
|
2190
|
+
*/
|
|
2191
|
+
projectId: number;
|
|
2192
|
+
}
|
|
2193
|
+
/**
|
|
2194
|
+
* Test execution version response from private API
|
|
2195
|
+
*/
|
|
2196
|
+
export interface TestExecutionVersionResponse {
|
|
2197
|
+
/**
|
|
2198
|
+
* Numeric ID of the test execution
|
|
2199
|
+
*/
|
|
2200
|
+
id: number;
|
|
2201
|
+
/**
|
|
2202
|
+
* Test execution key (e.g., "M12-E1")
|
|
2203
|
+
*/
|
|
2204
|
+
key: string;
|
|
2205
|
+
/**
|
|
2206
|
+
* Jira version ID (release version) if set, null if not set
|
|
2207
|
+
*/
|
|
2208
|
+
jiraVersionId: number | null;
|
|
2209
|
+
}
|
|
2210
|
+
/**
|
|
2211
|
+
* Update test execution version request for private API
|
|
2212
|
+
* Supplements public updateTestExecution() with version data
|
|
2213
|
+
*/
|
|
2214
|
+
export interface UpdateTestExecutionVersionRequest {
|
|
2215
|
+
/**
|
|
2216
|
+
* Test execution key (e.g., "M12-E1")
|
|
2217
|
+
*/
|
|
2218
|
+
testExecutionKey: string;
|
|
2219
|
+
/**
|
|
2220
|
+
* Jira project ID (numeric, not the project key)
|
|
2221
|
+
*/
|
|
2222
|
+
projectId: number;
|
|
2223
|
+
/**
|
|
2224
|
+
* Jira version ID to set, or null to clear the version
|
|
2225
|
+
*/
|
|
2226
|
+
jiraVersionId: number | null;
|
|
2227
|
+
}
|
|
2228
|
+
/**
|
|
2229
|
+
* Private API archived test case status
|
|
2230
|
+
*/
|
|
2231
|
+
export interface PrivateArchivedTestCaseStatus {
|
|
2232
|
+
id: number;
|
|
2233
|
+
name: string;
|
|
2234
|
+
color: string;
|
|
2235
|
+
}
|
|
2236
|
+
/**
|
|
2237
|
+
* Private API archived test case priority
|
|
2238
|
+
*/
|
|
2239
|
+
export interface PrivateArchivedTestCasePriority {
|
|
2240
|
+
id: number;
|
|
2241
|
+
name: string;
|
|
2242
|
+
color: string;
|
|
2243
|
+
}
|
|
2244
|
+
/**
|
|
2245
|
+
* Private API archived test case last test result status
|
|
2246
|
+
*/
|
|
2247
|
+
export interface PrivateArchivedTestCaseLastTestResultStatus {
|
|
2248
|
+
name: string;
|
|
2249
|
+
color: string;
|
|
2250
|
+
}
|
|
2251
|
+
/**
|
|
2252
|
+
* Private API archived test case custom field value
|
|
2253
|
+
*/
|
|
2254
|
+
export interface PrivateArchivedTestCaseCustomFieldValue {
|
|
2255
|
+
customFieldId: number;
|
|
2256
|
+
stringValue?: string;
|
|
2257
|
+
intValue?: number;
|
|
2258
|
+
decimalValue?: number;
|
|
2259
|
+
booleanValue?: boolean;
|
|
2260
|
+
dateValue?: string;
|
|
2261
|
+
}
|
|
2262
|
+
/**
|
|
2263
|
+
* Private API archived test case (from search endpoint)
|
|
2264
|
+
*/
|
|
2265
|
+
export interface PrivateArchivedTestCase {
|
|
2266
|
+
id: number;
|
|
2267
|
+
key: string;
|
|
2268
|
+
projectId: number;
|
|
2269
|
+
name: string;
|
|
2270
|
+
majorVersion: number;
|
|
2271
|
+
owner?: string;
|
|
2272
|
+
componentId?: string;
|
|
2273
|
+
estimatedTime?: number;
|
|
2274
|
+
createdBy: string;
|
|
2275
|
+
createdOn: string;
|
|
2276
|
+
updatedOn?: string;
|
|
2277
|
+
updatedBy?: string;
|
|
2278
|
+
status?: PrivateArchivedTestCaseStatus;
|
|
2279
|
+
priority?: PrivateArchivedTestCasePriority;
|
|
2280
|
+
labels?: string[];
|
|
2281
|
+
lastTestResultStatus?: PrivateArchivedTestCaseLastTestResultStatus;
|
|
2282
|
+
customFieldValues?: PrivateArchivedTestCaseCustomFieldValue[];
|
|
2283
|
+
}
|
|
2284
|
+
/**
|
|
2285
|
+
* Private API archived test case search response
|
|
2286
|
+
*/
|
|
2287
|
+
export interface PrivateArchivedTestCaseSearchResponse {
|
|
2288
|
+
maxResults: number;
|
|
2289
|
+
startAt: number;
|
|
2290
|
+
total: number;
|
|
2291
|
+
results: PrivateArchivedTestCase[];
|
|
2292
|
+
}
|
|
2293
|
+
/**
|
|
2294
|
+
* Get archived test cases request for private API
|
|
2295
|
+
*/
|
|
2296
|
+
export interface GetArchivedTestCasesRequest {
|
|
2297
|
+
/**
|
|
2298
|
+
* Jira project ID (numeric, not the project key)
|
|
2299
|
+
*/
|
|
2300
|
+
projectId: number;
|
|
2301
|
+
/**
|
|
2302
|
+
* Maximum number of results to return (default: 50)
|
|
2303
|
+
*/
|
|
2304
|
+
maxResults?: number;
|
|
2305
|
+
/**
|
|
2306
|
+
* Zero-indexed starting position (default: 0)
|
|
2307
|
+
*/
|
|
2308
|
+
startAt?: number;
|
|
2309
|
+
/**
|
|
2310
|
+
* Optional query string for filtering (e.g., "testCase.name CONTAINS 'test'")
|
|
2311
|
+
* If not provided, defaults to ordering by name ASC
|
|
2312
|
+
*/
|
|
2313
|
+
query?: string;
|
|
2314
|
+
}
|
|
2315
|
+
/**
|
|
2316
|
+
* Archive test cases request for private API
|
|
2317
|
+
*/
|
|
2318
|
+
export interface ArchiveTestCasesRequest {
|
|
2319
|
+
/**
|
|
2320
|
+
* Jira project ID (numeric, not the project key)
|
|
2321
|
+
*/
|
|
2322
|
+
projectId: number;
|
|
2323
|
+
/**
|
|
2324
|
+
* Array of test case IDs to archive
|
|
2325
|
+
*/
|
|
2326
|
+
testCaseIds: number[];
|
|
2327
|
+
}
|
|
2328
|
+
/**
|
|
2329
|
+
* Unarchive test cases request for private API
|
|
2330
|
+
*/
|
|
2331
|
+
export interface UnarchiveTestCasesRequest {
|
|
2332
|
+
/**
|
|
2333
|
+
* Jira project ID (numeric, not the project key)
|
|
2334
|
+
*/
|
|
2335
|
+
projectId: number;
|
|
2336
|
+
/**
|
|
2337
|
+
* Array of test case IDs to unarchive
|
|
2338
|
+
*/
|
|
2339
|
+
testCaseIds: number[];
|
|
2340
|
+
}
|
|
2081
2341
|
//# sourceMappingURL=types.d.ts.map
|