@smartbear/mcp 0.13.5 → 0.14.1
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/dist/bugsnag/client.js +169 -10
- package/dist/package.json.js +1 -1
- package/dist/pactflow/client/utils.js +10 -4
- package/dist/swagger/client/portal-types.js +7 -1
- package/dist/swagger/client/tools.js +1 -1
- package/dist/zephyr/client.js +13 -1
- package/dist/zephyr/common/api-client.js +35 -1
- package/dist/zephyr/common/rest-api-schemas.js +1913 -1755
- package/dist/zephyr/common/utils.js +20 -0
- package/dist/zephyr/tool/environment/get-environments.js +4 -4
- package/dist/zephyr/tool/priority/get-priorities.js +4 -4
- package/dist/zephyr/tool/project/get-project.js +4 -4
- package/dist/zephyr/tool/project/get-projects.js +4 -4
- package/dist/zephyr/tool/status/get-statuses.js +4 -4
- package/dist/zephyr/tool/test-case/create-test-case.js +69 -0
- package/dist/zephyr/tool/test-case/create-web-link.js +46 -0
- package/dist/zephyr/tool/test-case/get-test-case.js +4 -4
- package/dist/zephyr/tool/test-case/get-test-cases.js +4 -4
- package/dist/zephyr/tool/test-case/update-test-case.js +79 -0
- package/dist/zephyr/tool/test-cycle/create-test-cycle.js +70 -0
- package/dist/zephyr/tool/test-cycle/get-test-cycle.js +4 -4
- package/dist/zephyr/tool/test-cycle/get-test-cycles.js +4 -4
- package/dist/zephyr/tool/test-cycle/update-test-cycle.js +90 -0
- package/dist/zephyr/tool/test-execution/create-test-execution.js +66 -0
- package/dist/zephyr/tool/test-execution/get-test-execution.js +4 -4
- package/dist/zephyr/tool/test-execution/get-test-executions.js +4 -4
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
function deepMerge(baseObject, objectWithUpdates) {
|
|
2
|
+
const result = { ...baseObject };
|
|
3
|
+
for (const key in objectWithUpdates) {
|
|
4
|
+
if (objectWithUpdates[key] === void 0) {
|
|
5
|
+
continue;
|
|
6
|
+
}
|
|
7
|
+
if (objectsCanBeMerged(baseObject, objectWithUpdates, key)) {
|
|
8
|
+
result[key] = deepMerge(baseObject[key], objectWithUpdates[key]);
|
|
9
|
+
} else {
|
|
10
|
+
result[key] = objectWithUpdates[key];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return result;
|
|
14
|
+
}
|
|
15
|
+
function objectsCanBeMerged(baseObject, objectWithUpdates, key) {
|
|
16
|
+
return objectWithUpdates[key] && typeof objectWithUpdates[key] === "object" && !Array.isArray(objectWithUpdates[key]) && baseObject[key] && typeof baseObject[key] === "object" && !Array.isArray(baseObject[key]);
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
deepMerge
|
|
20
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Tool } from "../../../common/tools.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ListEnvironments200Response, ListEnvironmentsQueryParams } from "../../common/rest-api-schemas.js";
|
|
3
3
|
class GetEnvironments extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get Environments",
|
|
6
6
|
summary: "Get environments in Zephyr",
|
|
7
7
|
readOnly: true,
|
|
8
8
|
idempotent: true,
|
|
9
|
-
inputSchema:
|
|
10
|
-
outputSchema:
|
|
9
|
+
inputSchema: ListEnvironmentsQueryParams,
|
|
10
|
+
outputSchema: ListEnvironments200Response,
|
|
11
11
|
examples: [
|
|
12
12
|
{
|
|
13
13
|
description: "Get the first 20 Environments",
|
|
@@ -55,7 +55,7 @@ class GetEnvironments extends Tool {
|
|
|
55
55
|
]
|
|
56
56
|
};
|
|
57
57
|
handle = async (args) => {
|
|
58
|
-
const getEnvironmentsInput =
|
|
58
|
+
const getEnvironmentsInput = ListEnvironmentsQueryParams.parse(args);
|
|
59
59
|
const response = await this.client.getApiClient().get("/environments", getEnvironmentsInput);
|
|
60
60
|
return {
|
|
61
61
|
structuredContent: response,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Tool } from "../../../common/tools.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ListPriorities200Response, ListPrioritiesQueryParams } from "../../common/rest-api-schemas.js";
|
|
3
3
|
class GetPriorities extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get priorities",
|
|
6
6
|
summary: "Get Zephyr Test Case priorities with optional filters",
|
|
7
7
|
readOnly: true,
|
|
8
8
|
idempotent: true,
|
|
9
|
-
inputSchema:
|
|
10
|
-
outputSchema:
|
|
9
|
+
inputSchema: ListPrioritiesQueryParams,
|
|
10
|
+
outputSchema: ListPriorities200Response,
|
|
11
11
|
examples: [
|
|
12
12
|
{
|
|
13
13
|
description: "Get the first 10 priorities",
|
|
@@ -30,7 +30,7 @@ class GetPriorities extends Tool {
|
|
|
30
30
|
]
|
|
31
31
|
};
|
|
32
32
|
handle = async (args) => {
|
|
33
|
-
const getPrioritiesInput =
|
|
33
|
+
const getPrioritiesInput = ListPrioritiesQueryParams.parse(args);
|
|
34
34
|
const response = await this.client.getApiClient().get("/priorities", getPrioritiesInput);
|
|
35
35
|
return {
|
|
36
36
|
structuredContent: response,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Tool } from "../../../common/tools.js";
|
|
2
|
-
import {
|
|
2
|
+
import { GetProject200Response, GetProjectParams } from "../../common/rest-api-schemas.js";
|
|
3
3
|
class GetProject extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get Project",
|
|
6
6
|
summary: "Get details of project specified by id or key in Zephyr",
|
|
7
7
|
readOnly: true,
|
|
8
8
|
idempotent: true,
|
|
9
|
-
inputSchema:
|
|
10
|
-
outputSchema:
|
|
9
|
+
inputSchema: GetProjectParams,
|
|
10
|
+
outputSchema: GetProject200Response,
|
|
11
11
|
examples: [
|
|
12
12
|
{
|
|
13
13
|
description: "Get the project with id 1",
|
|
@@ -26,7 +26,7 @@ class GetProject extends Tool {
|
|
|
26
26
|
]
|
|
27
27
|
};
|
|
28
28
|
handle = async (args) => {
|
|
29
|
-
const { projectIdOrKey } =
|
|
29
|
+
const { projectIdOrKey } = GetProjectParams.parse(args);
|
|
30
30
|
const response = await this.client.getApiClient().get(`/projects/${projectIdOrKey}`);
|
|
31
31
|
return {
|
|
32
32
|
structuredContent: response,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Tool } from "../../../common/tools.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ListProjects200Response, ListProjectsQueryParams } from "../../common/rest-api-schemas.js";
|
|
3
3
|
class GetProjects extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get Projects",
|
|
6
6
|
summary: "Get details of projects in Zephyr",
|
|
7
7
|
readOnly: true,
|
|
8
8
|
idempotent: true,
|
|
9
|
-
inputSchema:
|
|
10
|
-
outputSchema:
|
|
9
|
+
inputSchema: ListProjectsQueryParams,
|
|
10
|
+
outputSchema: ListProjects200Response,
|
|
11
11
|
examples: [
|
|
12
12
|
{
|
|
13
13
|
description: "Get the first 10 projects",
|
|
@@ -35,7 +35,7 @@ class GetProjects extends Tool {
|
|
|
35
35
|
]
|
|
36
36
|
};
|
|
37
37
|
handle = async (args) => {
|
|
38
|
-
const parsedArgs =
|
|
38
|
+
const parsedArgs = ListProjectsQueryParams.parse(args);
|
|
39
39
|
const response = await this.client.getApiClient().get("/projects", parsedArgs);
|
|
40
40
|
return {
|
|
41
41
|
structuredContent: response,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Tool } from "../../../common/tools.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ListStatuses200Response, ListStatusesQueryParams } from "../../common/rest-api-schemas.js";
|
|
3
3
|
class GetStatuses extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get Statuses",
|
|
6
6
|
summary: "Get statuses of different types of test artifacts in Zephyr",
|
|
7
7
|
readOnly: true,
|
|
8
8
|
idempotent: true,
|
|
9
|
-
inputSchema:
|
|
10
|
-
outputSchema:
|
|
9
|
+
inputSchema: ListStatusesQueryParams,
|
|
10
|
+
outputSchema: ListStatuses200Response,
|
|
11
11
|
examples: [
|
|
12
12
|
{
|
|
13
13
|
description: "Get the first 10 statuses",
|
|
@@ -36,7 +36,7 @@ class GetStatuses extends Tool {
|
|
|
36
36
|
]
|
|
37
37
|
};
|
|
38
38
|
handle = async (args) => {
|
|
39
|
-
const getStatusesInput =
|
|
39
|
+
const getStatusesInput = ListStatusesQueryParams.parse(args);
|
|
40
40
|
const response = await this.client.getApiClient().get("/statuses", getStatusesInput);
|
|
41
41
|
return {
|
|
42
42
|
structuredContent: response,
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Tool } from "../../../common/tools.js";
|
|
2
|
+
import { CreateTestCase201Response, CreateTestCaseBody } from "../../common/rest-api-schemas.js";
|
|
3
|
+
class CreateTestCase extends Tool {
|
|
4
|
+
specification = {
|
|
5
|
+
title: "Create Test Case",
|
|
6
|
+
summary: "Create a new Test Case in Zephyr specified project",
|
|
7
|
+
readOnly: false,
|
|
8
|
+
idempotent: false,
|
|
9
|
+
inputSchema: CreateTestCaseBody,
|
|
10
|
+
outputSchema: CreateTestCase201Response,
|
|
11
|
+
examples: [
|
|
12
|
+
{
|
|
13
|
+
description: "Create a Test Case in project SA to ensure that the axial pump can be enabled",
|
|
14
|
+
parameters: {
|
|
15
|
+
projectKey: "SA",
|
|
16
|
+
name: "Check axial pump",
|
|
17
|
+
objective: "Ensure the axial pump can be enabled"
|
|
18
|
+
},
|
|
19
|
+
expectedOutput: "The newly created Test Case with its details and key"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
description: "Create a Test Case to ensure that the axial pump can be enabled. The test should be in project MM2, have labels 'automated' and 'mcp', and priority 'High'",
|
|
23
|
+
parameters: {
|
|
24
|
+
projectKey: "MM2",
|
|
25
|
+
name: "Check axial pump",
|
|
26
|
+
objective: "Ensure the axial pump can be enabled",
|
|
27
|
+
labels: ["automated", "mcp"],
|
|
28
|
+
priorityName: "High"
|
|
29
|
+
},
|
|
30
|
+
expectedOutput: "The newly created Test Case with its details and key"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
description: "Create a Test Case for verifying strength of the axial pump with custom field 'Axial pump strength' having value '5' in project SA",
|
|
34
|
+
parameters: {
|
|
35
|
+
projectKey: "SA",
|
|
36
|
+
name: "Check axial pump strength",
|
|
37
|
+
objective: "Make sure the axial pump operates at the required strength",
|
|
38
|
+
customFields: {
|
|
39
|
+
"Axial pump strength": 5
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
expectedOutput: "The newly created Test Case with its details and key"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
description: "Create a Test Case in project MM2 to verify the performance of the axial pump with Jira component having ID 10001, Jira owner having ID 10057 in folder 'Pumps'",
|
|
46
|
+
parameters: {
|
|
47
|
+
projectKey: "MM2",
|
|
48
|
+
name: "Check axial pump performance",
|
|
49
|
+
objective: "Ensure the axial pump performs within acceptable limits",
|
|
50
|
+
componentId: 10001,
|
|
51
|
+
ownerJiraUserId: 10057,
|
|
52
|
+
folderId: 18
|
|
53
|
+
},
|
|
54
|
+
expectedOutput: "The newly created Test Case with its details and key"
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
};
|
|
58
|
+
handle = async (args) => {
|
|
59
|
+
const body = CreateTestCaseBody.parse(args);
|
|
60
|
+
const response = await this.client.getApiClient().post(`/testcases/`, body);
|
|
61
|
+
return {
|
|
62
|
+
structuredContent: response,
|
|
63
|
+
content: []
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
CreateTestCase
|
|
69
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Tool } from "../../../common/tools.js";
|
|
2
|
+
import { CreateTestCaseWebLink201Response, CreateTestCaseWebLinkBody, CreateTestCaseWebLinkParams } from "../../common/rest-api-schemas.js";
|
|
3
|
+
class CreateTestCaseWebLink extends Tool {
|
|
4
|
+
specification = {
|
|
5
|
+
title: "Create Test Case Web Link",
|
|
6
|
+
summary: "Create a new Web Link for a Test Case in Zephyr",
|
|
7
|
+
readOnly: false,
|
|
8
|
+
idempotent: false,
|
|
9
|
+
inputSchema: CreateTestCaseWebLinkBody.extend({
|
|
10
|
+
testCaseKey: CreateTestCaseWebLinkParams.shape.testCaseKey
|
|
11
|
+
}),
|
|
12
|
+
outputSchema: CreateTestCaseWebLink201Response,
|
|
13
|
+
examples: [
|
|
14
|
+
{
|
|
15
|
+
description: "Create a web link for test case SA-T1 pointing to Atlassian's homepage",
|
|
16
|
+
parameters: {
|
|
17
|
+
testCaseKey: "SA-T1",
|
|
18
|
+
url: "https://www.atlassian.com",
|
|
19
|
+
description: "Link to Atlassian's homepage"
|
|
20
|
+
},
|
|
21
|
+
expectedOutput: "The newly created Web Link with its ID and self link"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
description: "Attach a documentation link to test case MM2-T15 for pump specifications",
|
|
25
|
+
parameters: {
|
|
26
|
+
testCaseKey: "MM2-T15",
|
|
27
|
+
url: "https://docs.atlassian.com",
|
|
28
|
+
description: "Documentation for pump specifications"
|
|
29
|
+
},
|
|
30
|
+
expectedOutput: "The newly created Web Link with its ID and self link"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
};
|
|
34
|
+
handle = async (args) => {
|
|
35
|
+
const { testCaseKey } = CreateTestCaseWebLinkParams.parse(args);
|
|
36
|
+
const body = CreateTestCaseWebLinkBody.parse(args);
|
|
37
|
+
const response = await this.client.getApiClient().post(`/testcases/${testCaseKey}/links/weblinks`, body);
|
|
38
|
+
return {
|
|
39
|
+
structuredContent: response,
|
|
40
|
+
content: []
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
CreateTestCaseWebLink
|
|
46
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Tool } from "../../../common/tools.js";
|
|
2
|
-
import {
|
|
2
|
+
import { GetTestCase200Response, GetTestCaseParams } from "../../common/rest-api-schemas.js";
|
|
3
3
|
class GetTestCase extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get Test Case",
|
|
6
6
|
summary: "Get details of test case specified by key in Zephyr",
|
|
7
7
|
readOnly: true,
|
|
8
8
|
idempotent: true,
|
|
9
|
-
inputSchema:
|
|
10
|
-
outputSchema:
|
|
9
|
+
inputSchema: GetTestCaseParams,
|
|
10
|
+
outputSchema: GetTestCase200Response,
|
|
11
11
|
examples: [
|
|
12
12
|
{
|
|
13
13
|
description: "Get the test case with key 'SA-T10'",
|
|
@@ -26,7 +26,7 @@ class GetTestCase extends Tool {
|
|
|
26
26
|
]
|
|
27
27
|
};
|
|
28
28
|
handle = async (args) => {
|
|
29
|
-
const { testCaseKey } =
|
|
29
|
+
const { testCaseKey } = GetTestCaseParams.parse(args);
|
|
30
30
|
const response = await this.client.getApiClient().get(`/testcases/${testCaseKey}`);
|
|
31
31
|
return {
|
|
32
32
|
structuredContent: response,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Tool } from "../../../common/tools.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ListTestCasesCursorPaginated200Response, ListTestCasesCursorPaginatedQueryParams } from "../../common/rest-api-schemas.js";
|
|
3
3
|
class GetTestCases extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get Test Cases",
|
|
6
6
|
summary: "Get details of test cases in Zephyr",
|
|
7
7
|
readOnly: true,
|
|
8
8
|
idempotent: true,
|
|
9
|
-
inputSchema:
|
|
10
|
-
outputSchema:
|
|
9
|
+
inputSchema: ListTestCasesCursorPaginatedQueryParams,
|
|
10
|
+
outputSchema: ListTestCasesCursorPaginated200Response,
|
|
11
11
|
examples: [
|
|
12
12
|
{
|
|
13
13
|
description: "Get the first 10 Test Cases",
|
|
@@ -51,7 +51,7 @@ class GetTestCases extends Tool {
|
|
|
51
51
|
]
|
|
52
52
|
};
|
|
53
53
|
handle = async (args) => {
|
|
54
|
-
const parsedArgs =
|
|
54
|
+
const parsedArgs = ListTestCasesCursorPaginatedQueryParams.parse(args);
|
|
55
55
|
const response = await this.client.getApiClient().get("/testcases/nextgen", parsedArgs);
|
|
56
56
|
return {
|
|
57
57
|
structuredContent: response,
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Tool } from "../../../common/tools.js";
|
|
2
|
+
import { UpdateTestCaseParams, UpdateTestCaseBody } from "../../common/rest-api-schemas.js";
|
|
3
|
+
import { deepMerge } from "../../common/utils.js";
|
|
4
|
+
class UpdateTestCase extends Tool {
|
|
5
|
+
specification = {
|
|
6
|
+
title: "Update Test Case",
|
|
7
|
+
summary: 'Update an existing Test Case in Zephyr. This operation fetches the current test case and merges your updates with it to prevent accidental property deletion. Properties which are not included in the tool call will be left unchanged. To remove a property, set it to null explicitly. For fields that accept multiple values, such as `labels`, if the field is provided, it will override the previous values. For example, if `labels` is provided with the values `["label1", "label2"]`, the Test Case will now only have those two labels, and any previous labels will be removed. If you want to add a label, you would need to specify in the prompt the intention to add a label.',
|
|
8
|
+
readOnly: false,
|
|
9
|
+
idempotent: true,
|
|
10
|
+
inputSchema: UpdateTestCaseParams.and(UpdateTestCaseBody.partial()),
|
|
11
|
+
examples: [
|
|
12
|
+
{
|
|
13
|
+
description: "Update the name of the test case 'SA-T10' to 'Check axial pump' and objective to 'To ensure the axial pump can be enabled'",
|
|
14
|
+
parameters: {
|
|
15
|
+
testCaseKey: "SA-T10",
|
|
16
|
+
name: "Check axial pump",
|
|
17
|
+
objective: "To ensure the axial pump can be enabled"
|
|
18
|
+
},
|
|
19
|
+
expectedOutput: "The test case should be updated, but no output is expected."
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
description: "Update the test case 'MM2-T1' by setting labels 'Regression','Performance' and 'Automated' and changing the priority to the one with id 2.",
|
|
23
|
+
parameters: {
|
|
24
|
+
testCaseKey: "MM2-T1",
|
|
25
|
+
priority: { id: 2 },
|
|
26
|
+
labels: ["Regression", "Performance", "Automated"]
|
|
27
|
+
},
|
|
28
|
+
expectedOutput: "The test case should be updated, but no output is expected."
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
description: "Update test case 'SA-T5', by setting the custom field 'Build Number' to 20, 'Release Date' to '2020-01-01' and setting the Test Cases's estimated time to 3600000 milliseconds.",
|
|
32
|
+
parameters: {
|
|
33
|
+
testCaseKey: "SA-T5",
|
|
34
|
+
estimatedTime: 36e5,
|
|
35
|
+
customFields: {
|
|
36
|
+
"Build Number": 20,
|
|
37
|
+
"Release Date": "2020-01-01"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
expectedOutput: "The test case should be updated, but no output is expected."
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
description: "Remove the component from test case 'SA-T20'.",
|
|
44
|
+
parameters: {
|
|
45
|
+
testCaseKey: "SA-T20",
|
|
46
|
+
component: null
|
|
47
|
+
},
|
|
48
|
+
expectedOutput: "The test case should be updated, but no output is expected."
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
description: "Remove a specific custom field 'Pre-Condition(s)' from test case 'SA-T15' while keeping other custom fields intact",
|
|
52
|
+
parameters: {
|
|
53
|
+
testCaseKey: "SA-T15",
|
|
54
|
+
customFields: {
|
|
55
|
+
"Pre-Condition(s)": null,
|
|
56
|
+
Implemented: false
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
expectedOutput: "The test case should be updated, but no output is expected."
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
};
|
|
63
|
+
handle = async (args) => {
|
|
64
|
+
const parsed = UpdateTestCaseParams.and(UpdateTestCaseBody.partial()).parse(
|
|
65
|
+
args
|
|
66
|
+
);
|
|
67
|
+
const { testCaseKey, ...updates } = parsed;
|
|
68
|
+
const existingTestCase = await this.client.getApiClient().get(`/testcases/${testCaseKey}`);
|
|
69
|
+
const mergedBody = deepMerge(existingTestCase, updates);
|
|
70
|
+
await this.client.getApiClient().put(`/testcases/${testCaseKey}`, mergedBody);
|
|
71
|
+
return {
|
|
72
|
+
structuredContent: {},
|
|
73
|
+
content: []
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export {
|
|
78
|
+
UpdateTestCase
|
|
79
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Tool } from "../../../common/tools.js";
|
|
2
|
+
import { CreateTestCycle201Response, CreateTestCycleBody } from "../../common/rest-api-schemas.js";
|
|
3
|
+
class CreateTestCycle extends Tool {
|
|
4
|
+
specification = {
|
|
5
|
+
title: "Create Test Cycle",
|
|
6
|
+
summary: "Create a new Test Cycle in Zephyr specified project",
|
|
7
|
+
readOnly: false,
|
|
8
|
+
idempotent: false,
|
|
9
|
+
inputSchema: CreateTestCycleBody,
|
|
10
|
+
outputSchema: CreateTestCycle201Response,
|
|
11
|
+
examples: [
|
|
12
|
+
{
|
|
13
|
+
description: "Create a Test Cycle in project SA to ensure that the axial pump can be enabled",
|
|
14
|
+
parameters: {
|
|
15
|
+
projectKey: "SA",
|
|
16
|
+
name: "Check axial pump",
|
|
17
|
+
description: "Ensure the axial pump can be enabled"
|
|
18
|
+
},
|
|
19
|
+
expectedOutput: "The newly created Test Cycle with its details and key"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
description: "Create a Test Cycle to ensure that the axial pump can be enabled. The test cycle should be in project MM2, have status 'In Progress', and be planned from 2026-03-01 to 2026-03-10",
|
|
23
|
+
parameters: {
|
|
24
|
+
projectKey: "MM2",
|
|
25
|
+
name: "Check axial pump",
|
|
26
|
+
description: "Ensure the axial pump can be enabled",
|
|
27
|
+
statusName: "In Progress",
|
|
28
|
+
plannedStartDate: "2026-03-01T00:00:00Z",
|
|
29
|
+
plannedEndDate: "2026-03-10T00:00:00Z"
|
|
30
|
+
},
|
|
31
|
+
expectedOutput: "The newly created Test Cycle with its details and key"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
description: "Create a Test Cycle for verifying strength of the axial pump with custom field 'Axial pump strength' having value '5' in project SA",
|
|
35
|
+
parameters: {
|
|
36
|
+
projectKey: "SA",
|
|
37
|
+
name: "Check axial pump strength",
|
|
38
|
+
description: "Make sure the axial pump operates at the required strength",
|
|
39
|
+
customFields: {
|
|
40
|
+
"Axial pump strength": 5
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
expectedOutput: "The newly created Test Cycle with its details and key"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
description: "Create a Test Cycle in project MM2 to verify the performance of the axial pump with Jira Project Version ID 10001, owner Atlassian Account ID '12', in folder with ID 18",
|
|
47
|
+
parameters: {
|
|
48
|
+
projectKey: "MM2",
|
|
49
|
+
name: "Check axial pump performance",
|
|
50
|
+
description: "Ensure the axial pump performs within acceptable limits",
|
|
51
|
+
jiraProjectVersion: 10001,
|
|
52
|
+
ownerId: "12",
|
|
53
|
+
folderId: 18
|
|
54
|
+
},
|
|
55
|
+
expectedOutput: "The newly created Test Cycle with its details and key"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
};
|
|
59
|
+
handle = async (args) => {
|
|
60
|
+
const body = CreateTestCycleBody.parse(args);
|
|
61
|
+
const response = await this.client.getApiClient().post(`/testcycles/`, body);
|
|
62
|
+
return {
|
|
63
|
+
structuredContent: response,
|
|
64
|
+
content: []
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
CreateTestCycle
|
|
70
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Tool } from "../../../common/tools.js";
|
|
2
|
-
import {
|
|
2
|
+
import { GetTestCycle200Response, GetTestCycleParams } from "../../common/rest-api-schemas.js";
|
|
3
3
|
class GetTestCycle extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get Test Cycle",
|
|
6
6
|
summary: "Get details of test cycle specified by id or key in Zephyr",
|
|
7
7
|
readOnly: true,
|
|
8
8
|
idempotent: true,
|
|
9
|
-
inputSchema:
|
|
10
|
-
outputSchema:
|
|
9
|
+
inputSchema: GetTestCycleParams,
|
|
10
|
+
outputSchema: GetTestCycle200Response,
|
|
11
11
|
examples: [
|
|
12
12
|
{
|
|
13
13
|
description: "Get the test cycle with id 1",
|
|
@@ -26,7 +26,7 @@ class GetTestCycle extends Tool {
|
|
|
26
26
|
]
|
|
27
27
|
};
|
|
28
28
|
handle = async (args) => {
|
|
29
|
-
const { testCycleIdOrKey } =
|
|
29
|
+
const { testCycleIdOrKey } = GetTestCycleParams.parse(args);
|
|
30
30
|
const response = await this.client.getApiClient().get(`/testcycles/${testCycleIdOrKey}`);
|
|
31
31
|
return {
|
|
32
32
|
structuredContent: response,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Tool } from "../../../common/tools.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ListTestCycles200Response, ListTestCyclesQueryParams } from "../../common/rest-api-schemas.js";
|
|
3
3
|
class GetTestCycles extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get Test Cycles",
|
|
6
6
|
summary: "Get details of Test Cycles in Zephyr",
|
|
7
7
|
readOnly: true,
|
|
8
8
|
idempotent: true,
|
|
9
|
-
inputSchema:
|
|
10
|
-
outputSchema:
|
|
9
|
+
inputSchema: ListTestCyclesQueryParams,
|
|
10
|
+
outputSchema: ListTestCycles200Response,
|
|
11
11
|
examples: [
|
|
12
12
|
{
|
|
13
13
|
description: "Get the first 10 Test Cycles",
|
|
@@ -59,7 +59,7 @@ class GetTestCycles extends Tool {
|
|
|
59
59
|
]
|
|
60
60
|
};
|
|
61
61
|
handle = async (args) => {
|
|
62
|
-
const parsedArgs =
|
|
62
|
+
const parsedArgs = ListTestCyclesQueryParams.parse(args);
|
|
63
63
|
const response = await this.client.getApiClient().get("/testcycles", parsedArgs);
|
|
64
64
|
return {
|
|
65
65
|
structuredContent: response,
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Tool } from "../../../common/tools.js";
|
|
2
|
+
import { UpdateTestCycleParams, UpdateTestCycleBody } from "../../common/rest-api-schemas.js";
|
|
3
|
+
import { deepMerge } from "../../common/utils.js";
|
|
4
|
+
class UpdateTestCycle extends Tool {
|
|
5
|
+
specification = {
|
|
6
|
+
title: "Update Test Cycle",
|
|
7
|
+
summary: "Update an existing Test Cycle in Zephyr. This operation fetches the current test cycle and merges your updates with it to prevent accidental property deletion. To remove a property, set it to null explicitly. The plannedStartDate and plannedEndDate fields cannot be cleared",
|
|
8
|
+
readOnly: false,
|
|
9
|
+
idempotent: true,
|
|
10
|
+
inputSchema: UpdateTestCycleParams.and(UpdateTestCycleBody.partial()),
|
|
11
|
+
examples: [
|
|
12
|
+
{
|
|
13
|
+
description: "Update the name of the test cycle 'SA-R40' to 'Sprint 1 Regression - Updated' and set description.",
|
|
14
|
+
parameters: {
|
|
15
|
+
testCycleIdOrKey: "SA-R40",
|
|
16
|
+
name: "Sprint 1 Regression - Updated",
|
|
17
|
+
description: "Updated regression scope for Sprint 1"
|
|
18
|
+
},
|
|
19
|
+
expectedOutput: "The test cycle should be updated, but no output is expected."
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
description: "Update planned dates for test cycle id '1' (keep everything else unchanged).",
|
|
23
|
+
parameters: {
|
|
24
|
+
testCycleIdOrKey: "1",
|
|
25
|
+
plannedStartDate: "2018-05-19T13:15:13Z",
|
|
26
|
+
plannedEndDate: "2018-05-20T13:15:13Z"
|
|
27
|
+
},
|
|
28
|
+
expectedOutput: "The test cycle should be updated, but no output is expected."
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
description: "Change folder and status for test cycle 'SA-R40' by setting folder id and status id.",
|
|
32
|
+
parameters: {
|
|
33
|
+
testCycleIdOrKey: "SA-R40",
|
|
34
|
+
folder: { id: 100006 },
|
|
35
|
+
status: { id: 1e4 }
|
|
36
|
+
},
|
|
37
|
+
expectedOutput: "The test cycle should be updated, but no output is expected."
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
description: "Update custom fields on test cycle 'SA-R40' while keeping other custom fields intact.",
|
|
41
|
+
parameters: {
|
|
42
|
+
testCycleIdOrKey: "SA-R40",
|
|
43
|
+
customFields: {
|
|
44
|
+
"Build Number": 20,
|
|
45
|
+
"Release Date": "2020-01-01"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
expectedOutput: "The test cycle should be updated, but no output is expected."
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
description: "Remove the owner from test cycle 'SA-R40'.",
|
|
52
|
+
parameters: {
|
|
53
|
+
testCycleIdOrKey: "SA-R40",
|
|
54
|
+
owner: null
|
|
55
|
+
},
|
|
56
|
+
expectedOutput: "The test cycle should be updated, but no output is expected."
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
description: "Remove a specific custom field 'Pre-Condition(s)' from test cycle 'SA-R40' while keeping other custom fields intact.",
|
|
60
|
+
parameters: {
|
|
61
|
+
testCycleIdOrKey: "SA-R40",
|
|
62
|
+
customFields: {
|
|
63
|
+
"Pre-Condition(s)": null,
|
|
64
|
+
Implemented: false
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
expectedOutput: "The test cycle should be updated, but no output is expected."
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
};
|
|
71
|
+
handle = async (args) => {
|
|
72
|
+
const parsed = UpdateTestCycleParams.and(
|
|
73
|
+
UpdateTestCycleBody.partial()
|
|
74
|
+
).parse(args);
|
|
75
|
+
const { testCycleIdOrKey, ...updatesRaw } = parsed;
|
|
76
|
+
const updates = { ...updatesRaw };
|
|
77
|
+
if (updates.plannedStartDate === null) delete updates.plannedStartDate;
|
|
78
|
+
if (updates.plannedEndDate === null) delete updates.plannedEndDate;
|
|
79
|
+
const existingTestCycle = await this.client.getApiClient().get(`/testcycles/${testCycleIdOrKey}`);
|
|
80
|
+
const mergedBody = deepMerge(existingTestCycle, updates);
|
|
81
|
+
await this.client.getApiClient().put(`/testcycles/${testCycleIdOrKey}`, mergedBody);
|
|
82
|
+
return {
|
|
83
|
+
structuredContent: {},
|
|
84
|
+
content: []
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
export {
|
|
89
|
+
UpdateTestCycle
|
|
90
|
+
};
|