@rbaileysr/zephyr-managed-api 1.3.9 → 1.3.11
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 +191 -4
- package/dist/README.md +191 -4
- package/dist/groups/Private/PrivateAuthentication.d.ts +42 -2
- package/dist/groups/Private/PrivateAuthentication.d.ts.map +1 -1
- package/dist/groups/Private/PrivateAuthentication.js +125 -0
- package/dist/groups/Private/PrivateTestExecutions.d.ts +174 -0
- package/dist/groups/Private/PrivateTestExecutions.d.ts.map +1 -0
- package/dist/groups/Private/PrivateTestExecutions.js +599 -0
- package/dist/groups/Private/PrivateTestScriptData.d.ts +152 -0
- package/dist/groups/Private/PrivateTestScriptData.d.ts.map +1 -0
- package/dist/groups/Private/PrivateTestScriptData.js +443 -0
- package/dist/groups/Private/PrivateVersionControl.d.ts +3 -4
- package/dist/groups/Private/PrivateVersionControl.d.ts.map +1 -1
- package/dist/groups/Private/PrivateVersionControl.js +53 -11
- 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/index.d.ts +40 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +179 -21
- package/dist/package.json +1 -1
- package/dist/types.d.ts +457 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,6 +22,9 @@ import { createZephyrApi } from '@rbaileysr/zephyr-managed-api';
|
|
|
22
22
|
|
|
23
23
|
// Base URL is configured in the Generic Connector
|
|
24
24
|
const api = createZephyrApi(ZephyrApiConnection);
|
|
25
|
+
|
|
26
|
+
// With verbose logging enabled (logs full request/response details on API failures)
|
|
27
|
+
const apiVerbose = createZephyrApi(ZephyrApiConnection, true);
|
|
25
28
|
```
|
|
26
29
|
|
|
27
30
|
**Using OAuth Token:**
|
|
@@ -34,13 +37,43 @@ const api = createZephyrApi(
|
|
|
34
37
|
'https://api.zephyrscale.smartbear.com/v2'
|
|
35
38
|
);
|
|
36
39
|
|
|
37
|
-
// EU region
|
|
40
|
+
// EU region with verbose logging
|
|
38
41
|
const apiEU = createZephyrApi(
|
|
39
42
|
'your-oauth-token',
|
|
40
|
-
'https://eu.api.zephyrscale.smartbear.com/v2'
|
|
43
|
+
'https://eu.api.zephyrscale.smartbear.com/v2',
|
|
44
|
+
true // Enable verbose logging
|
|
41
45
|
);
|
|
42
46
|
```
|
|
43
47
|
|
|
48
|
+
### Verbose Logging
|
|
49
|
+
|
|
50
|
+
When enabled, verbose logging automatically logs full request and response details whenever an API call fails. This is useful for debugging issues in production environments.
|
|
51
|
+
|
|
52
|
+
**Features:**
|
|
53
|
+
- Logs full request details (method, path, headers, body)
|
|
54
|
+
- Logs full response details (status, headers, body)
|
|
55
|
+
- Automatically sanitizes sensitive headers (authorization, API keys)
|
|
56
|
+
- Only logs on failures (not on successful requests)
|
|
57
|
+
- Includes descriptive messages about what operation was being attempted
|
|
58
|
+
|
|
59
|
+
**Example output when an API call fails:**
|
|
60
|
+
```
|
|
61
|
+
[Zephyr API Failure]
|
|
62
|
+
Operation: GET /testcases/PROJ-T1
|
|
63
|
+
Request Details: {
|
|
64
|
+
method: 'GET',
|
|
65
|
+
path: '/testcases/PROJ-T1',
|
|
66
|
+
headers: { 'content-type': 'application/json', authorization: '[REDACTED]' },
|
|
67
|
+
body: null
|
|
68
|
+
}
|
|
69
|
+
Response Details: {
|
|
70
|
+
status: 404,
|
|
71
|
+
statusText: 'Not Found',
|
|
72
|
+
headers: { 'content-type': 'application/json' },
|
|
73
|
+
body: { message: 'Test case not found' }
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
44
77
|
## Supported API calls
|
|
45
78
|
|
|
46
79
|
- [fetch](https://docs.adaptavist.com/src/managed-apis/managed-api-abstractions)
|
|
@@ -119,7 +152,7 @@ const apiEU = createZephyrApi(
|
|
|
119
152
|
- [createCucumberExecutions](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Automation/operation/createCucumberExecutions)
|
|
120
153
|
- [createJUnitExecutions](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Automation/operation/createJUnitExecutions)
|
|
121
154
|
- [retrieveBDDTestCases](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Automation/operation/retrieveBDDTestCases)
|
|
122
|
-
- **Private** ⚠️
|
|
155
|
+
- ### **Private** ⚠️
|
|
123
156
|
> **⚠️ WARNING: Private API Methods**
|
|
124
157
|
>
|
|
125
158
|
> The following methods use Zephyr's private/unofficial API endpoints that are:
|
|
@@ -131,6 +164,8 @@ const apiEU = createZephyrApi(
|
|
|
131
164
|
> Use these methods at your own risk. They may break with future Zephyr updates.
|
|
132
165
|
- ### Authentication
|
|
133
166
|
- **getContextJwt** - Get Jira Context JWT token (required for all private API calls)
|
|
167
|
+
- **enableZephyrForProject** - Enable Zephyr for a Jira project
|
|
168
|
+
- **isZephyrEnabledForProject** - Check if Zephyr is enabled for a Jira project
|
|
134
169
|
- ### Comments
|
|
135
170
|
- **Test Case**: `getTestCaseComments`, `createTestCaseComment`
|
|
136
171
|
- **Test Cycle**: `getTestCycleComments`, `createTestCycleComment`
|
|
@@ -159,6 +194,11 @@ const apiEU = createZephyrApi(
|
|
|
159
194
|
- **Test Execution**: `getTestExecutionIteration`, `updateTestExecutionIteration`, `getTestExecutionVersion`, `updateTestExecutionVersion`
|
|
160
195
|
- ### TestCaseArchiving (access archived test cases and archiving operations)
|
|
161
196
|
- **Test Case**: `getArchivedTestCases`, `archiveTestCases`, `unarchiveTestCases`
|
|
197
|
+
- ### TestScriptData (manage test script data: Parameters and Test Data)
|
|
198
|
+
- **Test Case**: `setTestCaseParamTypeToParameter`, `setTestCaseParameters`, `setTestCaseParamTypeToTestData`, `setTestCaseTestData`, `getTestCaseTestData`, `hasTestCaseTestData`
|
|
199
|
+
- ### TestExecutions (create and update test executions for test cases with test data)
|
|
200
|
+
- **Test Execution**: `createTestExecutionWithTestData`, `updateTestExecution`, `getTestExecutionSteps`, `updateTestExecutionStepStatus`, `updateTestExecutionStepComment`
|
|
201
|
+
- **Test Cycle**: `getTestCycleItems`
|
|
162
202
|
|
|
163
203
|
## Private API Authentication
|
|
164
204
|
|
|
@@ -183,6 +223,17 @@ const credentials = {
|
|
|
183
223
|
|
|
184
224
|
// Get Context JWT token
|
|
185
225
|
const contextJwt = await api.Private.Authentication.getContextJwt(credentials);
|
|
226
|
+
|
|
227
|
+
// Check if Zephyr is enabled for a project
|
|
228
|
+
const status = await api.Private.Authentication.isZephyrEnabledForProject(credentials, {
|
|
229
|
+
projectId: 10349
|
|
230
|
+
});
|
|
231
|
+
// Returns: { id: 10349, key: 'D1', permissionSystemEnabled: false, kanoahTestsEnabled: true, active: 1 }
|
|
232
|
+
|
|
233
|
+
// Enable Zephyr for a project
|
|
234
|
+
await api.Private.Authentication.enableZephyrForProject(credentials, {
|
|
235
|
+
projectId: 10349
|
|
236
|
+
});
|
|
186
237
|
```
|
|
187
238
|
|
|
188
239
|
### Example: Config Operations
|
|
@@ -309,9 +360,9 @@ await api.Private.VersionControl.createTestExecutionStepIssueLink(credentials, {
|
|
|
309
360
|
testExecutionKey: 'PROJ-E1',
|
|
310
361
|
stepIndex: 0,
|
|
311
362
|
issueId: 66019,
|
|
312
|
-
type: 'RELATED',
|
|
313
363
|
projectId: 10233
|
|
314
364
|
});
|
|
365
|
+
// Note: Link type is always 'RELATED' (typeId 3) - the API does not support choosing link types
|
|
315
366
|
```
|
|
316
367
|
|
|
317
368
|
### Example: Extended Data (Supplements Public API)
|
|
@@ -387,6 +438,119 @@ await api.Private.TestCaseArchiving.unarchiveTestCases(credentials, {
|
|
|
387
438
|
});
|
|
388
439
|
```
|
|
389
440
|
|
|
441
|
+
### Test Script Data
|
|
442
|
+
|
|
443
|
+
The public API does not expose test script data (Parameters and Test Data). Use `TestScriptData` to manage this data.
|
|
444
|
+
|
|
445
|
+
```typescript
|
|
446
|
+
// Check if test case has test script data
|
|
447
|
+
const hasData = await api.Private.TestScriptData.hasTestCaseTestData(credentials, {
|
|
448
|
+
testCaseKey: 'M14-T6',
|
|
449
|
+
projectId: 10315
|
|
450
|
+
});
|
|
451
|
+
// Returns: { hasData: true, type: 'PARAMETER' } or { hasData: false, type: null }
|
|
452
|
+
|
|
453
|
+
// Get test script data
|
|
454
|
+
const testData = await api.Private.TestScriptData.getTestCaseTestData(credentials, {
|
|
455
|
+
testCaseKey: 'M14-T6',
|
|
456
|
+
projectId: 10315
|
|
457
|
+
});
|
|
458
|
+
// Returns: { paramType: 'PARAMETER' | 'TEST_DATA' | null, parameters: [...], testData: [...] }
|
|
459
|
+
|
|
460
|
+
// Set test case to use Parameters
|
|
461
|
+
await api.Private.TestScriptData.setTestCaseParamTypeToParameter(credentials, {
|
|
462
|
+
testCaseKey: 'M14-T6',
|
|
463
|
+
projectId: 10315
|
|
464
|
+
});
|
|
465
|
+
|
|
466
|
+
// Set parameters
|
|
467
|
+
await api.Private.TestScriptData.setTestCaseParameters(credentials, {
|
|
468
|
+
testCaseKey: 'M14-T6',
|
|
469
|
+
projectId: 10315,
|
|
470
|
+
parameters: [
|
|
471
|
+
{ index: 0, name: 'param1', defaultValue: 'value1' },
|
|
472
|
+
{ index: 1, name: 'param2', defaultValue: 'value2' }
|
|
473
|
+
]
|
|
474
|
+
});
|
|
475
|
+
|
|
476
|
+
// Set test case to use Test Data
|
|
477
|
+
await api.Private.TestScriptData.setTestCaseParamTypeToTestData(credentials, {
|
|
478
|
+
testCaseKey: 'M14-T6',
|
|
479
|
+
projectId: 10315
|
|
480
|
+
});
|
|
481
|
+
|
|
482
|
+
// Set test data (simplified array format)
|
|
483
|
+
await api.Private.TestScriptData.setTestCaseTestData(credentials, {
|
|
484
|
+
testCaseKey: 'M14-T6',
|
|
485
|
+
projectId: 10315,
|
|
486
|
+
testData: [
|
|
487
|
+
// Row 1
|
|
488
|
+
[
|
|
489
|
+
{ columnName: 'Dataset Column', type: 'data_set', index: 0, dataSetItemId: 936037 },
|
|
490
|
+
{ columnName: 'Custom Column', type: 'free_text_input', index: 1, value: 'test value' }
|
|
491
|
+
]
|
|
492
|
+
]
|
|
493
|
+
});
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
### Test Executions with Test Data
|
|
497
|
+
|
|
498
|
+
The public API does not correctly handle creating test executions for test cases with test data or test cases with "Call to Test" steps that reference test cases with test data. Use `TestExecutions` to create and update these executions.
|
|
499
|
+
|
|
500
|
+
```typescript
|
|
501
|
+
// Create test execution for test case with test data
|
|
502
|
+
// This automatically handles the two-step process:
|
|
503
|
+
// 1. Creates execution via public API
|
|
504
|
+
// 2. Gets testRunItemId from private API
|
|
505
|
+
// 3. Creates actual execution via private API
|
|
506
|
+
const execution = await api.Private.TestExecutions.createTestExecutionWithTestData(credentials, {
|
|
507
|
+
testCaseKey: 'M14-T6',
|
|
508
|
+
testCycleKey: 'M14-R1',
|
|
509
|
+
assignedTo: '5d259f2e0b81c60c239bed83', // optional
|
|
510
|
+
projectId: 10315
|
|
511
|
+
});
|
|
512
|
+
// Returns: { id: 2065132733, key: 'M14-E18' }
|
|
513
|
+
|
|
514
|
+
// Get test cycle items (to find testRunItemId for a test case)
|
|
515
|
+
const items = await api.Private.TestExecutions.getTestCycleItems(credentials, {
|
|
516
|
+
testCycleKey: 'M14-R1',
|
|
517
|
+
projectId: 10315
|
|
518
|
+
});
|
|
519
|
+
|
|
520
|
+
// Update parent test execution
|
|
521
|
+
await api.Private.TestExecutions.updateTestExecution(credentials, {
|
|
522
|
+
testExecutionKey: 'M14-E18',
|
|
523
|
+
id: 2065132733, // Optional if testExecutionKey is provided
|
|
524
|
+
actualStartDate: '2025-12-24T13:02:50.233Z',
|
|
525
|
+
executionDate: '2025-12-24T13:02:50.233Z',
|
|
526
|
+
executionTime: 0,
|
|
527
|
+
testResultStatusId: 10952941,
|
|
528
|
+
projectId: 10315
|
|
529
|
+
});
|
|
530
|
+
|
|
531
|
+
// Get test execution steps (to get step IDs for updates)
|
|
532
|
+
const steps = await api.Private.TestExecutions.getTestExecutionSteps(credentials, {
|
|
533
|
+
testCycleKey: 'M14-R1',
|
|
534
|
+
testRunItemId: 1443476310, // From getTestCycleItems
|
|
535
|
+
projectId: 10315
|
|
536
|
+
});
|
|
537
|
+
|
|
538
|
+
// Update test execution step status
|
|
539
|
+
await api.Private.TestExecutions.updateTestExecutionStepStatus(credentials, {
|
|
540
|
+
id: 6287896613, // From getTestExecutionSteps
|
|
541
|
+
testResultStatusId: 10952942,
|
|
542
|
+
executionDate: '2025-12-24T13:02:50.232Z',
|
|
543
|
+
projectId: 10315
|
|
544
|
+
});
|
|
545
|
+
|
|
546
|
+
// Update test execution step comment (actual result)
|
|
547
|
+
await api.Private.TestExecutions.updateTestExecutionStepComment(credentials, {
|
|
548
|
+
id: 6287896613, // From getTestExecutionSteps
|
|
549
|
+
comment: 'Test passed successfully',
|
|
550
|
+
projectId: 10315
|
|
551
|
+
});
|
|
552
|
+
```
|
|
553
|
+
|
|
390
554
|
**Notes:**
|
|
391
555
|
- Version numbers are absolute (1-based). Use `listTestCaseVersions()` to find available versions. If `version` is not provided, the latest version is used.
|
|
392
556
|
- Private API methods require `PrivateApiCredentials` (`userEmail`, `apiToken`, `jiraInstanceUrl`). Context JWT tokens expire after 15 minutes and are automatically retrieved internally.
|
|
@@ -398,6 +562,29 @@ Feel free to drop ideas, suggestions or improvements into our [Community hub](ht
|
|
|
398
562
|
|
|
399
563
|
## Changelog
|
|
400
564
|
|
|
565
|
+
### 1.3.11
|
|
566
|
+
|
|
567
|
+
- **Added**: Verbose logging option - Enable detailed request/response logging for failed API calls via `createZephyrApi(connection, true)` or `createZephyrApi(token, baseUrl, true)`
|
|
568
|
+
|
|
569
|
+
### 1.3.10
|
|
570
|
+
|
|
571
|
+
- **Added**: New `TestScriptData` sub-group under Private API for managing test script data (Parameters and Test Data)
|
|
572
|
+
- **Added**: `setTestCaseParamTypeToParameter()` - Set test case param type to Parameter
|
|
573
|
+
- **Added**: `setTestCaseParameters()` - Set parameters array for a test case
|
|
574
|
+
- **Added**: `setTestCaseParamTypeToTestData()` - Set test case param type to Test Data
|
|
575
|
+
- **Added**: `setTestCaseTestData()` - Set test data array for a test case (simplified array format)
|
|
576
|
+
- **Added**: `getTestCaseTestData()` - Get test script data (paramType, parameters, testData) for a test case
|
|
577
|
+
- **Added**: `hasTestCaseTestData()` - Check if test case has test script data (Parameters or Test Data)
|
|
578
|
+
- **Added**: New `TestExecutions` sub-group under Private API for creating and updating test executions for test cases with test data
|
|
579
|
+
- **Added**: `createTestExecutionWithTestData()` - Create test execution for test case with test data (handles full workflow automatically)
|
|
580
|
+
- **Added**: `getTestCycleItems()` - Get test cycle items (testRunItems) for a test cycle
|
|
581
|
+
- **Added**: `updateTestExecution()` - Update parent test execution information
|
|
582
|
+
- **Added**: `getTestExecutionSteps()` - Get test execution steps (returns only IDs and basic info needed for updates)
|
|
583
|
+
- **Added**: `updateTestExecutionStepStatus()` - Update test execution step status
|
|
584
|
+
- **Added**: `updateTestExecutionStepComment()` - Update test execution step comment (actual result)
|
|
585
|
+
- **Added**: `enableZephyrForProject()` - Enable Zephyr for a Jira project (under Authentication sub-group)
|
|
586
|
+
- **Added**: `isZephyrEnabledForProject()` - Check if Zephyr is enabled for a Jira project (under Authentication sub-group)
|
|
587
|
+
|
|
401
588
|
### 1.3.9
|
|
402
589
|
|
|
403
590
|
- **Changed**: Readme fixes
|
package/dist/README.md
CHANGED
|
@@ -22,6 +22,9 @@ import { createZephyrApi } from '@rbaileysr/zephyr-managed-api';
|
|
|
22
22
|
|
|
23
23
|
// Base URL is configured in the Generic Connector
|
|
24
24
|
const api = createZephyrApi(ZephyrApiConnection);
|
|
25
|
+
|
|
26
|
+
// With verbose logging enabled (logs full request/response details on API failures)
|
|
27
|
+
const apiVerbose = createZephyrApi(ZephyrApiConnection, true);
|
|
25
28
|
```
|
|
26
29
|
|
|
27
30
|
**Using OAuth Token:**
|
|
@@ -34,13 +37,43 @@ const api = createZephyrApi(
|
|
|
34
37
|
'https://api.zephyrscale.smartbear.com/v2'
|
|
35
38
|
);
|
|
36
39
|
|
|
37
|
-
// EU region
|
|
40
|
+
// EU region with verbose logging
|
|
38
41
|
const apiEU = createZephyrApi(
|
|
39
42
|
'your-oauth-token',
|
|
40
|
-
'https://eu.api.zephyrscale.smartbear.com/v2'
|
|
43
|
+
'https://eu.api.zephyrscale.smartbear.com/v2',
|
|
44
|
+
true // Enable verbose logging
|
|
41
45
|
);
|
|
42
46
|
```
|
|
43
47
|
|
|
48
|
+
### Verbose Logging
|
|
49
|
+
|
|
50
|
+
When enabled, verbose logging automatically logs full request and response details whenever an API call fails. This is useful for debugging issues in production environments.
|
|
51
|
+
|
|
52
|
+
**Features:**
|
|
53
|
+
- Logs full request details (method, path, headers, body)
|
|
54
|
+
- Logs full response details (status, headers, body)
|
|
55
|
+
- Automatically sanitizes sensitive headers (authorization, API keys)
|
|
56
|
+
- Only logs on failures (not on successful requests)
|
|
57
|
+
- Includes descriptive messages about what operation was being attempted
|
|
58
|
+
|
|
59
|
+
**Example output when an API call fails:**
|
|
60
|
+
```
|
|
61
|
+
[Zephyr API Failure]
|
|
62
|
+
Operation: GET /testcases/PROJ-T1
|
|
63
|
+
Request Details: {
|
|
64
|
+
method: 'GET',
|
|
65
|
+
path: '/testcases/PROJ-T1',
|
|
66
|
+
headers: { 'content-type': 'application/json', authorization: '[REDACTED]' },
|
|
67
|
+
body: null
|
|
68
|
+
}
|
|
69
|
+
Response Details: {
|
|
70
|
+
status: 404,
|
|
71
|
+
statusText: 'Not Found',
|
|
72
|
+
headers: { 'content-type': 'application/json' },
|
|
73
|
+
body: { message: 'Test case not found' }
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
44
77
|
## Supported API calls
|
|
45
78
|
|
|
46
79
|
- [fetch](https://docs.adaptavist.com/src/managed-apis/managed-api-abstractions)
|
|
@@ -119,7 +152,7 @@ const apiEU = createZephyrApi(
|
|
|
119
152
|
- [createCucumberExecutions](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Automation/operation/createCucumberExecutions)
|
|
120
153
|
- [createJUnitExecutions](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Automation/operation/createJUnitExecutions)
|
|
121
154
|
- [retrieveBDDTestCases](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Automation/operation/retrieveBDDTestCases)
|
|
122
|
-
- **Private** ⚠️
|
|
155
|
+
- ### **Private** ⚠️
|
|
123
156
|
> **⚠️ WARNING: Private API Methods**
|
|
124
157
|
>
|
|
125
158
|
> The following methods use Zephyr's private/unofficial API endpoints that are:
|
|
@@ -131,6 +164,8 @@ const apiEU = createZephyrApi(
|
|
|
131
164
|
> Use these methods at your own risk. They may break with future Zephyr updates.
|
|
132
165
|
- ### Authentication
|
|
133
166
|
- **getContextJwt** - Get Jira Context JWT token (required for all private API calls)
|
|
167
|
+
- **enableZephyrForProject** - Enable Zephyr for a Jira project
|
|
168
|
+
- **isZephyrEnabledForProject** - Check if Zephyr is enabled for a Jira project
|
|
134
169
|
- ### Comments
|
|
135
170
|
- **Test Case**: `getTestCaseComments`, `createTestCaseComment`
|
|
136
171
|
- **Test Cycle**: `getTestCycleComments`, `createTestCycleComment`
|
|
@@ -159,6 +194,11 @@ const apiEU = createZephyrApi(
|
|
|
159
194
|
- **Test Execution**: `getTestExecutionIteration`, `updateTestExecutionIteration`, `getTestExecutionVersion`, `updateTestExecutionVersion`
|
|
160
195
|
- ### TestCaseArchiving (access archived test cases and archiving operations)
|
|
161
196
|
- **Test Case**: `getArchivedTestCases`, `archiveTestCases`, `unarchiveTestCases`
|
|
197
|
+
- ### TestScriptData (manage test script data: Parameters and Test Data)
|
|
198
|
+
- **Test Case**: `setTestCaseParamTypeToParameter`, `setTestCaseParameters`, `setTestCaseParamTypeToTestData`, `setTestCaseTestData`, `getTestCaseTestData`, `hasTestCaseTestData`
|
|
199
|
+
- ### TestExecutions (create and update test executions for test cases with test data)
|
|
200
|
+
- **Test Execution**: `createTestExecutionWithTestData`, `updateTestExecution`, `getTestExecutionSteps`, `updateTestExecutionStepStatus`, `updateTestExecutionStepComment`
|
|
201
|
+
- **Test Cycle**: `getTestCycleItems`
|
|
162
202
|
|
|
163
203
|
## Private API Authentication
|
|
164
204
|
|
|
@@ -183,6 +223,17 @@ const credentials = {
|
|
|
183
223
|
|
|
184
224
|
// Get Context JWT token
|
|
185
225
|
const contextJwt = await api.Private.Authentication.getContextJwt(credentials);
|
|
226
|
+
|
|
227
|
+
// Check if Zephyr is enabled for a project
|
|
228
|
+
const status = await api.Private.Authentication.isZephyrEnabledForProject(credentials, {
|
|
229
|
+
projectId: 10349
|
|
230
|
+
});
|
|
231
|
+
// Returns: { id: 10349, key: 'D1', permissionSystemEnabled: false, kanoahTestsEnabled: true, active: 1 }
|
|
232
|
+
|
|
233
|
+
// Enable Zephyr for a project
|
|
234
|
+
await api.Private.Authentication.enableZephyrForProject(credentials, {
|
|
235
|
+
projectId: 10349
|
|
236
|
+
});
|
|
186
237
|
```
|
|
187
238
|
|
|
188
239
|
### Example: Config Operations
|
|
@@ -309,9 +360,9 @@ await api.Private.VersionControl.createTestExecutionStepIssueLink(credentials, {
|
|
|
309
360
|
testExecutionKey: 'PROJ-E1',
|
|
310
361
|
stepIndex: 0,
|
|
311
362
|
issueId: 66019,
|
|
312
|
-
type: 'RELATED',
|
|
313
363
|
projectId: 10233
|
|
314
364
|
});
|
|
365
|
+
// Note: Link type is always 'RELATED' (typeId 3) - the API does not support choosing link types
|
|
315
366
|
```
|
|
316
367
|
|
|
317
368
|
### Example: Extended Data (Supplements Public API)
|
|
@@ -387,6 +438,119 @@ await api.Private.TestCaseArchiving.unarchiveTestCases(credentials, {
|
|
|
387
438
|
});
|
|
388
439
|
```
|
|
389
440
|
|
|
441
|
+
### Test Script Data
|
|
442
|
+
|
|
443
|
+
The public API does not expose test script data (Parameters and Test Data). Use `TestScriptData` to manage this data.
|
|
444
|
+
|
|
445
|
+
```typescript
|
|
446
|
+
// Check if test case has test script data
|
|
447
|
+
const hasData = await api.Private.TestScriptData.hasTestCaseTestData(credentials, {
|
|
448
|
+
testCaseKey: 'M14-T6',
|
|
449
|
+
projectId: 10315
|
|
450
|
+
});
|
|
451
|
+
// Returns: { hasData: true, type: 'PARAMETER' } or { hasData: false, type: null }
|
|
452
|
+
|
|
453
|
+
// Get test script data
|
|
454
|
+
const testData = await api.Private.TestScriptData.getTestCaseTestData(credentials, {
|
|
455
|
+
testCaseKey: 'M14-T6',
|
|
456
|
+
projectId: 10315
|
|
457
|
+
});
|
|
458
|
+
// Returns: { paramType: 'PARAMETER' | 'TEST_DATA' | null, parameters: [...], testData: [...] }
|
|
459
|
+
|
|
460
|
+
// Set test case to use Parameters
|
|
461
|
+
await api.Private.TestScriptData.setTestCaseParamTypeToParameter(credentials, {
|
|
462
|
+
testCaseKey: 'M14-T6',
|
|
463
|
+
projectId: 10315
|
|
464
|
+
});
|
|
465
|
+
|
|
466
|
+
// Set parameters
|
|
467
|
+
await api.Private.TestScriptData.setTestCaseParameters(credentials, {
|
|
468
|
+
testCaseKey: 'M14-T6',
|
|
469
|
+
projectId: 10315,
|
|
470
|
+
parameters: [
|
|
471
|
+
{ index: 0, name: 'param1', defaultValue: 'value1' },
|
|
472
|
+
{ index: 1, name: 'param2', defaultValue: 'value2' }
|
|
473
|
+
]
|
|
474
|
+
});
|
|
475
|
+
|
|
476
|
+
// Set test case to use Test Data
|
|
477
|
+
await api.Private.TestScriptData.setTestCaseParamTypeToTestData(credentials, {
|
|
478
|
+
testCaseKey: 'M14-T6',
|
|
479
|
+
projectId: 10315
|
|
480
|
+
});
|
|
481
|
+
|
|
482
|
+
// Set test data (simplified array format)
|
|
483
|
+
await api.Private.TestScriptData.setTestCaseTestData(credentials, {
|
|
484
|
+
testCaseKey: 'M14-T6',
|
|
485
|
+
projectId: 10315,
|
|
486
|
+
testData: [
|
|
487
|
+
// Row 1
|
|
488
|
+
[
|
|
489
|
+
{ columnName: 'Dataset Column', type: 'data_set', index: 0, dataSetItemId: 936037 },
|
|
490
|
+
{ columnName: 'Custom Column', type: 'free_text_input', index: 1, value: 'test value' }
|
|
491
|
+
]
|
|
492
|
+
]
|
|
493
|
+
});
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
### Test Executions with Test Data
|
|
497
|
+
|
|
498
|
+
The public API does not correctly handle creating test executions for test cases with test data or test cases with "Call to Test" steps that reference test cases with test data. Use `TestExecutions` to create and update these executions.
|
|
499
|
+
|
|
500
|
+
```typescript
|
|
501
|
+
// Create test execution for test case with test data
|
|
502
|
+
// This automatically handles the two-step process:
|
|
503
|
+
// 1. Creates execution via public API
|
|
504
|
+
// 2. Gets testRunItemId from private API
|
|
505
|
+
// 3. Creates actual execution via private API
|
|
506
|
+
const execution = await api.Private.TestExecutions.createTestExecutionWithTestData(credentials, {
|
|
507
|
+
testCaseKey: 'M14-T6',
|
|
508
|
+
testCycleKey: 'M14-R1',
|
|
509
|
+
assignedTo: '5d259f2e0b81c60c239bed83', // optional
|
|
510
|
+
projectId: 10315
|
|
511
|
+
});
|
|
512
|
+
// Returns: { id: 2065132733, key: 'M14-E18' }
|
|
513
|
+
|
|
514
|
+
// Get test cycle items (to find testRunItemId for a test case)
|
|
515
|
+
const items = await api.Private.TestExecutions.getTestCycleItems(credentials, {
|
|
516
|
+
testCycleKey: 'M14-R1',
|
|
517
|
+
projectId: 10315
|
|
518
|
+
});
|
|
519
|
+
|
|
520
|
+
// Update parent test execution
|
|
521
|
+
await api.Private.TestExecutions.updateTestExecution(credentials, {
|
|
522
|
+
testExecutionKey: 'M14-E18',
|
|
523
|
+
id: 2065132733, // Optional if testExecutionKey is provided
|
|
524
|
+
actualStartDate: '2025-12-24T13:02:50.233Z',
|
|
525
|
+
executionDate: '2025-12-24T13:02:50.233Z',
|
|
526
|
+
executionTime: 0,
|
|
527
|
+
testResultStatusId: 10952941,
|
|
528
|
+
projectId: 10315
|
|
529
|
+
});
|
|
530
|
+
|
|
531
|
+
// Get test execution steps (to get step IDs for updates)
|
|
532
|
+
const steps = await api.Private.TestExecutions.getTestExecutionSteps(credentials, {
|
|
533
|
+
testCycleKey: 'M14-R1',
|
|
534
|
+
testRunItemId: 1443476310, // From getTestCycleItems
|
|
535
|
+
projectId: 10315
|
|
536
|
+
});
|
|
537
|
+
|
|
538
|
+
// Update test execution step status
|
|
539
|
+
await api.Private.TestExecutions.updateTestExecutionStepStatus(credentials, {
|
|
540
|
+
id: 6287896613, // From getTestExecutionSteps
|
|
541
|
+
testResultStatusId: 10952942,
|
|
542
|
+
executionDate: '2025-12-24T13:02:50.232Z',
|
|
543
|
+
projectId: 10315
|
|
544
|
+
});
|
|
545
|
+
|
|
546
|
+
// Update test execution step comment (actual result)
|
|
547
|
+
await api.Private.TestExecutions.updateTestExecutionStepComment(credentials, {
|
|
548
|
+
id: 6287896613, // From getTestExecutionSteps
|
|
549
|
+
comment: 'Test passed successfully',
|
|
550
|
+
projectId: 10315
|
|
551
|
+
});
|
|
552
|
+
```
|
|
553
|
+
|
|
390
554
|
**Notes:**
|
|
391
555
|
- Version numbers are absolute (1-based). Use `listTestCaseVersions()` to find available versions. If `version` is not provided, the latest version is used.
|
|
392
556
|
- Private API methods require `PrivateApiCredentials` (`userEmail`, `apiToken`, `jiraInstanceUrl`). Context JWT tokens expire after 15 minutes and are automatically retrieved internally.
|
|
@@ -398,6 +562,29 @@ Feel free to drop ideas, suggestions or improvements into our [Community hub](ht
|
|
|
398
562
|
|
|
399
563
|
## Changelog
|
|
400
564
|
|
|
565
|
+
### 1.3.11
|
|
566
|
+
|
|
567
|
+
- **Added**: Verbose logging option - Enable detailed request/response logging for failed API calls via `createZephyrApi(connection, true)` or `createZephyrApi(token, baseUrl, true)`
|
|
568
|
+
|
|
569
|
+
### 1.3.10
|
|
570
|
+
|
|
571
|
+
- **Added**: New `TestScriptData` sub-group under Private API for managing test script data (Parameters and Test Data)
|
|
572
|
+
- **Added**: `setTestCaseParamTypeToParameter()` - Set test case param type to Parameter
|
|
573
|
+
- **Added**: `setTestCaseParameters()` - Set parameters array for a test case
|
|
574
|
+
- **Added**: `setTestCaseParamTypeToTestData()` - Set test case param type to Test Data
|
|
575
|
+
- **Added**: `setTestCaseTestData()` - Set test data array for a test case (simplified array format)
|
|
576
|
+
- **Added**: `getTestCaseTestData()` - Get test script data (paramType, parameters, testData) for a test case
|
|
577
|
+
- **Added**: `hasTestCaseTestData()` - Check if test case has test script data (Parameters or Test Data)
|
|
578
|
+
- **Added**: New `TestExecutions` sub-group under Private API for creating and updating test executions for test cases with test data
|
|
579
|
+
- **Added**: `createTestExecutionWithTestData()` - Create test execution for test case with test data (handles full workflow automatically)
|
|
580
|
+
- **Added**: `getTestCycleItems()` - Get test cycle items (testRunItems) for a test cycle
|
|
581
|
+
- **Added**: `updateTestExecution()` - Update parent test execution information
|
|
582
|
+
- **Added**: `getTestExecutionSteps()` - Get test execution steps (returns only IDs and basic info needed for updates)
|
|
583
|
+
- **Added**: `updateTestExecutionStepStatus()` - Update test execution step status
|
|
584
|
+
- **Added**: `updateTestExecutionStepComment()` - Update test execution step comment (actual result)
|
|
585
|
+
- **Added**: `enableZephyrForProject()` - Enable Zephyr for a Jira project (under Authentication sub-group)
|
|
586
|
+
- **Added**: `isZephyrEnabledForProject()` - Check if Zephyr is enabled for a Jira project (under Authentication sub-group)
|
|
587
|
+
|
|
401
588
|
### 1.3.9
|
|
402
589
|
|
|
403
590
|
- **Changed**: Readme fixes
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Private API Authentication sub-group
|
|
6
|
-
* Handles Jira Context JWT token retrieval
|
|
6
|
+
* Handles Jira Context JWT token retrieval and project management
|
|
7
7
|
*
|
|
8
8
|
* ⚠️ WARNING: These methods use private APIs that are not officially supported.
|
|
9
9
|
*/
|
|
10
|
-
import type { PrivateApiCredentials } from '../../types';
|
|
10
|
+
import type { PrivateApiCredentials, EnableZephyrForProjectRequest, IsZephyrEnabledForProjectRequest, ProjectZephyrStatusResponse } from '../../types';
|
|
11
11
|
import { PrivateBase } from './PrivateBase';
|
|
12
12
|
import type { ZephyrApiConnection } from '../../index';
|
|
13
13
|
export declare class PrivateAuthentication extends PrivateBase {
|
|
@@ -25,5 +25,45 @@ export declare class PrivateAuthentication extends PrivateBase {
|
|
|
25
25
|
* @returns The Context JWT token string
|
|
26
26
|
*/
|
|
27
27
|
getContextJwt(credentials: PrivateApiCredentials): Promise<string>;
|
|
28
|
+
/**
|
|
29
|
+
* Enable Zephyr for a Jira project
|
|
30
|
+
*
|
|
31
|
+
* Enables Zephyr test management for a Jira project. This must be done before
|
|
32
|
+
* the project can be used with Zephyr.
|
|
33
|
+
*
|
|
34
|
+
* ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
|
|
35
|
+
* The endpoint may change or be removed at any time without notice.
|
|
36
|
+
*
|
|
37
|
+
* @param credentials - Private API credentials
|
|
38
|
+
* @param request - Enable Zephyr request
|
|
39
|
+
* @param request.projectId - Jira project ID (numeric, not the project key)
|
|
40
|
+
* @returns Promise that resolves when the operation completes
|
|
41
|
+
* @throws {BadRequestError} If the request is invalid
|
|
42
|
+
* @throws {UnauthorizedError} If authentication fails
|
|
43
|
+
* @throws {ForbiddenError} If the user doesn't have permission
|
|
44
|
+
* @throws {NotFoundError} If the project is not found
|
|
45
|
+
* @throws {ServerError} If the server returns an error
|
|
46
|
+
*/
|
|
47
|
+
enableZephyrForProject(credentials: PrivateApiCredentials, request: EnableZephyrForProjectRequest): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Check if Zephyr is enabled for a Jira project
|
|
50
|
+
*
|
|
51
|
+
* Retrieves the Zephyr status for a Jira project, including whether Zephyr tests
|
|
52
|
+
* are enabled and other project configuration details.
|
|
53
|
+
*
|
|
54
|
+
* ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
|
|
55
|
+
* The endpoint may change or be removed at any time without notice.
|
|
56
|
+
*
|
|
57
|
+
* @param credentials - Private API credentials
|
|
58
|
+
* @param request - Check Zephyr status request
|
|
59
|
+
* @param request.projectId - Jira project ID (numeric, not the project key)
|
|
60
|
+
* @returns Project Zephyr status response
|
|
61
|
+
* @throws {BadRequestError} If the request is invalid
|
|
62
|
+
* @throws {UnauthorizedError} If authentication fails
|
|
63
|
+
* @throws {ForbiddenError} If the user doesn't have permission
|
|
64
|
+
* @throws {NotFoundError} If the project is not found
|
|
65
|
+
* @throws {ServerError} If the server returns an error
|
|
66
|
+
*/
|
|
67
|
+
isZephyrEnabledForProject(credentials: PrivateApiCredentials, request: IsZephyrEnabledForProjectRequest): Promise<ProjectZephyrStatusResponse>;
|
|
28
68
|
}
|
|
29
69
|
//# sourceMappingURL=PrivateAuthentication.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrivateAuthentication.d.ts","sourceRoot":"","sources":["../../../groups/Private/PrivateAuthentication.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;GAKG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"PrivateAuthentication.d.ts","sourceRoot":"","sources":["../../../groups/Private/PrivateAuthentication.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;GAKG;AAEH,OAAO,KAAK,EACX,qBAAqB,EACrB,6BAA6B,EAC7B,gCAAgC,EAChC,2BAA2B,EAC3B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAS5C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,qBAAa,qBAAsB,SAAQ,WAAW;gBACzC,aAAa,CAAC,EAAE,mBAAmB;IAI/C;;;;;;;;;;;OAWG;IACG,aAAa,CAAC,WAAW,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIxE;;;;;;;;;;;;;;;;;;OAkBG;IACG,sBAAsB,CAC3B,WAAW,EAAE,qBAAqB,EAClC,OAAO,EAAE,6BAA6B,GACpC,OAAO,CAAC,IAAI,CAAC;IAwDhB;;;;;;;;;;;;;;;;;;OAkBG;IACG,yBAAyB,CAC9B,WAAW,EAAE,qBAAqB,EAClC,OAAO,EAAE,gCAAgC,GACvC,OAAO,CAAC,2BAA2B,CAAC;CAiDvC"}
|