@smartbear/mcp 0.31.0 → 0.33.0
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/common/client-registry.js +19 -7
- package/dist/package.json.js +1 -1
- package/dist/qtm4j/client.js +14 -0
- package/dist/qtm4j/config/constants.js +83 -2
- package/dist/qtm4j/config/field-resolution.types.js +12 -2
- package/dist/qtm4j/http/api-client.js +30 -4
- package/dist/qtm4j/http/auth-service.js +3 -2
- package/dist/qtm4j/resolver/resolver-registry.js +37 -1
- package/dist/qtm4j/resolver/resolvers/build-resolver.js +51 -0
- package/dist/qtm4j/resolver/resolvers/common-attribute-resolver.js +1 -3
- package/dist/qtm4j/resolver/resolvers/component-resolver.js +1 -1
- package/dist/qtm4j/resolver/resolvers/defect-id-resolver.js +44 -0
- package/dist/qtm4j/resolver/resolvers/defect-priority-resolver.js +55 -0
- package/dist/qtm4j/resolver/resolvers/defect-status-resolver.js +55 -0
- package/dist/qtm4j/resolver/resolvers/environment-resolver.js +51 -0
- package/dist/qtm4j/resolver/resolvers/execution-context-resolver.js +58 -0
- package/dist/qtm4j/resolver/resolvers/label-resolver.js +1 -1
- package/dist/qtm4j/resolver/resolvers/requirement-id-resolver.js +3 -4
- package/dist/qtm4j/resolver/resolvers/step-execution-context-resolver.js +62 -0
- package/dist/qtm4j/resolver/resolvers/test-case-uid-resolver.js +3 -4
- package/dist/qtm4j/resolver/resolvers/test-cycle-uid-resolver.js +3 -4
- package/dist/qtm4j/schema/get-bugs.schema.js +101 -0
- package/dist/qtm4j/schema/get-test-case.schema.js +3 -3
- package/dist/qtm4j/schema/link-bugs.schema.js +63 -0
- package/dist/qtm4j/schema/start-execution.schema.js +45 -0
- package/dist/qtm4j/schema/test-cycle.link.schema.js +10 -1
- package/dist/qtm4j/schema/update-test-case-execution.schema.js +41 -0
- package/dist/qtm4j/schema/update-test-step-execution.schema.js +41 -0
- package/dist/qtm4j/tool/project/get-projects.js +3 -3
- package/dist/qtm4j/tool/project/set-project-context.js +1 -1
- package/dist/qtm4j/tool/test-automation/get-automation-history.js +4 -7
- package/dist/qtm4j/tool/test-automation/upload-automation-result.js +4 -2
- package/dist/qtm4j/tool/test-execution/get-test-case-bugs.js +119 -0
- package/dist/qtm4j/tool/test-execution/get-test-step-bugs.js +122 -0
- package/dist/qtm4j/tool/test-execution/link-test-case-bugs.js +135 -0
- package/dist/qtm4j/tool/test-execution/link-test-step-bugs.js +140 -0
- package/dist/qtm4j/tool/test-execution/start-execution.js +150 -0
- package/dist/qtm4j/tool/test-execution/update-test-case-execution.js +123 -0
- package/dist/qtm4j/tool/test-execution/update-test-step-execution.js +126 -0
- package/dist/swagger/client/api.js +8 -1
- package/dist/swagger/client/functional-testing-api.js +25 -0
- package/dist/swagger/client/functional-testing-tools.js +12 -2
- package/dist/swagger/client/functional-testing-types.js +29 -0
- package/dist/swagger/client/user-management-types.js +2 -1
- package/dist/swagger/client.js +7 -4
- package/dist/zephyr/client.js +3 -1
- package/dist/zephyr/common/rest-api-schemas.js +2876 -522
- package/dist/zephyr/common/utils.js +58 -14
- package/dist/zephyr/tool/test-case/update-test-case.js +37 -21
- package/dist/zephyr/tool/test-cycle/update-test-cycle.js +41 -25
- package/dist/zephyr/tool/test-plan/get-test-plans.js +65 -0
- package/package.json +1 -1
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { Tool, ToolError } from "../../../common/tools.js";
|
|
2
|
+
import { TOOL_NAMES, TOOLSETS, ENDPOINTS } from "../../config/constants.js";
|
|
3
|
+
import { ResolverKeys } from "../../config/field-resolution.types.js";
|
|
4
|
+
import { UpdateTestCaseExecutionResponse, UpdateTestCaseExecutionBody } from "../../schema/update-test-case-execution.schema.js";
|
|
5
|
+
const FIELD_CONFIG = {
|
|
6
|
+
executionResultId: ResolverKeys.CommonAttribute.EXECUTION_RESULT,
|
|
7
|
+
environmentId: ResolverKeys.SearchableField.ENVIRONMENT,
|
|
8
|
+
buildId: ResolverKeys.SearchableField.BUILD
|
|
9
|
+
};
|
|
10
|
+
class UpdateTestCaseExecution extends Tool {
|
|
11
|
+
specification = {
|
|
12
|
+
title: TOOL_NAMES.UPDATE_TEST_CASE_EXECUTION.TITLE,
|
|
13
|
+
toolset: TOOLSETS.TEST_EXECUTIONS,
|
|
14
|
+
summary: TOOL_NAMES.UPDATE_TEST_CASE_EXECUTION.SUMMARY,
|
|
15
|
+
readOnly: false,
|
|
16
|
+
idempotent: true,
|
|
17
|
+
inputSchema: UpdateTestCaseExecutionBody,
|
|
18
|
+
outputSchema: UpdateTestCaseExecutionResponse,
|
|
19
|
+
purpose: "Update an existing test case execution.",
|
|
20
|
+
useCases: [
|
|
21
|
+
"Set a test case execution result (e.g. Pass, Fail, Blocked)",
|
|
22
|
+
"Update comment, environment, build, assignee, planned date, or actual time on an execution"
|
|
23
|
+
],
|
|
24
|
+
examples: [
|
|
25
|
+
{
|
|
26
|
+
description: "Mark test case as Pass",
|
|
27
|
+
parameters: {
|
|
28
|
+
testCycleKey: "PROJ-TR-101",
|
|
29
|
+
testCaseKey: "PROJ-TC-42",
|
|
30
|
+
executionResultId: "Pass"
|
|
31
|
+
},
|
|
32
|
+
expectedOutput: "{ testCycleKey: 'PROJ-TR-101', testCaseKey: 'PROJ-TC-42', updated: true }"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
description: "Update with comment, environment, and actual time",
|
|
36
|
+
parameters: {
|
|
37
|
+
testCycleKey: "PROJ-TR-101",
|
|
38
|
+
testCaseKey: "PROJ-TC-42",
|
|
39
|
+
executionResultId: "Pass",
|
|
40
|
+
comment: "All smoke tests passed.",
|
|
41
|
+
environmentId: "Production",
|
|
42
|
+
actualTime: "01:30:00"
|
|
43
|
+
},
|
|
44
|
+
expectedOutput: "{ testCycleKey: 'PROJ-TR-101', testCaseKey: 'PROJ-TC-42', updated: true }"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
description: "Clear comment",
|
|
48
|
+
parameters: {
|
|
49
|
+
testCycleKey: "PROJ-TR-101",
|
|
50
|
+
testCaseKey: "PROJ-TC-42",
|
|
51
|
+
comment: null
|
|
52
|
+
},
|
|
53
|
+
expectedOutput: "{ testCycleKey: 'PROJ-TR-101', testCaseKey: 'PROJ-TC-42', updated: true }"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
hints: [
|
|
57
|
+
"Call set_project_context before this tool.",
|
|
58
|
+
"At least one updatable field must be provided.",
|
|
59
|
+
"environmentId and buildId accept environment/build name as strings that are resolved to numeric IDs; unresolved names are dropped and a warning is returned.",
|
|
60
|
+
"actualTime must be in 'HH:mm:ss' format (e.g. '01:30:00'). Always include seconds"
|
|
61
|
+
],
|
|
62
|
+
outputDescription: "Confirmation object with testCycleKey, testCaseKey, and updated: true. Warnings are returned in content if any resolvable field (executionResultId, environmentId, buildId) could not be resolved and was dropped."
|
|
63
|
+
};
|
|
64
|
+
handle = async (rawArgs) => {
|
|
65
|
+
const { testCycleKey, testCaseKey, ...bodyArgs } = UpdateTestCaseExecutionBody.parse(rawArgs);
|
|
66
|
+
if (!Object.values(bodyArgs).some((v) => v !== void 0)) {
|
|
67
|
+
throw new ToolError("Provide at least one updatable field.");
|
|
68
|
+
}
|
|
69
|
+
const fieldResolver = this.client.getResolverRegistry();
|
|
70
|
+
const context = fieldResolver.requireProjectContext();
|
|
71
|
+
const warnings = [];
|
|
72
|
+
const testCaseExecutionId = await this.resolveTestCaseExecutionId(
|
|
73
|
+
fieldResolver,
|
|
74
|
+
context,
|
|
75
|
+
testCycleKey,
|
|
76
|
+
testCaseKey
|
|
77
|
+
);
|
|
78
|
+
const body = { ...bodyArgs };
|
|
79
|
+
await Promise.all(
|
|
80
|
+
Object.entries(FIELD_CONFIG).map(
|
|
81
|
+
([inputField, resolverKey]) => fieldResolver.getResolver(resolverKey).resolve(inputField, resolverKey, body, context, warnings)
|
|
82
|
+
)
|
|
83
|
+
);
|
|
84
|
+
if (Object.keys(body).length === 0) {
|
|
85
|
+
throw new ToolError(
|
|
86
|
+
`No updatable fields remain after resolution. ${warnings.join(" | ")}`
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
await this.client.getApiClient().put(
|
|
90
|
+
ENDPOINTS.UPDATE_TEST_CASE_EXECUTION(testCycleKey, testCaseExecutionId),
|
|
91
|
+
body
|
|
92
|
+
);
|
|
93
|
+
const validated = UpdateTestCaseExecutionResponse.parse({
|
|
94
|
+
testCycleKey,
|
|
95
|
+
testCaseKey,
|
|
96
|
+
updated: true
|
|
97
|
+
});
|
|
98
|
+
return {
|
|
99
|
+
structuredContent: validated,
|
|
100
|
+
content: warnings.length > 0 ? [{ type: "text", text: `Note: ${warnings.join(" | ")}` }] : []
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
async resolveTestCaseExecutionId(fieldResolver, context, testCycleKey, testCaseKey) {
|
|
104
|
+
const result = await fieldResolver.getResolver(ResolverKeys.SearchableField.EXECUTION_CONTEXT).resolveAndReturn(context.projectKey, context.projectId, testCycleKey, [
|
|
105
|
+
testCaseKey
|
|
106
|
+
]);
|
|
107
|
+
const entry = result[testCaseKey];
|
|
108
|
+
if (!entry) {
|
|
109
|
+
throw new ToolError(
|
|
110
|
+
`Test case '${testCaseKey}' is not linked to test cycle '${testCycleKey}'. Verify the key and ensure it belongs to the cycle.`
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
if (entry.testCaseExecutionId == null) {
|
|
114
|
+
throw new ToolError(
|
|
115
|
+
`No execution has been started for test case '${testCaseKey}' in cycle '${testCycleKey}'. Use start_new_execution first.`
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
return entry.testCaseExecutionId;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
export {
|
|
122
|
+
UpdateTestCaseExecution
|
|
123
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { Tool, ToolError } from "../../../common/tools.js";
|
|
2
|
+
import { TOOL_NAMES, TOOLSETS, ENDPOINTS } from "../../config/constants.js";
|
|
3
|
+
import { ResolverKeys } from "../../config/field-resolution.types.js";
|
|
4
|
+
import { UpdateTestStepExecutionResponse, UpdateTestStepExecutionBody } from "../../schema/update-test-step-execution.schema.js";
|
|
5
|
+
const FIELD_CONFIG = {
|
|
6
|
+
executionResultId: ResolverKeys.CommonAttribute.EXECUTION_RESULT
|
|
7
|
+
};
|
|
8
|
+
class UpdateTestStepExecution extends Tool {
|
|
9
|
+
specification = {
|
|
10
|
+
title: TOOL_NAMES.UPDATE_TEST_STEP_EXECUTION.TITLE,
|
|
11
|
+
toolset: TOOLSETS.TEST_EXECUTIONS,
|
|
12
|
+
summary: TOOL_NAMES.UPDATE_TEST_STEP_EXECUTION.SUMMARY,
|
|
13
|
+
readOnly: false,
|
|
14
|
+
idempotent: true,
|
|
15
|
+
inputSchema: UpdateTestStepExecutionBody,
|
|
16
|
+
outputSchema: UpdateTestStepExecutionResponse,
|
|
17
|
+
purpose: "Update an existing test step execution.",
|
|
18
|
+
useCases: [
|
|
19
|
+
"Set a test step execution result (e.g. Pass, Fail, Blocked)",
|
|
20
|
+
"Update actualResult or comment on a test step execution"
|
|
21
|
+
],
|
|
22
|
+
examples: [
|
|
23
|
+
{
|
|
24
|
+
description: "Mark step 2 as Pass",
|
|
25
|
+
parameters: {
|
|
26
|
+
testCycleKey: "PROJ-TR-101",
|
|
27
|
+
testCaseKey: "PROJ-TC-42",
|
|
28
|
+
testStepSeqNo: 2,
|
|
29
|
+
executionResultId: "Pass"
|
|
30
|
+
},
|
|
31
|
+
expectedOutput: "{ testCycleKey: 'PROJ-TR-101', testCaseKey: 'PROJ-TC-42', testStepSeqNo: 2, executionResultName: 'Pass', updated: true }"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
description: "Update step 3 with actualResult and comment",
|
|
35
|
+
parameters: {
|
|
36
|
+
testCycleKey: "PROJ-TR-101",
|
|
37
|
+
testCaseKey: "PROJ-TC-42",
|
|
38
|
+
testStepSeqNo: 3,
|
|
39
|
+
executionResultId: "Fail",
|
|
40
|
+
actualResult: "Button not found on page.",
|
|
41
|
+
comment: "Reproduced consistently in Chrome."
|
|
42
|
+
},
|
|
43
|
+
expectedOutput: "{ testCycleKey: 'PROJ-TR-101', testCaseKey: 'PROJ-TC-42', testStepSeqNo: 3, executionResultName: 'Fail', updated: true }"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
description: "Clear actualResult on step 1",
|
|
47
|
+
parameters: {
|
|
48
|
+
testCycleKey: "PROJ-TR-101",
|
|
49
|
+
testCaseKey: "PROJ-TC-42",
|
|
50
|
+
testStepSeqNo: 1,
|
|
51
|
+
actualResult: null
|
|
52
|
+
},
|
|
53
|
+
expectedOutput: "{ testCycleKey: 'PROJ-TR-101', testCaseKey: 'PROJ-TC-42', testStepSeqNo: 1, updated: true }"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
hints: [
|
|
57
|
+
"Call set_project_context before this tool.",
|
|
58
|
+
"At least one updatable field must be provided."
|
|
59
|
+
],
|
|
60
|
+
outputDescription: "Confirmation object with testCycleKey, testCaseKey, testStepSeqNo, and updated: true. executionResultName is included when the server returns it. Warnings are returned in content if executionResultId name could not be resolved."
|
|
61
|
+
};
|
|
62
|
+
handle = async (rawArgs) => {
|
|
63
|
+
const { testCycleKey, testCaseKey, testStepSeqNo, ...bodyArgs } = UpdateTestStepExecutionBody.parse(rawArgs);
|
|
64
|
+
if (!Object.values(bodyArgs).some((v) => v !== void 0)) {
|
|
65
|
+
throw new ToolError("Provide at least one updatable field.");
|
|
66
|
+
}
|
|
67
|
+
const fieldResolver = this.client.getResolverRegistry();
|
|
68
|
+
const context = fieldResolver.requireProjectContext();
|
|
69
|
+
const warnings = [];
|
|
70
|
+
const testStepExecutionId = await this.resolveTestStepExecutionId(
|
|
71
|
+
fieldResolver,
|
|
72
|
+
context,
|
|
73
|
+
testCycleKey,
|
|
74
|
+
testCaseKey,
|
|
75
|
+
testStepSeqNo
|
|
76
|
+
);
|
|
77
|
+
const body = { ...bodyArgs };
|
|
78
|
+
await Promise.all(
|
|
79
|
+
Object.entries(FIELD_CONFIG).map(
|
|
80
|
+
([inputField, resolverKey]) => fieldResolver.getResolver(resolverKey).resolve(inputField, resolverKey, body, context, warnings)
|
|
81
|
+
)
|
|
82
|
+
);
|
|
83
|
+
if (Object.keys(body).length === 0) {
|
|
84
|
+
throw new ToolError(
|
|
85
|
+
`No updatable fields remain after resolution. ${warnings.join(" | ")}`
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
const apiResponse = await this.client.getApiClient().put(
|
|
89
|
+
ENDPOINTS.UPDATE_TEST_STEP_EXECUTION(testCycleKey, testStepExecutionId),
|
|
90
|
+
body
|
|
91
|
+
);
|
|
92
|
+
const validated = UpdateTestStepExecutionResponse.parse({
|
|
93
|
+
testCycleKey,
|
|
94
|
+
testCaseKey,
|
|
95
|
+
testStepSeqNo,
|
|
96
|
+
...apiResponse?.executionResultName !== void 0 && {
|
|
97
|
+
executionResultName: apiResponse.executionResultName
|
|
98
|
+
},
|
|
99
|
+
updated: true
|
|
100
|
+
});
|
|
101
|
+
return {
|
|
102
|
+
structuredContent: validated,
|
|
103
|
+
content: warnings.length > 0 ? [{ type: "text", text: `Note: ${warnings.join(" | ")}` }] : []
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
async resolveTestStepExecutionId(fieldResolver, context, testCycleKey, testCaseKey, testStepSeqNo) {
|
|
107
|
+
const stepCtxResult = await fieldResolver.getResolver(ResolverKeys.SearchableField.STEP_EXECUTION_CONTEXT).resolveAndReturn(
|
|
108
|
+
context.projectKey,
|
|
109
|
+
context.projectId,
|
|
110
|
+
testCycleKey,
|
|
111
|
+
testCaseKey,
|
|
112
|
+
[testStepSeqNo]
|
|
113
|
+
);
|
|
114
|
+
const stepMap = stepCtxResult[testCaseKey] ?? {};
|
|
115
|
+
const testStepExecutionId = stepMap[testStepSeqNo];
|
|
116
|
+
if (testStepExecutionId == null) {
|
|
117
|
+
throw new ToolError(
|
|
118
|
+
`Step ${testStepSeqNo} was not found in this execution.`
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
return testStepExecutionId;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
export {
|
|
125
|
+
UpdateTestStepExecution
|
|
126
|
+
};
|
|
@@ -129,7 +129,14 @@ class SwaggerAPI {
|
|
|
129
129
|
response,
|
|
130
130
|
defaultResponse
|
|
131
131
|
);
|
|
132
|
-
|
|
132
|
+
const list = result;
|
|
133
|
+
if (list.items) {
|
|
134
|
+
list.items = list.items.map((org) => {
|
|
135
|
+
const { email: _email, ...rest } = org;
|
|
136
|
+
return rest;
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
return list;
|
|
133
140
|
}
|
|
134
141
|
async createPortal(body) {
|
|
135
142
|
const response = await fetch(`${this.config.portalBasePath}/portals`, {
|
|
@@ -47,6 +47,31 @@ class FunctionalTestingAPI {
|
|
|
47
47
|
}
|
|
48
48
|
return response;
|
|
49
49
|
}
|
|
50
|
+
async createTest(args) {
|
|
51
|
+
const {
|
|
52
|
+
type: _type,
|
|
53
|
+
steps,
|
|
54
|
+
...rest
|
|
55
|
+
} = args;
|
|
56
|
+
const sanitizedSteps = steps?.map((step) => {
|
|
57
|
+
const { type: _stepType, ...stepRest } = step;
|
|
58
|
+
return { ...stepRest, type: "api" };
|
|
59
|
+
});
|
|
60
|
+
const response = await this.ftFetch(
|
|
61
|
+
`tests`,
|
|
62
|
+
{
|
|
63
|
+
method: "POST",
|
|
64
|
+
headers: this.getFtHeaders(),
|
|
65
|
+
body: JSON.stringify({
|
|
66
|
+
...rest,
|
|
67
|
+
type: "api",
|
|
68
|
+
steps: sanitizedSteps
|
|
69
|
+
})
|
|
70
|
+
},
|
|
71
|
+
errorMessageFor(`create Functional Testing test`)
|
|
72
|
+
);
|
|
73
|
+
return response.json();
|
|
74
|
+
}
|
|
50
75
|
async listTests() {
|
|
51
76
|
const response = await this.ftFetch(
|
|
52
77
|
`tests`,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RunFunctionalTestingTestParamsSchema, GetFunctionalTestingExecutionTestSchema, ListFunctionalTestingSuiteExecutionsSchema, CancelFunctionalTestingSuiteExecutionSchema, RunFunctionalTestingSuiteParamsSchema, GetFunctionalTestingSuiteExecutionSchema, GetFunctionalTestHistoryParamsSchema } from "./functional-testing-types.js";
|
|
1
|
+
import { CreateFunctionalTestingTestResponseSchema, CreateFunctionalTestingTestParamsSchema, RunFunctionalTestingTestParamsSchema, GetFunctionalTestingExecutionTestSchema, ListFunctionalTestingSuiteExecutionsSchema, CancelFunctionalTestingSuiteExecutionSchema, RunFunctionalTestingSuiteParamsSchema, GetFunctionalTestingSuiteExecutionSchema, GetFunctionalTestHistoryParamsSchema } from "./functional-testing-types.js";
|
|
2
2
|
const FUNCTIONAL_TESTING_TOOLS = [
|
|
3
3
|
{
|
|
4
4
|
title: "List Tests",
|
|
@@ -8,10 +8,20 @@ const FUNCTIONAL_TESTING_TOOLS = [
|
|
|
8
8
|
idempotent: true,
|
|
9
9
|
readOnly: true
|
|
10
10
|
},
|
|
11
|
+
{
|
|
12
|
+
title: "Create Test",
|
|
13
|
+
toolset: "Functional Testing",
|
|
14
|
+
summary: "Creates a new API test in your Swagger Functional Testing workspace. This tool only creates API tests (not browser or native-mobile tests). Use this when you need to programmatically create a test with a defined set of API request steps. Each step requires a URL and may specify an HTTP method (defaults to GET), request body, headers, and redirect handling. Returns the ID and the URL to definition of the newly created test; the ID can be used with `swagger_run_test` to run it.",
|
|
15
|
+
inputSchema: CreateFunctionalTestingTestParamsSchema,
|
|
16
|
+
outputSchema: CreateFunctionalTestingTestResponseSchema,
|
|
17
|
+
handler: "createFunctionalTestingTest",
|
|
18
|
+
idempotent: false,
|
|
19
|
+
readOnly: false
|
|
20
|
+
},
|
|
11
21
|
{
|
|
12
22
|
title: "Run Test",
|
|
13
23
|
toolset: "Functional Testing",
|
|
14
|
-
summary: "Runs a specific API test in your Swagger Functional Testing workspace. The execution is asynchronous — it returns an executionId, not the result directly. Use swagger_get_test_status with that executionId to track progress and retrieve the final result.",
|
|
24
|
+
summary: "Runs a specific API test in your Swagger Functional Testing workspace. The execution is asynchronous — it returns an executionId, not the result directly. Use `swagger_get_test_status` with that executionId to track progress and retrieve the final result.",
|
|
15
25
|
inputSchema: RunFunctionalTestingTestParamsSchema,
|
|
16
26
|
handler: "runFunctionalTestingTest",
|
|
17
27
|
idempotent: false,
|
|
@@ -27,11 +27,40 @@ const GetFunctionalTestHistoryParamsSchema = z.object({
|
|
|
27
27
|
limit: z.number().int().min(1).max(100).optional().describe("Number of most recent runs to return (default: 25, max: 100)"),
|
|
28
28
|
offset: z.number().int().min(0).optional().describe("Pagination offset (default: 0)")
|
|
29
29
|
});
|
|
30
|
+
const CreateFunctionalTestingTestHeaderSchema = z.object({
|
|
31
|
+
name: z.string().describe("Header name").trim().min(1),
|
|
32
|
+
value: z.string().describe("Header value")
|
|
33
|
+
});
|
|
34
|
+
const HTTP_METHODS = ["GET", "POST", "PUT", "PATCH", "DELETE"];
|
|
35
|
+
const CreateFunctionalTestingTestStepSchema = z.object({
|
|
36
|
+
url: z.url().describe("URL for the API call"),
|
|
37
|
+
httpMethod: z.enum(HTTP_METHODS).describe("HTTP method for the API call (defaults to GET server-side)").optional(),
|
|
38
|
+
requestBody: z.string().describe("Request body").optional(),
|
|
39
|
+
requestHeaders: z.array(CreateFunctionalTestingTestHeaderSchema).describe("HTTP headers").optional(),
|
|
40
|
+
followRedirects: z.boolean().describe("Whether to follow redirects").optional(),
|
|
41
|
+
description: z.string().trim().describe("Human-readable label for this step").optional()
|
|
42
|
+
});
|
|
43
|
+
const CreateFunctionalTestingTestParamsSchema = z.object({
|
|
44
|
+
name: z.string().describe("Name for the new test").trim().min(1),
|
|
45
|
+
description: z.string().trim().describe("Optional description for the test").optional(),
|
|
46
|
+
steps: z.array(CreateFunctionalTestingTestStepSchema).describe("Test steps to include in the test").optional()
|
|
47
|
+
});
|
|
48
|
+
const CreateFunctionalTestingTestResponseSchema = z.object({
|
|
49
|
+
id: z.number().describe("ID of the newly created test"),
|
|
50
|
+
url: z.string().describe(
|
|
51
|
+
"Link to the created test definition in Swagger Functional Testing UI"
|
|
52
|
+
)
|
|
53
|
+
});
|
|
30
54
|
export {
|
|
31
55
|
CancelFunctionalTestingSuiteExecutionSchema,
|
|
56
|
+
CreateFunctionalTestingTestHeaderSchema,
|
|
57
|
+
CreateFunctionalTestingTestParamsSchema,
|
|
58
|
+
CreateFunctionalTestingTestResponseSchema,
|
|
59
|
+
CreateFunctionalTestingTestStepSchema,
|
|
32
60
|
GetFunctionalTestHistoryParamsSchema,
|
|
33
61
|
GetFunctionalTestingExecutionTestSchema,
|
|
34
62
|
GetFunctionalTestingSuiteExecutionSchema,
|
|
63
|
+
HTTP_METHODS,
|
|
35
64
|
ListFunctionalTestingSuiteExecutionsSchema,
|
|
36
65
|
RunFunctionalTestingSuiteParamsSchema,
|
|
37
66
|
RunFunctionalTestingTestParamsSchema
|
|
@@ -16,7 +16,8 @@ const OrganizationsListOutputSchema = z.object({
|
|
|
16
16
|
z.looseObject({
|
|
17
17
|
id: z.string().optional(),
|
|
18
18
|
name: z.string().optional(),
|
|
19
|
-
|
|
19
|
+
description: z.string().optional(),
|
|
20
|
+
url: z.string().optional(),
|
|
20
21
|
memberCount: z.number().optional()
|
|
21
22
|
})
|
|
22
23
|
).optional()
|
package/dist/swagger/client.js
CHANGED
|
@@ -12,13 +12,13 @@ import { TOOLS } from "./client/tools.js";
|
|
|
12
12
|
import "./client/user-management-types.js";
|
|
13
13
|
const ConfigurationSchema = z.object({
|
|
14
14
|
api_key: z.string().optional().describe("Swagger API key for authentication"),
|
|
15
|
-
portal_base_path: z.
|
|
16
|
-
registry_base_path: z.
|
|
17
|
-
ui_base_path: z.
|
|
15
|
+
portal_base_path: z.url().optional().describe("Base URL for Portal API requests (optional)"),
|
|
16
|
+
registry_base_path: z.url().optional().describe("Base path for Registry API requests (optional)"),
|
|
17
|
+
ui_base_path: z.url().optional().describe("Base URL for the SwaggerHub UI (optional)"),
|
|
18
18
|
functional_testing_api_token: z.string().optional().describe(
|
|
19
19
|
"Swagger Functional Testing API token. Leave empty to disable Functional Testing tools."
|
|
20
20
|
),
|
|
21
|
-
functional_testing_base_path: z.
|
|
21
|
+
functional_testing_base_path: z.url().optional().describe(
|
|
22
22
|
"Base URL for Swagger Functional Testing API requests (optional)"
|
|
23
23
|
)
|
|
24
24
|
});
|
|
@@ -172,6 +172,9 @@ class SwaggerClient {
|
|
|
172
172
|
return this.getApi().standardizeApi(args);
|
|
173
173
|
}
|
|
174
174
|
// Functional Testing methods
|
|
175
|
+
async createFunctionalTestingTest(args) {
|
|
176
|
+
return this.withFunctionalTesting((ftApi) => ftApi.createTest(args));
|
|
177
|
+
}
|
|
175
178
|
async listFunctionalTestingTests() {
|
|
176
179
|
return this.withFunctionalTesting((ftApi) => ftApi.listTests());
|
|
177
180
|
}
|
package/dist/zephyr/client.js
CHANGED
|
@@ -36,6 +36,7 @@ import { GetTestExecutions } from "./tool/test-execution/get-test-executions.js"
|
|
|
36
36
|
import { GetTestExecutionSteps } from "./tool/test-execution/get-test-steps.js";
|
|
37
37
|
import { UpdateTestExecution } from "./tool/test-execution/update-test-execution.js";
|
|
38
38
|
import { UpdateTestExecutionSteps } from "./tool/test-execution/update-test-steps.js";
|
|
39
|
+
import { GetTestPlans } from "./tool/test-plan/get-test-plans.js";
|
|
39
40
|
const BASE_URL_DEFAULT = "https://api.zephyrscale.smartbear.com/v2";
|
|
40
41
|
const ConfigurationSchema = zod__default.object({
|
|
41
42
|
api_token: zod__default.string().describe("Zephyr Scale API token for authentication"),
|
|
@@ -109,7 +110,8 @@ class ZephyrClient {
|
|
|
109
110
|
new UpdateTestExecutionSteps(this),
|
|
110
111
|
new GetTestExecutionSteps(this),
|
|
111
112
|
new GetTestExecutionLinks(this),
|
|
112
|
-
new GetTestExecutions$1(this)
|
|
113
|
+
new GetTestExecutions$1(this),
|
|
114
|
+
new GetTestPlans(this)
|
|
113
115
|
];
|
|
114
116
|
for (const tool of tools) {
|
|
115
117
|
register(tool.specification, tool.handle);
|