@smartbear/mcp 0.10.0 → 0.12.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/README.md +10 -8
- package/dist/bugsnag/client/api/Error.js +1 -1
- package/dist/bugsnag/client/api/Project.js +152 -0
- package/dist/bugsnag/client/api/api.js +130 -3
- package/dist/bugsnag/client/api/base.js +19 -0
- package/dist/bugsnag/client/api/index.js +2 -0
- package/dist/bugsnag/client/filters.js +0 -6
- package/dist/bugsnag/client.js +739 -378
- package/dist/bugsnag/input-schemas.js +59 -0
- package/dist/collaborator/client.js +18 -5
- package/dist/common/cache.js +63 -0
- package/dist/common/client-registry.js +128 -0
- package/dist/common/register-clients.js +31 -0
- package/dist/common/server.js +30 -9
- package/dist/common/transport-http.js +377 -0
- package/dist/common/transport-stdio.js +48 -0
- package/dist/index.js +20 -70
- package/dist/pactflow/client.js +39 -19
- package/dist/qmetry/client/auto-resolve.js +10 -0
- package/dist/qmetry/client/automation.js +171 -0
- package/dist/qmetry/client/handlers.js +9 -2
- package/dist/qmetry/client/project.js +87 -1
- package/dist/qmetry/client/testsuite.js +37 -1
- package/dist/qmetry/client/tools/automation-tools.js +290 -0
- package/dist/qmetry/client/tools/index.js +3 -0
- package/dist/qmetry/client/tools/issue-tools.js +1 -1
- package/dist/qmetry/client/tools/project-tools.js +311 -1
- package/dist/qmetry/client/tools/requirement-tools.js +1 -1
- package/dist/qmetry/client/tools/testcase-tools.js +311 -39
- package/dist/qmetry/client/tools/testsuite-tools.js +337 -23
- package/dist/qmetry/client.js +24 -9
- package/dist/qmetry/config/constants.js +6 -0
- package/dist/qmetry/config/rest-endpoints.js +8 -0
- package/dist/qmetry/types/automation.js +8 -0
- package/dist/qmetry/types/common.js +299 -4
- package/dist/qmetry/types/issues.js +5 -0
- package/dist/qmetry/types/project.js +13 -0
- package/dist/qmetry/types/requirements.js +5 -0
- package/dist/qmetry/types/testcase.js +5 -0
- package/dist/qmetry/types/testsuite.js +9 -0
- package/dist/reflect/client.js +10 -4
- package/dist/{api-hub → swagger}/client/api.js +94 -37
- package/dist/{api-hub → swagger}/client/configuration.js +4 -2
- package/dist/{api-hub → swagger}/client/index.js +2 -2
- package/dist/{api-hub → swagger}/client/portal-types.js +7 -6
- package/dist/{api-hub → swagger}/client/registry-types.js +26 -0
- package/dist/{api-hub → swagger}/client/tools.js +19 -20
- package/dist/{api-hub → swagger}/client.js +51 -39
- package/dist/swagger/config-utils.js +18 -0
- package/dist/tests/unit/bugsnag/utils/factories.js +86 -0
- package/dist/zephyr/client.js +44 -8
- package/dist/zephyr/common/rest-api-schemas.js +79 -78
- package/dist/zephyr/tool/environment/get-environments.js +68 -0
- package/dist/zephyr/tool/priority/get-priorities.js +43 -0
- package/dist/zephyr/tool/status/get-statuses.js +49 -0
- package/dist/zephyr/tool/test-case/get-test-case.js +39 -0
- package/dist/zephyr/tool/test-case/get-test-cases.js +64 -0
- package/dist/zephyr/tool/test-cycle/get-test-cycle.js +39 -0
- package/dist/zephyr/tool/test-cycle/get-test-cycles.js +2 -2
- package/dist/zephyr/tool/test-execution/get-test-execution.js +39 -0
- package/dist/zephyr/tool/test-execution/get-test-executions.js +45 -0
- package/package.json +4 -3
- /package/dist/{api-hub → swagger}/client/user-management-types.js +0 -0
|
@@ -109,45 +109,99 @@ export const TESTCASE_TOOLS = [
|
|
|
109
109
|
},
|
|
110
110
|
{
|
|
111
111
|
title: "Update Test Case",
|
|
112
|
-
summary: "Update an existing QMetry test case by tcID and tcVersionID, with auto-resolution from entityKey.",
|
|
112
|
+
summary: "Update an existing QMetry test case OR create a new version by tcID and tcVersionID, with auto-resolution from entityKey.",
|
|
113
113
|
handler: QMetryToolsHandlers.UPDATE_TEST_CASE,
|
|
114
114
|
inputSchema: UpdateTestCaseArgsSchema,
|
|
115
|
-
purpose: "Update a QMetry test case's metadata, steps, or other fields. " +
|
|
115
|
+
purpose: "Update a QMetry test case's metadata, steps, or other fields. Can also create NEW VERSIONS of test cases. " +
|
|
116
116
|
"Requires tcID and tcVersionID, which can be auto-resolved from the test case entityKey using the test case list and version detail tools. " +
|
|
117
|
-
"Supports updating summary, priority, owner, component, state, type, description, steps, and more. Only fields provided will be updated."
|
|
117
|
+
"Supports updating summary, priority, owner, component, state, type, description, steps, and more. Only fields provided will be updated. " +
|
|
118
|
+
"VERSION CREATION: Set withVersion=true to create a NEW incremental version (e.g., version 2→3). Without this flag, updates existing version. " +
|
|
119
|
+
"CRITICAL ANTI-DUPLICATION: When updating steps, ALWAYS include tcStepID for existing steps to update them in place. " +
|
|
120
|
+
"Steps WITHOUT tcStepID are treated as NEW steps and will be ADDED (causing duplication if you meant to update). " +
|
|
121
|
+
"Always fetch existing steps first using FETCH_TEST_CASE_STEPS to get their tcStepID values before updating.",
|
|
118
122
|
useCases: [
|
|
119
123
|
"Update test case summary (name)",
|
|
120
124
|
"Change priority, owner, or state of a test case",
|
|
121
125
|
"Edit, add, or remove test steps",
|
|
122
126
|
"Update only metadata (no steps)",
|
|
127
|
+
"Create a new version of a test case (withVersion=true)",
|
|
128
|
+
"Update a specific version of a test case (without withVersion flag)",
|
|
123
129
|
"Bulk update using entityKey auto-resolution",
|
|
124
130
|
"Modify test case description or estimated time",
|
|
125
131
|
"Change test case type or component",
|
|
126
132
|
"Update testing type or custom fields",
|
|
127
133
|
"Update, add and remove test case steps",
|
|
134
|
+
"Version control for test case evolution tracking",
|
|
128
135
|
],
|
|
129
136
|
examples: [
|
|
130
137
|
{
|
|
131
|
-
description: "Update test case summary (
|
|
138
|
+
description: "Update test case summary (existing version update)",
|
|
132
139
|
parameters: {
|
|
133
140
|
tcID: 4519260,
|
|
134
141
|
tcVersionID: 5448492,
|
|
135
142
|
name: "MAC Test11",
|
|
136
143
|
},
|
|
137
|
-
expectedOutput: "Test case summary updated. tcID and tcVersionID auto-resolved from entityKey. Only 'name' field changed.",
|
|
144
|
+
expectedOutput: "Test case summary updated. tcID and tcVersionID auto-resolved from entityKey. Only 'name' field changed. Version remains the same.",
|
|
138
145
|
},
|
|
139
146
|
{
|
|
140
|
-
description: "
|
|
147
|
+
description: "Create NEW VERSION with updated summary and description",
|
|
148
|
+
parameters: {
|
|
149
|
+
tcID: 4572654,
|
|
150
|
+
tcVersionID: 5514384,
|
|
151
|
+
tcVersion: 1,
|
|
152
|
+
name: "Add two numbers 2 v2",
|
|
153
|
+
description: "Test Description version 2",
|
|
154
|
+
withVersion: true,
|
|
155
|
+
versionComment: "version 2 comment add",
|
|
156
|
+
notruncurrent: true,
|
|
157
|
+
notrunall: true,
|
|
158
|
+
},
|
|
159
|
+
expectedOutput: "New version created (version 2). Test case now has incremental version with updated summary and description. Original version 1 remains unchanged.",
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
description: "Create NEW VERSION with all metadata fields (release, cycle, priority, owner, etc.)",
|
|
163
|
+
parameters: {
|
|
164
|
+
tcID: 4572654,
|
|
165
|
+
tcVersionID: 5514384,
|
|
166
|
+
tcVersion: 1,
|
|
167
|
+
name: "Facebook Login Validation Failed update from MCP V2",
|
|
168
|
+
description: "Existing description V2",
|
|
169
|
+
priority: 2355751,
|
|
170
|
+
testcaseOwner: 6963,
|
|
171
|
+
testCaseState: 2355753,
|
|
172
|
+
testCaseType: 2355762,
|
|
173
|
+
estimatedTime: 7200,
|
|
174
|
+
withVersion: true,
|
|
175
|
+
versionComment: "Created version 2 with updated metadata",
|
|
176
|
+
notruncurrent: true,
|
|
177
|
+
notrunall: true,
|
|
178
|
+
folderPath: 602290,
|
|
179
|
+
scope: "project",
|
|
180
|
+
},
|
|
181
|
+
expectedOutput: "New test case version 2 created with updated summary, description, priority (High), owner (umang.savaliya), state, type, and estimated time (2 hours). Version comment added for tracking.",
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
description: "Update EXISTING VERSION 2 (not creating new version)",
|
|
185
|
+
parameters: {
|
|
186
|
+
tcID: 4572654,
|
|
187
|
+
tcVersionID: 5514385,
|
|
188
|
+
name: "Updated version 2 name",
|
|
189
|
+
priority: 2355752,
|
|
190
|
+
},
|
|
191
|
+
expectedOutput: "Version 2 updated with new name and priority. No new version created because withVersion flag is not set. This is a normal update of existing version.",
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
description: "Update priority to High and owner to john.doe (existing version)",
|
|
141
195
|
parameters: {
|
|
142
196
|
tcID: 4519260,
|
|
143
197
|
tcVersionID: 5448492,
|
|
144
198
|
priority: 505015,
|
|
145
199
|
testcaseOwner: 6963,
|
|
146
200
|
},
|
|
147
|
-
expectedOutput: "Priority and owner updated. Field IDs auto-resolved from project info. tcID/tcVersionID resolved from entityKey.",
|
|
201
|
+
expectedOutput: "Priority and owner updated. Field IDs auto-resolved from project info. tcID/tcVersionID resolved from entityKey. Existing version modified.",
|
|
148
202
|
},
|
|
149
203
|
{
|
|
150
|
-
description: "Update steps (edit, add, remove)",
|
|
204
|
+
description: "Update steps (edit, add, remove) - existing version",
|
|
151
205
|
parameters: {
|
|
152
206
|
tcID: 4519260,
|
|
153
207
|
tcVersionID: 5448492,
|
|
@@ -157,13 +211,14 @@ export const TESTCASE_TOOLS = [
|
|
|
157
211
|
description: "Step 22",
|
|
158
212
|
inputData: "Input 22",
|
|
159
213
|
expectedOutcome: "Outcome 22",
|
|
160
|
-
tcStepID: 3014032,
|
|
214
|
+
tcStepID: 3014032, // CRITICAL: Include tcStepID to UPDATE existing step (not create duplicate)
|
|
161
215
|
},
|
|
162
216
|
{
|
|
163
217
|
orderId: 2,
|
|
164
218
|
description: "Step3",
|
|
165
219
|
inputData: "Input 3",
|
|
166
220
|
expectedOutcome: "Outcome 3",
|
|
221
|
+
// CRITICAL: No tcStepID = CREATE NEW step
|
|
167
222
|
},
|
|
168
223
|
],
|
|
169
224
|
removeSteps: [
|
|
@@ -171,20 +226,144 @@ export const TESTCASE_TOOLS = [
|
|
|
171
226
|
],
|
|
172
227
|
isStepUpdated: true,
|
|
173
228
|
},
|
|
174
|
-
expectedOutput: "Steps updated: Step 22 edited, Step3 added, Step 1 removed. tcID/tcVersionID auto-resolved.",
|
|
229
|
+
expectedOutput: "Steps updated: Step 22 edited (tcStepID preserved), Step3 added (no tcStepID), Step 1 removed. tcID/tcVersionID auto-resolved. Existing version modified.",
|
|
175
230
|
},
|
|
176
231
|
{
|
|
177
|
-
description: "
|
|
232
|
+
description: "Create NEW VERSION with updated steps",
|
|
233
|
+
parameters: {
|
|
234
|
+
tcID: 4572654,
|
|
235
|
+
tcVersionID: 5514384,
|
|
236
|
+
tcVersion: 1,
|
|
237
|
+
name: "Add two numbers 2 v2",
|
|
238
|
+
steps: [
|
|
239
|
+
{
|
|
240
|
+
orderId: 1,
|
|
241
|
+
description: "I and u have a calculator",
|
|
242
|
+
inputData: "",
|
|
243
|
+
expectedOutcome: "",
|
|
244
|
+
tcStepID: 38001791,
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
orderId: 2,
|
|
248
|
+
description: "I add 41 and 31",
|
|
249
|
+
inputData: "",
|
|
250
|
+
expectedOutcome: "",
|
|
251
|
+
tcStepID: 38001793,
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
orderId: 3,
|
|
255
|
+
description: "the result should be 72",
|
|
256
|
+
inputData: "",
|
|
257
|
+
expectedOutcome: "",
|
|
258
|
+
tcStepID: 38001792,
|
|
259
|
+
},
|
|
260
|
+
],
|
|
261
|
+
withVersion: true,
|
|
262
|
+
versionComment: "version 2 with preserved steps",
|
|
263
|
+
notruncurrent: true,
|
|
264
|
+
notrunall: true,
|
|
265
|
+
isStepUpdated: false,
|
|
266
|
+
},
|
|
267
|
+
expectedOutput: "New version 2 created with all steps from version 1 preserved. Steps carry forward with their tcStepID values. Version comment added for tracking.",
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
description: "Update only metadata (no steps) - existing version",
|
|
178
271
|
parameters: {
|
|
179
272
|
tcID: 4519260,
|
|
180
273
|
tcVersionID: 5448492,
|
|
181
274
|
updateOnlyMetadata: true,
|
|
182
275
|
name: "New Name",
|
|
183
276
|
},
|
|
184
|
-
expectedOutput: "Metadata updated only. Steps unchanged. tcID/tcVersionID auto-resolved.",
|
|
277
|
+
expectedOutput: "Metadata updated only. Steps unchanged. tcID/tcVersionID auto-resolved. Existing version modified.",
|
|
185
278
|
},
|
|
186
279
|
],
|
|
187
280
|
hints: [
|
|
281
|
+
"CRITICAL - VERSION CREATION vs UPDATE DISTINCTION:",
|
|
282
|
+
"This tool supports TWO MODES using the SAME API endpoint:",
|
|
283
|
+
"",
|
|
284
|
+
"MODE 1: CREATE NEW VERSION (withVersion=true)",
|
|
285
|
+
"- Purpose: Create an incremental version of the test case (e.g., v1 → v2, v2 → v3)",
|
|
286
|
+
"- When to use: User explicitly asks to 'create new version', 'create version 2', 'increment version'",
|
|
287
|
+
"- Required fields: tcID, tcVersionID (of source version), tcVersion (current version number), withVersion=true",
|
|
288
|
+
"- Optional but recommended: versionComment (track what changed), notruncurrent, notrunall",
|
|
289
|
+
"- Behavior: Creates a NEW test case version with incremented version number. Source version remains unchanged.",
|
|
290
|
+
"- Example: If current version is 1, setting withVersion=true creates version 2",
|
|
291
|
+
"- Use cases: Updating test case for new requirements, creating variants for different scenarios, version control",
|
|
292
|
+
"",
|
|
293
|
+
"MODE 2: UPDATE EXISTING VERSION (withVersion=false or omitted)",
|
|
294
|
+
"- Purpose: Modify fields of an EXISTING version without creating a new version",
|
|
295
|
+
"- When to use: User asks to 'update test case', 'modify version X', 'change summary' (without mentioning new version)",
|
|
296
|
+
"- Required fields: tcID, tcVersionID (of version to update)",
|
|
297
|
+
"- Do NOT include: withVersion flag, versionComment, tcVersion",
|
|
298
|
+
"- Behavior: Updates the specified version in-place. No new version is created.",
|
|
299
|
+
"- Example: Updating version 2's summary - only version 2 is modified, no version 3 is created",
|
|
300
|
+
"- Use cases: Fixing typos, updating metadata, modifying steps in existing version",
|
|
301
|
+
"",
|
|
302
|
+
"CRITICAL FIELD UNDERSTANDING:",
|
|
303
|
+
"- tcVersionID: The VERSION ID (numeric identifier) of the version you're working with",
|
|
304
|
+
"- tcVersion: The VERSION NUMBER (1, 2, 3, etc.) - only needed when withVersion=true",
|
|
305
|
+
"- tcID: The TEST CASE ID (remains same across all versions)",
|
|
306
|
+
"- Example: Test case VKMCP-TC-10 (tcID: 4572654) has version 1 (tcVersionID: 5514384, tcVersion: 1)",
|
|
307
|
+
"- When creating version 2 from version 1: Send tcVersionID=5514384 (source), tcVersion=1 (current), withVersion=true",
|
|
308
|
+
"",
|
|
309
|
+
"HOW TO DETERMINE WHICH MODE:",
|
|
310
|
+
"- User says 'create new version' → MODE 1 (withVersion=true)",
|
|
311
|
+
"- User says 'create version 2' → MODE 1 (withVersion=true)",
|
|
312
|
+
"- User says 'update test case with new version' → MODE 1 (withVersion=true)",
|
|
313
|
+
"- User says 'update test case VKMCP-TC-10 summary' → MODE 2 (no withVersion, update existing version)",
|
|
314
|
+
"- User says 'update version 2 summary' → MODE 2 (no withVersion, update existing version 2)",
|
|
315
|
+
"- User says 'change priority of version 1' → MODE 2 (no withVersion, update version 1)",
|
|
316
|
+
"- If ambiguous, ask user: 'Do you want to create a new version or update the existing version?'",
|
|
317
|
+
"",
|
|
318
|
+
"VERSION CREATION WORKFLOW (withVersion=true):",
|
|
319
|
+
"Step 1: Fetch test case details to get current tcID, tcVersionID, and tcVersion",
|
|
320
|
+
"Step 2: Optionally fetch current steps if they need to be preserved/modified",
|
|
321
|
+
"Step 3: Prepare payload with:",
|
|
322
|
+
" - tcID (test case ID)",
|
|
323
|
+
" - tcVersionID (source version ID to create from)",
|
|
324
|
+
" - tcVersion (current version number)",
|
|
325
|
+
" - withVersion: true (CRITICAL flag)",
|
|
326
|
+
" - versionComment (recommended: describe what changed)",
|
|
327
|
+
" - Updated fields (name, description, priority, steps, etc.)",
|
|
328
|
+
" - notruncurrent: true (recommended)",
|
|
329
|
+
" - notrunall: true (recommended)",
|
|
330
|
+
"Step 4: Call update API - a new version will be created with incremented version number",
|
|
331
|
+
"Step 5: New version inherits all fields from source version, with your specified updates applied",
|
|
332
|
+
"",
|
|
333
|
+
"EXISTING VERSION UPDATE WORKFLOW (no withVersion):",
|
|
334
|
+
"Step 1: Fetch test case details to get tcID and tcVersionID of the version to update",
|
|
335
|
+
"Step 2: Prepare payload with:",
|
|
336
|
+
" - tcID (test case ID)",
|
|
337
|
+
" - tcVersionID (version ID to update)",
|
|
338
|
+
" - DO NOT include withVersion, versionComment, or tcVersion",
|
|
339
|
+
" - Only include fields you want to change",
|
|
340
|
+
"Step 3: Call update API - specified version is updated in-place",
|
|
341
|
+
"Step 4: No new version is created, only specified fields are modified",
|
|
342
|
+
"",
|
|
343
|
+
"FIELD MAPPING FOR VERSION CREATION:",
|
|
344
|
+
"When creating a new version, include ALL fields you want the new version to have:",
|
|
345
|
+
"- name: Test case summary (required if different from source)",
|
|
346
|
+
"- description: Test case description (required if different from source)",
|
|
347
|
+
"- priority: Priority ID (get from project info customListObjs.priority[index].id)",
|
|
348
|
+
"- testcaseOwner: Owner ID (get from project info customListObjs.owner[index].id)",
|
|
349
|
+
"- testCaseState: State ID (get from project info customListObjs.testCaseState[index].id)",
|
|
350
|
+
"- testCaseType: Type ID (get from project info customListObjs.testCaseType[index].id)",
|
|
351
|
+
"- testingType: Testing type ID (get from project info customListObjs.testingType[index].id)",
|
|
352
|
+
"- component: Array of component IDs (get from project info customListObjs.component[index].id)",
|
|
353
|
+
"- estimatedTime: Time in seconds (e.g., 7200 for 2 hours)",
|
|
354
|
+
"- steps: Array of step objects (include tcStepID from source version to preserve steps)",
|
|
355
|
+
"- folderPath: Folder path or folder ID",
|
|
356
|
+
"- scope: Usually 'project'",
|
|
357
|
+
"",
|
|
358
|
+
"STEPS HANDLING IN VERSION CREATION:",
|
|
359
|
+
"When creating a new version WITH steps:",
|
|
360
|
+
"- To PRESERVE existing steps: Include them with their original tcStepID values",
|
|
361
|
+
"- To ADD new steps: Include them WITHOUT tcStepID",
|
|
362
|
+
"- To MODIFY steps: Include them with tcStepID and updated description/data",
|
|
363
|
+
"- To REMOVE steps: Include them in removeSteps array",
|
|
364
|
+
"- Set isStepUpdated: true if any steps are modified, added, or removed",
|
|
365
|
+
"- If no steps are included, new version may inherit steps from source (verify with QMetry docs)",
|
|
366
|
+
"",
|
|
188
367
|
"If user provides entityKey (e.g., MAC-TC-1684), first call FETCH_TEST_CASES with a filter on entityKeyId to resolve the tcID and tcVersionID.",
|
|
189
368
|
"To get valid values for priority, owner, component, etc., call the project info tool and use the returned customListObjs IDs.",
|
|
190
369
|
"If the user provides a priority name (e.g. 'Blocker'), fetch project info, find the matching priority in customListObjs.priority[index].name, and use its ID in the payload. If the name is not found, skip the priority field (it is not required) and show a user-friendly message: 'Test case updated without priority, as given priority is not available in the current project.'",
|
|
@@ -194,18 +373,44 @@ export const TESTCASE_TOOLS = [
|
|
|
194
373
|
"If the user provides a test case type name, fetch project info, find the matching type in customListObjs.testCaseType[index].name, and use its ID in the payload as testCaseType. If the name is not found, skip the testCaseType field (it is not required) and show a user-friendly message: 'Test case updated without test case type, as given type is not available in the current project.'",
|
|
195
374
|
"If the user provides a testing type name, fetch project info, find the matching type in customListObjs.testingType[index].name, and use its ID in the payload as testingType. If the name is not found, skip the testingType field (it is not required) and show a user-friendly message: 'Test case updated without testing type, as given testing type is not available in the current project.'",
|
|
196
375
|
"Example: If user says 'Update test case with title \"High priority test case\" and set priority to \"Blocker\"', first call project info, map 'Blocker' to its ID, and use that ID for the priority field in the update payload. If user says 'set priority to \"Urgent\"' and 'Urgent' is not found, skip the priority field and show: 'Test case updated without priority, as given priority is not available in the current project.'",
|
|
197
|
-
"To update test case steps
|
|
198
|
-
"-
|
|
199
|
-
"
|
|
200
|
-
"
|
|
201
|
-
"-
|
|
202
|
-
"-
|
|
203
|
-
"-
|
|
204
|
-
"-
|
|
205
|
-
"
|
|
376
|
+
"CRITICAL: To update test case steps without **Duplication**, use the following rules:",
|
|
377
|
+
"- ANTI-DUPLICATION RULE: The tcStepID field is THE KEY to prevent duplication:",
|
|
378
|
+
" * WITH tcStepID = UPDATE existing step (QMetry modifies the existing step in place)",
|
|
379
|
+
" * WITHOUT tcStepID = CREATE new step (QMetry adds a brand new step)",
|
|
380
|
+
"- For steps to be UPDATED: ALWAYS fetch existing steps first using FETCH_TEST_CASE_STEPS, then include the tcStepID in the step object.",
|
|
381
|
+
"- For steps to be ADDED: omit tcStepID completely in the step object.",
|
|
382
|
+
"- For steps to be REMOVED: add a full removeSteps object for each step to be deleted, matching the removeTestCaseStep interface.",
|
|
383
|
+
"- CRITICAL WARNING - DO NOT ADD UNSOLICITED STEPS:",
|
|
384
|
+
" * ONLY add, edit, or remove steps that the user EXPLICITLY requested",
|
|
385
|
+
" * DO NOT invent, create, or add extra steps based on assumptions or best practices",
|
|
386
|
+
" * DO NOT add 'helpful' steps that the user did not ask for",
|
|
387
|
+
" * When user says 'remove step 1', the result should have (N-1) steps, not N steps with extras",
|
|
388
|
+
" * When user says 'add 1 step', ONLY add that 1 step, nothing more",
|
|
389
|
+
" * When user says 'update step 2', ONLY update step 2, do not add or modify other steps",
|
|
390
|
+
" * If unsure what user wants, ASK first rather than adding steps autonomously",
|
|
391
|
+
"- WORKFLOW TO AVOID DUPLICATION:",
|
|
392
|
+
" 1. Call FETCH_TEST_CASE_STEPS to get all existing steps with their tcStepID values",
|
|
393
|
+
" 2. For steps you want to KEEP/UPDATE: Include them in steps[] WITH their original tcStepID",
|
|
394
|
+
" 3. For steps you want to ADD: Include them in steps[] WITHOUT tcStepID (ONLY if user requested)",
|
|
395
|
+
" 4. For steps you want to REMOVE: Include them in removeSteps[] with full details",
|
|
396
|
+
" 5. Always set isStepUpdated: true if steps are added, updated, or removed",
|
|
397
|
+
" 6. VERIFY your steps array matches user's explicit request (count and content)",
|
|
398
|
+
"- Example: If user says 'Edit step 1 to say ...', FIRST fetch steps to get tcStepID for step 1, THEN include it in the steps array with updated fields and the ORIGINAL tcStepID.",
|
|
399
|
+
"- Example: If user says 'Add a new step after step 2', add EXACTLY ONE new object to steps array with no tcStepID (not multiple steps).",
|
|
400
|
+
"- Example: If user says 'Remove step 3', add the full step object to removeSteps array, including tcStepID and all required fields. Do NOT add replacement steps.",
|
|
401
|
+
"- Example: If test case has 3 steps and user says 'remove step 1', result should have 2 steps (step 2 and step 3 with updated orderIds), NOT 3 steps with extras.",
|
|
402
|
+
"- Example: If user says 'add one mock step', add EXACTLY ONE step (not 2 or 3 steps even if they seem related).",
|
|
403
|
+
"- COMPLETE PAYLOAD EXAMPLE: { tcID: 123, tcVersionID: 456, steps: [{tcStepID: 1001, orderId: 1, description: 'Updated'}, {orderId: 2, description: 'New'}], removeSteps: [{tcStepID: 1002, orderId: 3, ...}], isStepUpdated: true }",
|
|
206
404
|
"- If only metadata is updated (no steps), set updateOnlyMetadata: true and do not include steps/removeSteps.",
|
|
207
|
-
"- Always
|
|
405
|
+
"- Always preserve orderId sequence for proper step ordering.",
|
|
208
406
|
"- If user prompt is ambiguous, ask for clarification or show a user-friendly error.",
|
|
407
|
+
"- WARNING: Omitting tcStepID for existing steps will cause DUPLICATION - the API will create duplicates instead of updating!",
|
|
408
|
+
"- FINAL VERIFICATION BEFORE SENDING REQUEST:",
|
|
409
|
+
" * Count steps in your payload vs what user requested",
|
|
410
|
+
" * If user said 'add 1 step', steps array should have (existing_count + 1) items total",
|
|
411
|
+
" * If user said 'remove 1 step', steps array should have (existing_count - 1) items total, removeSteps should have 1 item",
|
|
412
|
+
" * If user said 'update step X', steps array should have same count as before, with step X's tcStepID preserved",
|
|
413
|
+
" * NEVER include steps the user did not explicitly mention or request",
|
|
209
414
|
"Steps are optional but recommended for manual test cases.",
|
|
210
415
|
"If the user provides a prompt like 'update test case with steps as step 1 - Go to login page, step 2 - give credential, step 3 - go to test case page, step 4 - create test case', LLM should parse each step and convert it into the steps payload array, mapping each step to an object with orderId, description, and optionally inputData and expectedOutcome.",
|
|
211
416
|
"Example mapping: 'step 1 - Go to login page' → { orderId: 1, description: 'Go to login page' }.",
|
|
@@ -214,10 +419,46 @@ export const TESTCASE_TOOLS = [
|
|
|
214
419
|
"UDF fields in steps must match your QMetry custom field configuration.",
|
|
215
420
|
"All IDs (priority, owner, etc.) must be valid for your QMetry instance.",
|
|
216
421
|
"If a custom field is mandatory, include it in the UDF object.",
|
|
217
|
-
"
|
|
422
|
+
"",
|
|
423
|
+
"ADDITIONAL VERSION CREATION GUIDANCE:",
|
|
424
|
+
"- versionComment field: STRONGLY RECOMMENDED when withVersion=true. Helps track why version was created.",
|
|
425
|
+
" Example comments: 'Updated for Sprint 5 requirements', 'Fixed test steps based on code review', 'Version 2 for production environment'",
|
|
426
|
+
"- notruncurrent and notrunall flags: Control execution behavior when creating versions. Set both to true as best practice.",
|
|
427
|
+
"- folderPath: Can be string path or numeric folder ID. Usually inherited from source version if not specified.",
|
|
428
|
+
"- attachments: Use ADD/REMOVE arrays to manage attachments when creating new version or updating existing version.",
|
|
429
|
+
"- estimatedTime vs executionMinutes: Use estimatedTime (in seconds) for version creation. executionMinutes (in minutes) is legacy field.",
|
|
430
|
+
"",
|
|
431
|
+
"REAL-WORLD VERSION CREATION EXAMPLES:",
|
|
432
|
+
"Example 1: User says 'create a new version of test case VKMCP-TC-10 with summary = \"Facebook Login Validation Failed update from MCP V2\", description = used existing description by at last add V2 text, release = default, cycle = default'",
|
|
433
|
+
"→ Workflow:",
|
|
434
|
+
" 1. Fetch VKMCP-TC-10 details to get tcID, tcVersionID, tcVersion, current description",
|
|
435
|
+
" 2. Fetch project info to get default release ID and cycle ID",
|
|
436
|
+
" 3. Append ' V2' to current description",
|
|
437
|
+
" 4. Send payload with: tcID, tcVersionID (source), tcVersion (current), withVersion=true, name='...V2', description='...V2', versionComment='Created version 2', release/cycle IDs",
|
|
438
|
+
"→ Result: New incremental version created (e.g., version 1 → version 2) with updated summary, modified description, associated with default release/cycle",
|
|
439
|
+
"",
|
|
440
|
+
"Example 2: User says 'update version 2 summary, release, cycle, priority'",
|
|
441
|
+
"→ Workflow:",
|
|
442
|
+
" 1. Fetch test case details to get version 2's tcVersionID",
|
|
443
|
+
" 2. Fetch project info to get priority, release, cycle IDs",
|
|
444
|
+
" 3. Send payload with: tcID, tcVersionID (of version 2), WITHOUT withVersion flag, with updated summary, release, cycle, priority",
|
|
445
|
+
"→ Result: Version 2 updated in-place. No new version created. Only specified fields modified.",
|
|
446
|
+
"",
|
|
447
|
+
"COMMON PITFALLS TO AVOID:",
|
|
448
|
+
"- Pitfall 1: Setting withVersion=true when user wants to update existing version → Creates unwanted new version",
|
|
449
|
+
"- Pitfall 2: Omitting versionComment when creating new version → Lost tracking of why version was created",
|
|
450
|
+
"- Pitfall 3: Not fetching current tcVersionID before update → Updating wrong version or causing error",
|
|
451
|
+
"- Pitfall 4: Using tcVersion for normal updates → tcVersion only needed when withVersion=true",
|
|
452
|
+
"- Pitfall 5: Not including tcStepID for steps when creating version → Steps may duplicate instead of preserving",
|
|
453
|
+
"- Pitfall 6: Confusing tcVersionID (version identifier) with tcVersion (version number) → Wrong API payload",
|
|
454
|
+
"",
|
|
455
|
+
"executionMinutes time is in minutes (legacy field).",
|
|
456
|
+
"estimatedTime is in seconds (preferred for version creation).",
|
|
218
457
|
"Description and testingType are optional but recommended for clarity.",
|
|
219
458
|
],
|
|
220
|
-
outputDescription: "JSON object containing the
|
|
459
|
+
outputDescription: "JSON object containing the test case ID, version ID, summary, update/creation metadata. " +
|
|
460
|
+
"When withVersion=true (version creation), response includes new version number and version ID. " +
|
|
461
|
+
"When withVersion=false/omitted (existing version update), response includes updated fields confirmation.",
|
|
221
462
|
readOnly: false,
|
|
222
463
|
idempotent: false,
|
|
223
464
|
},
|
|
@@ -226,12 +467,16 @@ export const TESTCASE_TOOLS = [
|
|
|
226
467
|
summary: "Fetch QMetry test cases - automatically handles viewId resolution based on project",
|
|
227
468
|
handler: QMetryToolsHandlers.FETCH_TEST_CASES,
|
|
228
469
|
inputSchema: TestCaseListArgsSchema,
|
|
229
|
-
purpose: "Get test cases from QMetry
|
|
470
|
+
purpose: "Get LIST of test cases from QMetry for browsing and bulk operations. " +
|
|
471
|
+
"CRITICAL: DO NOT use this tool with filters to fetch a single test case by ID or entityKey! " +
|
|
472
|
+
"Using filters with this API will persist those filters in the production UI, causing only filtered records to be visible. " +
|
|
473
|
+
"For fetching a SINGLE test case by ID or entityKey, ALWAYS use 'Fetch Test Case Details' tool instead. " +
|
|
474
|
+
"System automatically gets correct viewId from project info if not provided.",
|
|
230
475
|
useCases: [
|
|
231
|
-
"List all test cases in a project",
|
|
232
|
-
"
|
|
233
|
-
"
|
|
234
|
-
"
|
|
476
|
+
"List all test cases in a project (without filters)",
|
|
477
|
+
"Browse test cases in specific folders for bulk operations",
|
|
478
|
+
"Get paginated test case results for reporting",
|
|
479
|
+
"Export multiple test cases at once",
|
|
235
480
|
],
|
|
236
481
|
examples: [
|
|
237
482
|
{
|
|
@@ -246,14 +491,14 @@ export const TESTCASE_TOOLS = [
|
|
|
246
491
|
},
|
|
247
492
|
{
|
|
248
493
|
description: "Get test cases with manual viewId (skip auto-resolution)",
|
|
249
|
-
parameters: { projectKey: "MAC", viewId: 167136, folderPath: "" },
|
|
494
|
+
parameters: { projectKey: "MAC", viewId: 167136, folderPath: "" }, // This is an example viewId, must be resolved per project Test Case ViewId
|
|
250
495
|
expectedOutput: "Test cases using manually specified viewId 167136",
|
|
251
496
|
},
|
|
252
497
|
{
|
|
253
498
|
description: "List test cases from specific project (ex: project key can be anything (VT, UT, PROJ1, TEST9)",
|
|
254
499
|
parameters: {
|
|
255
500
|
projectKey: "use specific given project key",
|
|
256
|
-
viewId: "fetch specific project given projectKey Test Case ViewId",
|
|
501
|
+
viewId: "fetch specific project given projectKey Test Case ViewId", // This is an example viewId, must be resolved per project Test Case ViewId
|
|
257
502
|
folderPath: "",
|
|
258
503
|
},
|
|
259
504
|
expectedOutput: "Test cases using manually specified viewId 167136 or projectKey",
|
|
@@ -300,13 +545,31 @@ export const TESTCASE_TOOLS = [
|
|
|
300
545
|
},
|
|
301
546
|
],
|
|
302
547
|
hints: [
|
|
548
|
+
"CRITICAL - FILTER PERSISTENCE WARNING:",
|
|
549
|
+
"DO NOT use this API with filters to fetch a single test case by ID, entityKey, or name!",
|
|
550
|
+
"Filters applied to this API persist in the production UI and cause only filtered records to be visible to users.",
|
|
551
|
+
"This creates a major UX problem where users see incomplete data in their QMetry portal.",
|
|
552
|
+
"",
|
|
553
|
+
"CORRECT APPROACH FOR SINGLE TEST CASE:",
|
|
554
|
+
"When user asks to 'fetch test case VKMCP-TC-5' or 'get test case by ID 123' or 'find test case named X':",
|
|
555
|
+
"1. Ask user for the numeric test case ID (tcID) if not provided",
|
|
556
|
+
"2. Use 'Fetch Test Case Details' tool with the numeric tcID parameter",
|
|
557
|
+
"3. NEVER use 'Fetch Test Cases' with entityKeyId filter for single test case lookup",
|
|
558
|
+
"",
|
|
559
|
+
"WHEN TO USE THIS TOOL:",
|
|
560
|
+
"Only use this tool when user explicitly asks for:",
|
|
561
|
+
"- 'List all test cases'",
|
|
562
|
+
"- 'Show me test cases in folder X'",
|
|
563
|
+
"- 'Get all test cases' (without specifying a single test case)",
|
|
564
|
+
"- 'Export test cases' (for bulk operations)",
|
|
565
|
+
"",
|
|
303
566
|
"CRITICAL WORKFLOW: Always use the SAME projectKey for both project info and test case fetching",
|
|
304
567
|
"Step 1: If user specifies projectKey (like 'UT', 'MAC'), use that EXACT projectKey for project info",
|
|
305
568
|
"Step 2: Get project info using that projectKey, extract latestViews.TC.viewId",
|
|
306
569
|
"Step 3: Use the SAME projectKey and the extracted TC viewId for fetching test cases",
|
|
307
570
|
"Step 4: If user doesn't specify projectKey, use 'default' for both project info and test case fetching",
|
|
308
571
|
"NEVER mix project keys - if user says 'MAC project', use projectKey='MAC' for everything",
|
|
309
|
-
|
|
572
|
+
"DEPRECATED: Do not use filter with entityKeyId for single test case - use 'Fetch Test Case Details' instead",
|
|
310
573
|
"RELEASE/CYCLE FILTERING: Use release and cycle IDs, not names, for filtering",
|
|
311
574
|
'For release filter: \'[{"value":[releaseId],"type":"list","field":"release"}]\'',
|
|
312
575
|
'For cycle filter: \'[{"value":[cycleId],"type":"list","field":"cycle"}]\'',
|
|
@@ -324,15 +587,19 @@ export const TESTCASE_TOOLS = [
|
|
|
324
587
|
},
|
|
325
588
|
{
|
|
326
589
|
title: "Fetch Test Case Details",
|
|
327
|
-
summary: "Get detailed information for a specific QMetry test case by numeric ID",
|
|
590
|
+
summary: "Get detailed information for a specific QMetry test case by numeric ID - USE THIS for single test case lookup",
|
|
328
591
|
handler: QMetryToolsHandlers.FETCH_TEST_CASE_DETAILS,
|
|
329
592
|
inputSchema: TestCaseDetailsArgsSchema,
|
|
330
|
-
purpose: "
|
|
593
|
+
purpose: "PREFERRED TOOL for fetching a SINGLE test case by ID or entityKey. " +
|
|
594
|
+
"Retrieve comprehensive test case information including metadata, status, and basic properties WITHOUT affecting UI filters. " +
|
|
595
|
+
"This tool does NOT persist filters in the production UI, making it safe for single record lookups.",
|
|
331
596
|
useCases: [
|
|
332
|
-
"Get test case details by numeric ID",
|
|
333
|
-
"
|
|
334
|
-
"
|
|
597
|
+
"Get test case details by numeric ID (PREFERRED for single test case)",
|
|
598
|
+
"Fetch test case when user provides entityKey (e.g., 'VKMCP-TC-5')",
|
|
599
|
+
"Retrieve test case metadata for a specific test case",
|
|
600
|
+
"Get test case summary and properties for display or editing",
|
|
335
601
|
"Fetch test case details before accessing steps or version details",
|
|
602
|
+
"Lookup test case by name or ID without affecting UI filters",
|
|
336
603
|
],
|
|
337
604
|
examples: [
|
|
338
605
|
{
|
|
@@ -342,10 +609,15 @@ export const TESTCASE_TOOLS = [
|
|
|
342
609
|
},
|
|
343
610
|
],
|
|
344
611
|
hints: [
|
|
612
|
+
"USE THIS TOOL when user asks to 'fetch test case VKMCP-TC-5' or 'get test case by ID' or 'find test case X'",
|
|
345
613
|
"This API requires a numeric tcID parameter",
|
|
346
|
-
"If user provides entityKey (e.g., MAC-TC-1684),
|
|
347
|
-
"
|
|
614
|
+
"CRITICAL: If user provides entityKey (e.g., MAC-TC-1684), you have TWO options:",
|
|
615
|
+
"Option 1 (RECOMMENDED): Ask user for the numeric test case ID",
|
|
616
|
+
"Option 2: If you must resolve entityKey, use FETCH_TEST_CASES with filter ONLY ONCE, then immediately use this tool",
|
|
617
|
+
"After resolving entityKey → tcID, always use THIS tool (FETCH_TEST_CASE_DETAILS) for subsequent lookups",
|
|
348
618
|
"This tool provides metadata and properties; use FETCH_TEST_CASE_STEPS for step-level details",
|
|
619
|
+
"This tool does NOT persist filters in UI - safe for single test case lookups",
|
|
620
|
+
"ALWAYS prefer this tool over FETCH_TEST_CASES with filters for single test case operations",
|
|
349
621
|
],
|
|
350
622
|
outputDescription: "JSON object with test case details including ID, key, summary, description, and metadata",
|
|
351
623
|
readOnly: true,
|