@smartbear/mcp 0.14.1 → 0.15.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 +1 -1
- package/dist/bugsnag/client.js +5 -30
- package/dist/package.json.js +1 -1
- package/dist/qmetry/client/api/client-api.js +2 -1
- package/dist/qmetry/client/automation.js +2 -1
- package/dist/qmetry/client/tools/testcase-tools.js +269 -1
- package/dist/qmetry/client/tools/testsuite-tools.js +1 -1
- package/dist/reflect/client.js +25 -263
- package/dist/reflect/config/constants.js +6 -0
- package/dist/reflect/tool/suites/cancel-suite-execution.js +50 -0
- package/dist/reflect/tool/suites/execute-suite.js +40 -0
- package/dist/reflect/tool/suites/get-suite-execution-status.js +50 -0
- package/dist/reflect/tool/suites/list-suite-executions.js +40 -0
- package/dist/reflect/tool/suites/list-suites.js +27 -0
- package/dist/reflect/tool/tests/get-test-status.js +42 -0
- package/dist/reflect/tool/tests/list-tests.js +27 -0
- package/dist/reflect/tool/tests/run-test.js +40 -0
- package/dist/zephyr/client.js +35 -1
- package/dist/zephyr/common/rest-api-schemas.js +282 -237
- package/dist/zephyr/tool/folder/create-folder.js +55 -0
- package/dist/zephyr/tool/issue-link/get-test-cases.js +33 -0
- package/dist/zephyr/tool/issue-link/get-test-cycles.js +32 -0
- package/dist/zephyr/tool/issue-link/get-test-executions.js +32 -0
- package/dist/zephyr/tool/test-case/create-issue-link.js +36 -0
- package/dist/zephyr/tool/test-case/create-test-script.js +55 -0
- package/dist/zephyr/tool/test-case/create-test-steps.js +89 -0
- package/dist/zephyr/tool/test-case/get-links.js +32 -0
- package/dist/zephyr/tool/test-case/get-test-script.js +46 -0
- package/dist/zephyr/tool/test-case/get-test-steps.js +54 -0
- package/dist/zephyr/tool/test-cycle/create-issue-link.js +43 -0
- package/dist/zephyr/tool/test-cycle/create-web-link.js +54 -0
- package/dist/zephyr/tool/test-cycle/get-links.js +39 -0
- package/dist/zephyr/tool/test-execution/create-issue-link.js +43 -0
- package/dist/zephyr/tool/test-execution/get-test-execution-links.js +39 -0
- package/dist/zephyr/tool/test-execution/get-test-steps.js +73 -0
- package/dist/zephyr/tool/test-execution/update-test-execution.js +70 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ The [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction)
|
|
|
29
29
|
See individual guides for suggested prompts and supported tools and resources:
|
|
30
30
|
|
|
31
31
|
- [BugSnag](https://developer.smartbear.com/smartbear-mcp/docs/bugsnag-integration) - Comprehensive error monitoring and debugging capabilities
|
|
32
|
-
- [
|
|
32
|
+
- [Reflect](https://developer.smartbear.com/smartbear-mcp/docs/reflect-integration) - Test management and execution capabilities
|
|
33
33
|
- **Swagger**
|
|
34
34
|
- [Portal](https://developer.smartbear.com/smartbear-mcp/docs/swagger-portal-integration) - Portal and product management capabilities
|
|
35
35
|
- [Studio](https://developer.smartbear.com/smartbear-mcp/docs/swagger-studio-integration) - API and Domain management capabilities, including AI-powered API generation from prompts and automatic standardization
|
package/dist/bugsnag/client.js
CHANGED
|
@@ -46,8 +46,7 @@ const ConfigurationSchema = z.object({
|
|
|
46
46
|
});
|
|
47
47
|
class BugsnagClient {
|
|
48
48
|
cache;
|
|
49
|
-
|
|
50
|
-
configuredProjectApiKey;
|
|
49
|
+
_projectApiKey;
|
|
51
50
|
_isConfigured = false;
|
|
52
51
|
_currentUserApi;
|
|
53
52
|
_errorsApi;
|
|
@@ -97,31 +96,7 @@ class BugsnagClient {
|
|
|
97
96
|
this._currentUserApi = new CurrentUserAPI(apiConfig);
|
|
98
97
|
this._errorsApi = new ErrorAPI(apiConfig);
|
|
99
98
|
this._projectApi = new ProjectAPI(apiConfig);
|
|
100
|
-
this.
|
|
101
|
-
try {
|
|
102
|
-
const projects = await this.getProjects();
|
|
103
|
-
if (projects.length === 1 && !this.projectApiKey) {
|
|
104
|
-
this.projectApiKey = projects[0].api_key;
|
|
105
|
-
}
|
|
106
|
-
if (this.projectApiKey) {
|
|
107
|
-
this.configuredProjectApiKey = this.projectApiKey;
|
|
108
|
-
const currentProject = await this.getCurrentProject();
|
|
109
|
-
if (currentProject) {
|
|
110
|
-
await this.getProjectEventFields(currentProject);
|
|
111
|
-
} else {
|
|
112
|
-
this.projectApiKey = void 0;
|
|
113
|
-
console.error(
|
|
114
|
-
"Unable to find your configured BugSnag project, the BugSnag tools will continue to work across all projects in your organization. Check your configured BugSnag project API key."
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
} catch (error) {
|
|
119
|
-
console.error(
|
|
120
|
-
"Unable to connect to BugSnag APIs, the BugSnag tools will not work. Check your configured BugSnag auth token.",
|
|
121
|
-
error
|
|
122
|
-
);
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
99
|
+
this._projectApiKey = config.project_api_key;
|
|
125
100
|
this._isConfigured = true;
|
|
126
101
|
return;
|
|
127
102
|
}
|
|
@@ -195,9 +170,9 @@ class BugsnagClient {
|
|
|
195
170
|
}
|
|
196
171
|
async getCurrentProject() {
|
|
197
172
|
let project = this.cache?.get(cacheKeys.CURRENT_PROJECT) ?? null;
|
|
198
|
-
if (!project && this.
|
|
173
|
+
if (!project && this._projectApiKey) {
|
|
199
174
|
const projects = await this.getProjects();
|
|
200
|
-
project = projects.find((p) => p.api_key === this.
|
|
175
|
+
project = projects.find((p) => p.api_key === this._projectApiKey) ?? null;
|
|
201
176
|
this.cache?.set(cacheKeys.CURRENT_PROJECT, project);
|
|
202
177
|
}
|
|
203
178
|
return project;
|
|
@@ -253,7 +228,7 @@ class BugsnagClient {
|
|
|
253
228
|
if (!maybeProject) {
|
|
254
229
|
throw new ToolError(`Project with ID ${projectId} not found.`);
|
|
255
230
|
}
|
|
256
|
-
if (!this.
|
|
231
|
+
if (!this._projectApiKey) {
|
|
257
232
|
this.cache?.set(cacheKeys.CURRENT_PROJECT, maybeProject);
|
|
258
233
|
}
|
|
259
234
|
return maybeProject;
|
package/dist/package.json.js
CHANGED
|
@@ -13,7 +13,8 @@ async function qmetryRequest({
|
|
|
13
13
|
const headers = {
|
|
14
14
|
apikey: token,
|
|
15
15
|
project: project || QMETRY_DEFAULTS.PROJECT_KEY,
|
|
16
|
-
"User-Agent": `${MCP_SERVER_NAME}/${MCP_SERVER_VERSION}
|
|
16
|
+
"User-Agent": `${MCP_SERVER_NAME}/${MCP_SERVER_VERSION}`,
|
|
17
|
+
"qmetry-source": "smartbear-mcp"
|
|
17
18
|
};
|
|
18
19
|
if (body) {
|
|
19
20
|
headers["Content-Type"] = "application/json";
|
|
@@ -91,7 +91,8 @@ async function importAutomationResults(token, baseUrl, project, payload) {
|
|
|
91
91
|
const headers = {
|
|
92
92
|
apikey: token,
|
|
93
93
|
project: finalPayload.projectID || project || QMETRY_DEFAULTS.PROJECT_KEY,
|
|
94
|
-
"User-Agent": `${MCP_SERVER_NAME}/${MCP_SERVER_VERSION}
|
|
94
|
+
"User-Agent": `${MCP_SERVER_NAME}/${MCP_SERVER_VERSION}`,
|
|
95
|
+
"qmetry-source": "smartbear-mcp"
|
|
95
96
|
// Note: Content-Type will be set automatically by fetch for FormData
|
|
96
97
|
};
|
|
97
98
|
let res;
|
|
@@ -254,7 +254,7 @@ const TESTCASE_TOOLS = [
|
|
|
254
254
|
versionComment: "version 2 with preserved steps",
|
|
255
255
|
notruncurrent: true,
|
|
256
256
|
notrunall: true,
|
|
257
|
-
isStepUpdated:
|
|
257
|
+
isStepUpdated: true
|
|
258
258
|
},
|
|
259
259
|
expectedOutput: "New version 2 created with all steps from version 1 preserved. Steps carry forward with their tcStepID values. Version comment added for tracking."
|
|
260
260
|
},
|
|
@@ -267,6 +267,70 @@ const TESTCASE_TOOLS = [
|
|
|
267
267
|
name: "New Name"
|
|
268
268
|
},
|
|
269
269
|
expectedOutput: "Metadata updated only. Steps unchanged. tcID/tcVersionID auto-resolved. Existing version modified."
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
description: "Create NEW VERSION from existing version 2 with updated steps (working payload for linked test cases)",
|
|
273
|
+
parameters: {
|
|
274
|
+
tcID: 4594145,
|
|
275
|
+
tcVersionID: 5536706,
|
|
276
|
+
tcVersion: 2,
|
|
277
|
+
name: "Mock Test Case - E-commerce Checkout Flow - v3",
|
|
278
|
+
steps: [
|
|
279
|
+
{
|
|
280
|
+
orderId: 1,
|
|
281
|
+
description: "Open browser and navigate to e-commerce website",
|
|
282
|
+
expectedOutcome: "Homepage loads successfully with product catalog",
|
|
283
|
+
inputData: "URL: https://example-shop.com",
|
|
284
|
+
tcStepID: 38129471
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
orderId: 2,
|
|
288
|
+
description: "Search for product",
|
|
289
|
+
expectedOutcome: "Search results display relevant products",
|
|
290
|
+
inputData: "Search term: 'wireless headphones'",
|
|
291
|
+
tcStepID: 38129475
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
orderId: 3,
|
|
295
|
+
description: "Select product and add to cart",
|
|
296
|
+
expectedOutcome: "Product added to cart, cart counter increments",
|
|
297
|
+
inputData: "Click 'Add to Cart' button",
|
|
298
|
+
tcStepID: 38129472
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
orderId: 4,
|
|
302
|
+
description: "Proceed to checkout",
|
|
303
|
+
expectedOutcome: "Checkout page displays with cart summary",
|
|
304
|
+
inputData: "Click cart icon and 'Proceed to Checkout'",
|
|
305
|
+
tcStepID: 38129473
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
orderId: 5,
|
|
309
|
+
description: "Complete payment",
|
|
310
|
+
expectedOutcome: "Order confirmation page displayed",
|
|
311
|
+
inputData: "Fill payment details and submit",
|
|
312
|
+
tcStepID: 38129474
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
orderId: 6,
|
|
316
|
+
description: "Verify order confirmation email received",
|
|
317
|
+
expectedOutcome: "Email with order details received in inbox",
|
|
318
|
+
inputData: "Check email account for confirmation"
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
orderId: 7,
|
|
322
|
+
description: "Check order status in account dashboard",
|
|
323
|
+
expectedOutcome: "Order status shows as 'Processing' with tracking information",
|
|
324
|
+
inputData: "Navigate to My Orders section"
|
|
325
|
+
}
|
|
326
|
+
],
|
|
327
|
+
withVersion: true,
|
|
328
|
+
versionComment: "Created version 3: Added 2 new verification steps (email and order status check)",
|
|
329
|
+
notrunall: false,
|
|
330
|
+
notruncurrent: false,
|
|
331
|
+
scope: "project"
|
|
332
|
+
},
|
|
333
|
+
expectedOutput: "New version 3 created successfully from version 2. Test case now has 7 steps (5 preserved + 2 new). Key: tcVersion=2 was used because version 2 already existed in system. notrunall and notruncurrent both false (not true). Result shows tcVersion: 3 in response with new tcVersionID."
|
|
270
334
|
}
|
|
271
335
|
],
|
|
272
336
|
hints: [
|
|
@@ -444,6 +508,210 @@ const TESTCASE_TOOLS = [
|
|
|
444
508
|
"- Pitfall 5: Not including tcStepID for steps when creating version → Steps may duplicate instead of preserving",
|
|
445
509
|
"- Pitfall 6: Confusing tcVersionID (version identifier) with tcVersion (version number) → Wrong API payload",
|
|
446
510
|
"",
|
|
511
|
+
"CRITICAL ERROR HANDLING: TC.VERSION_NOT_SYNCED FOR LINKED TEST CASES",
|
|
512
|
+
"",
|
|
513
|
+
"PROBLEM: Test cases linked to test suites or with existing executions cannot be updated directly",
|
|
514
|
+
"TRIGGERS:",
|
|
515
|
+
" ✓ Test case is linked to one or more test suites",
|
|
516
|
+
" ✓ Test case has execution history (test runs exist)",
|
|
517
|
+
" ✓ Test case is part of a release/cycle with test runs",
|
|
518
|
+
" ✓ Any step modification when test case has associations",
|
|
519
|
+
"",
|
|
520
|
+
"ERROR CODE: TC.VERSION_NOT_SYNCED",
|
|
521
|
+
"ERROR MESSAGE: 'This Test Case has been associated. Create a new version to save modifications.'",
|
|
522
|
+
"",
|
|
523
|
+
"AUTOMATIC RETRY STRATEGY (IMPLEMENT THIS PATTERN):",
|
|
524
|
+
"When you receive TC.VERSION_NOT_SYNCED error, AUTOMATICALLY retry with version creation:",
|
|
525
|
+
"DO NOT ask user for confirmation - this is expected behavior for associated test cases",
|
|
526
|
+
"",
|
|
527
|
+
"1. FIRST ATTEMPT (Normal Update):",
|
|
528
|
+
" - Try updating with isStepUpdated=true (for step changes) or without withVersion flag",
|
|
529
|
+
" - If error code is TC.VERSION_NOT_SYNCED, proceed to step 2",
|
|
530
|
+
" - If error is different, report the error to user",
|
|
531
|
+
"",
|
|
532
|
+
"2. AUTOMATIC RETRY (Version Creation):",
|
|
533
|
+
" - Use the SAME tcID, tcVersionID, and steps array from first attempt",
|
|
534
|
+
" - Add these flags to payload:",
|
|
535
|
+
" * withVersion: true (CRITICAL - enables version creation)",
|
|
536
|
+
" * tcVersion: <current version number> (get from test case details or executions)",
|
|
537
|
+
" * notrunall: false (use false, not true)",
|
|
538
|
+
" * notruncurrent: false (use false, not true)",
|
|
539
|
+
" * scope: 'project' (always required)",
|
|
540
|
+
" * versionComment: 'Auto-created version due to test suite association' (or custom message)",
|
|
541
|
+
" - Set isStepUpdated: true whenever you modify steps (including when withVersion=true)",
|
|
542
|
+
" - IMPORTANT: Include ALL existing steps with tcStepID + new steps without tcStepID",
|
|
543
|
+
"",
|
|
544
|
+
"3. VERIFICATION:",
|
|
545
|
+
" - Check response for new tcVersionID (will be different from source)",
|
|
546
|
+
" - Verify tcVersion incremented (e.g., 1→2, 2→3)",
|
|
547
|
+
" - Confirm success message: 'Test Case <entityKey> updated successfully'",
|
|
548
|
+
"",
|
|
549
|
+
"UI BEHAVIOR COMPARISON:",
|
|
550
|
+
"QMetry UI shows a popup: 'Save as new version?' with optional comment field",
|
|
551
|
+
"API equivalent: Automatic retry with withVersion=true after detecting TC.VERSION_NOT_SYNCED",
|
|
552
|
+
"",
|
|
553
|
+
"REAL-WORLD EXAMPLE FROM UI PAYLOADS:",
|
|
554
|
+
"",
|
|
555
|
+
"First Attempt (FAILS with TC.VERSION_NOT_SYNCED):",
|
|
556
|
+
"```pseudo",
|
|
557
|
+
"{",
|
|
558
|
+
' "tcID": 4594140,',
|
|
559
|
+
' "tcVersionID": 5536696,',
|
|
560
|
+
' "withVersion": false,',
|
|
561
|
+
' "notrunall": false,',
|
|
562
|
+
' "steps": [',
|
|
563
|
+
" // ... 5 existing steps with tcStepID ...",
|
|
564
|
+
" // ... 1 new step without tcStepID (orderId: 6) ...",
|
|
565
|
+
" ],",
|
|
566
|
+
' "removeSteps": [],',
|
|
567
|
+
' "isStepUpdated": true',
|
|
568
|
+
"}",
|
|
569
|
+
"```",
|
|
570
|
+
"Response: 400 - TC.VERSION_NOT_SYNCED error",
|
|
571
|
+
"",
|
|
572
|
+
"Second Attempt (SUCCEEDS - Creates Version 2):",
|
|
573
|
+
"```pseudo",
|
|
574
|
+
"{",
|
|
575
|
+
' "withVersion": true, // NEW: Version creation flag',
|
|
576
|
+
' "notrunall": false,',
|
|
577
|
+
' "notruncurrent": false,',
|
|
578
|
+
' "steps": [',
|
|
579
|
+
" // SAME steps array as first attempt",
|
|
580
|
+
" // ... 5 existing steps with tcStepID ...",
|
|
581
|
+
" // ... 1 new step without tcStepID ...",
|
|
582
|
+
" ],",
|
|
583
|
+
' "removeSteps": [],',
|
|
584
|
+
' "scope": "project",',
|
|
585
|
+
' "tcID": 4594140, // SAME tcID',
|
|
586
|
+
' "tcVersion": 1, // NEW: Current version number',
|
|
587
|
+
' "tcVersionID": 5536696, // SAME tcVersionID (source version)',
|
|
588
|
+
' "versionComment": "test", // NEW: Version comment (optional)',
|
|
589
|
+
" // NOTE: isStepUpdated field is NOT included when withVersion=true",
|
|
590
|
+
"}",
|
|
591
|
+
"```",
|
|
592
|
+
"Response: 200 - Success, new tcVersionID created (e.g., 5536697), tcVersion=2",
|
|
593
|
+
"",
|
|
594
|
+
"IMPLEMENTATION PSEUDO-CODE:",
|
|
595
|
+
"```typescript",
|
|
596
|
+
"try {",
|
|
597
|
+
" // First attempt: Normal update",
|
|
598
|
+
" const response = await updateTestCase({",
|
|
599
|
+
" tcID, tcVersionID, steps, isStepUpdated: true",
|
|
600
|
+
" });",
|
|
601
|
+
"} catch (error) {",
|
|
602
|
+
" if (error.code === 'TC.VERSION_NOT_SYNCED') {",
|
|
603
|
+
" // Automatic retry with version creation",
|
|
604
|
+
" const testCaseDetails = await fetchTestCaseDetails(tcID);",
|
|
605
|
+
" // CRITICAL: Use the LATEST version number from system",
|
|
606
|
+
" const latestVersion = testCaseDetails.tcVersion; // e.g., 2 if v2 exists",
|
|
607
|
+
" const response = await updateTestCase({",
|
|
608
|
+
" tcID,",
|
|
609
|
+
" tcVersionID, // Same source version",
|
|
610
|
+
" tcVersion: latestVersion, // Use latest version number (not always 1!)",
|
|
611
|
+
" steps, // Same steps array",
|
|
612
|
+
" // DO NOT include isStepUpdated when withVersion=true",
|
|
613
|
+
" withVersion: true, // Enable version creation",
|
|
614
|
+
" notrunall: false, // Use false (verified working value)",
|
|
615
|
+
" notruncurrent: false, // Use false (verified working value)",
|
|
616
|
+
" scope: 'project', // Always required",
|
|
617
|
+
" versionComment: 'Auto-created version due to test suite association'",
|
|
618
|
+
" });",
|
|
619
|
+
" } else {",
|
|
620
|
+
" throw error; // Different error, report to user",
|
|
621
|
+
" }",
|
|
622
|
+
"}",
|
|
623
|
+
"```",
|
|
624
|
+
"",
|
|
625
|
+
"KEY INSIGHTS:",
|
|
626
|
+
"- DO NOT ask user for confirmation - auto-retry is expected behavior",
|
|
627
|
+
"- Use SAME tcVersionID in both attempts (source version for creation)",
|
|
628
|
+
"- Second attempt creates NEW version (tcVersionID changes in response)",
|
|
629
|
+
"- Steps array is IDENTICAL in both attempts",
|
|
630
|
+
"- tcVersion parameter is ONLY in second attempt (withVersion=true)",
|
|
631
|
+
"- This matches QMetry UI behavior where popup auto-triggers version creation",
|
|
632
|
+
"",
|
|
633
|
+
"CRITICAL: INCREMENTAL tcVersion SELECTION RULE",
|
|
634
|
+
"",
|
|
635
|
+
"PROBLEM: When multiple versions exist, which tcVersion should you use?",
|
|
636
|
+
"SOLUTION: Use the VERSION NUMBER of the version you are creating FROM (the latest existing version)",
|
|
637
|
+
"",
|
|
638
|
+
"RULE: When creating a new version, tcVersion must equal the CURRENT LATEST VERSION in the system",
|
|
639
|
+
"",
|
|
640
|
+
"EXAMPLES:",
|
|
641
|
+
"- If only version 1 exists: Use tcVersion: 1 (creates version 2 from v1)",
|
|
642
|
+
"- If version 1 and 2 exist: Use tcVersion: 2 (creates version 3 from v2)",
|
|
643
|
+
"- If version 1, 2, and 3 exist: Use tcVersion: 3 (creates version 4 from v3)",
|
|
644
|
+
"",
|
|
645
|
+
"WORKFLOW TO DETERMINE CORRECT tcVersion:",
|
|
646
|
+
"1. Call FETCH_TEST_CASE_DETAILS or FETCH_TEST_CASE_EXECUTIONS",
|
|
647
|
+
"2. Check the highest tcVersion number in the system",
|
|
648
|
+
"3. Use that number as your tcVersion parameter in the update payload",
|
|
649
|
+
"4. This ensures you're creating from the latest version, not an old one",
|
|
650
|
+
"",
|
|
651
|
+
"REAL-WORLD SCENARIO:",
|
|
652
|
+
"Scenario: Test case VKMCP-TC-43 has version 2 already created in UI",
|
|
653
|
+
"Wrong Approach (will fail): tcVersion: 1, withVersion: true → TC.VERSION_NOT_SYNCED error",
|
|
654
|
+
"Correct Approach (will succeed): tcVersion: 2, withVersion: true → Creates version 3 successfully",
|
|
655
|
+
"",
|
|
656
|
+
"VERIFIED WORKING PAYLOAD (from user's Postman testing):",
|
|
657
|
+
"```json",
|
|
658
|
+
"{",
|
|
659
|
+
' "notrunall": false,',
|
|
660
|
+
' "notruncurrent": false,',
|
|
661
|
+
' "scope": "project",',
|
|
662
|
+
' "tcID": 4594145,',
|
|
663
|
+
' "tcVersion": 2, // KEY: Use version 2 because v2 already exists',
|
|
664
|
+
' "tcVersionID": 5536706, // Source version ID (stays same)',
|
|
665
|
+
' "versionComment": "Added new steps", // Describes what changed',
|
|
666
|
+
' "withVersion": true, // Enable version creation',
|
|
667
|
+
' "steps": [',
|
|
668
|
+
" // 5 existing steps with tcStepID (preserved from source)",
|
|
669
|
+
" // 2 new steps without tcStepID (to be added)",
|
|
670
|
+
" ]",
|
|
671
|
+
"}",
|
|
672
|
+
"```",
|
|
673
|
+
"Result: New version 3 created successfully with 7 total steps",
|
|
674
|
+
"",
|
|
675
|
+
"DEFAULT VALUES FOR TC.VERSION_NOT_SYNCED RETRIES (THIS PATTERN):",
|
|
676
|
+
"- notrunall: false - For this retry pattern, override any usual `true` default",
|
|
677
|
+
"- notruncurrent: false - For this retry pattern, override any usual `true` default",
|
|
678
|
+
'- scope: "project" - Always use this',
|
|
679
|
+
"- withVersion: true - Required when creating a new version (both initial and retries)",
|
|
680
|
+
"",
|
|
681
|
+
"WHEN TO APPLY THIS PATTERN:",
|
|
682
|
+
"✓ Adding steps to test case linked to test suite",
|
|
683
|
+
"✓ Editing steps in test case with existing executions",
|
|
684
|
+
"✓ Removing steps from associated test case",
|
|
685
|
+
"✓ Any modification to steps when TC.VERSION_NOT_SYNCED occurs",
|
|
686
|
+
"✓ When creating new versions from existing versions (always check latest version number)",
|
|
687
|
+
"",
|
|
688
|
+
"WHEN NOT TO APPLY:",
|
|
689
|
+
"✗ Test case is NOT linked to test suite (normal update works)",
|
|
690
|
+
"✗ Only updating metadata (name, priority, etc.) without steps",
|
|
691
|
+
"✗ Different error codes (handle appropriately)",
|
|
692
|
+
"",
|
|
693
|
+
"BENEFITS OF THIS APPROACH:",
|
|
694
|
+
"1. Seamless UX - LLM handles version creation automatically",
|
|
695
|
+
"2. Matches UI behavior - no manual intervention needed",
|
|
696
|
+
"3. Preserves test history - creates proper version trail",
|
|
697
|
+
"4. Maintains test suite linkage - version creation preserves associations",
|
|
698
|
+
"5. Handles incremental versions correctly - uses latest version as source",
|
|
699
|
+
"",
|
|
700
|
+
"🎯 GRACEFUL HANDLING SUMMARY:",
|
|
701
|
+
"",
|
|
702
|
+
"When adding/editing/removing steps from test cases:",
|
|
703
|
+
"1. Always TRY normal update first (without withVersion flag)",
|
|
704
|
+
"2. If TC.VERSION_NOT_SYNCED error received:",
|
|
705
|
+
" - Fetch latest version number from test case details/executions",
|
|
706
|
+
" - Automatically retry with withVersion=true + correct tcVersion",
|
|
707
|
+
" - Use notrunall=false, notruncurrent=false, scope='project'",
|
|
708
|
+
" - Include version comment describing the changes",
|
|
709
|
+
"3. Report success with new version details to user",
|
|
710
|
+
"4. NEVER ask for confirmation - handle it transparently",
|
|
711
|
+
"",
|
|
712
|
+
"This ensures test cases with executions or suite associations are handled gracefully",
|
|
713
|
+
"without user intervention, matching the QMetry UI experience exactly.",
|
|
714
|
+
"",
|
|
447
715
|
"executionMinutes time is in minutes (legacy field).",
|
|
448
716
|
"estimatedTime is in seconds (preferred for version creation).",
|
|
449
717
|
"Description and testingType are optional but recommended for clarity."
|
|
@@ -947,7 +947,7 @@ const TESTSUITE_TOOLS = [
|
|
|
947
947
|
hints: [
|
|
948
948
|
"CRITICAL: entityIDs, entityType, qmTsRunId, and runStatusID are REQUIRED parameters",
|
|
949
949
|
"",
|
|
950
|
-
"
|
|
950
|
+
"CRITICAL - ALWAYS FETCH STATUS IDs FROM PROJECT INFO:",
|
|
951
951
|
"NEVER use hardcoded or memorized status IDs. Status IDs are PROJECT-SPECIFIC and must be fetched dynamically.",
|
|
952
952
|
"MANDATORY WORKFLOW BEFORE USING runStatusID:",
|
|
953
953
|
"1. Call mcp_smartbear_qmetry_fetch_qmetry_project_info with the current projectKey",
|