@nbakka/mcp-appium 3.0.10 → 3.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/server.js +71 -26
- package/package.json +1 -1
package/lib/server.js
CHANGED
|
@@ -837,22 +837,46 @@ tool(
|
|
|
837
837
|
|
|
838
838
|
// Process test cases - handle the specific format properly
|
|
839
839
|
const processedTestCases = testCases.map((testCase, index) => {
|
|
840
|
-
// Each testCase is an array like ["title", "description", "status", "originalCase"]
|
|
841
840
|
if (Array.isArray(testCase)) {
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
841
|
+
const arrayLength = testCase.length;
|
|
842
|
+
|
|
843
|
+
if (arrayLength === 4) {
|
|
844
|
+
// Modify case: ["original title", "new description", "Modify", "SCRUM-TC-1"]
|
|
845
|
+
return {
|
|
846
|
+
originalTitle: testCase[0] || `Test Case ${index + 1}`,
|
|
847
|
+
newDescription: testCase[1] || '',
|
|
848
|
+
status: testCase[2] || 'Modify',
|
|
849
|
+
testId: testCase[3] || '',
|
|
850
|
+
index: index
|
|
851
|
+
};
|
|
852
|
+
} else if (arrayLength === 3) {
|
|
853
|
+
// Remove case: ["title", "Remove", "SCRUM-TC-2"]
|
|
854
|
+
return {
|
|
855
|
+
title: testCase[0] || `Test Case ${index + 1}`,
|
|
856
|
+
status: testCase[1] || 'Remove',
|
|
857
|
+
testId: testCase[2] || '',
|
|
858
|
+
index: index
|
|
859
|
+
};
|
|
860
|
+
} else if (arrayLength === 2) {
|
|
861
|
+
// New case: ["title", "New"]
|
|
862
|
+
return {
|
|
863
|
+
title: testCase[0] || `Test Case ${index + 1}`,
|
|
864
|
+
status: testCase[1] || 'New',
|
|
865
|
+
index: index
|
|
866
|
+
};
|
|
867
|
+
} else {
|
|
868
|
+
// Fallback for unexpected format
|
|
869
|
+
return {
|
|
870
|
+
title: testCase[0] || `Test Case ${index + 1}`,
|
|
871
|
+
status: 'New',
|
|
872
|
+
index: index
|
|
873
|
+
};
|
|
874
|
+
}
|
|
849
875
|
} else {
|
|
850
|
-
// Fallback for
|
|
876
|
+
// Fallback for non-array format
|
|
851
877
|
return {
|
|
852
878
|
title: String(testCase) || `Test Case ${index + 1}`,
|
|
853
|
-
description: '',
|
|
854
879
|
status: 'New',
|
|
855
|
-
originalCase: '',
|
|
856
880
|
index: index
|
|
857
881
|
};
|
|
858
882
|
}
|
|
@@ -864,12 +888,12 @@ tool(
|
|
|
864
888
|
|
|
865
889
|
if (status === 'modify') {
|
|
866
890
|
// For modify cases, show original → changed format
|
|
867
|
-
return
|
|
891
|
+
return `Original: ${testCase.originalTitle}\nChanged to: ${testCase.newDescription}`;
|
|
868
892
|
} else if (status === 'remove') {
|
|
869
|
-
// For remove cases,
|
|
893
|
+
// For remove cases, show the title
|
|
870
894
|
return testCase.title;
|
|
871
895
|
} else {
|
|
872
|
-
// For new cases,
|
|
896
|
+
// For new cases, show the title
|
|
873
897
|
return testCase.title;
|
|
874
898
|
}
|
|
875
899
|
};
|
|
@@ -1176,10 +1200,10 @@ tool(
|
|
|
1176
1200
|
|
|
1177
1201
|
// Create proper label and test ID display for modify/remove cases
|
|
1178
1202
|
let labelAndIdDisplay = '';
|
|
1179
|
-
if (testCase.status.toLowerCase() === 'modify' && testCase.
|
|
1180
|
-
labelAndIdDisplay = `<div style="margin-bottom: 8px; font-weight: 600; color: #856404; font-size: 13px;">Modify - ${testCase.
|
|
1181
|
-
} else if (testCase.status.toLowerCase() === 'remove' && testCase.
|
|
1182
|
-
labelAndIdDisplay = `<div style="margin-bottom: 8px; font-weight: 600; color: #721c24; font-size: 13px;">Remove - ${testCase.
|
|
1203
|
+
if (testCase.status.toLowerCase() === 'modify' && testCase.testId) {
|
|
1204
|
+
labelAndIdDisplay = `<div style="margin-bottom: 8px; font-weight: 600; color: #856404; font-size: 13px;">Modify - ${testCase.testId}</div>`;
|
|
1205
|
+
} else if (testCase.status.toLowerCase() === 'remove' && testCase.testId) {
|
|
1206
|
+
labelAndIdDisplay = `<div style="margin-bottom: 8px; font-weight: 600; color: #721c24; font-size: 13px;">Remove - ${testCase.testId}</div>`;
|
|
1183
1207
|
}
|
|
1184
1208
|
|
|
1185
1209
|
return `
|
|
@@ -1245,7 +1269,9 @@ tool(
|
|
|
1245
1269
|
const status = originalTestCase.status.toLowerCase();
|
|
1246
1270
|
|
|
1247
1271
|
if (status === 'modify') {
|
|
1248
|
-
resetValue =
|
|
1272
|
+
resetValue = 'Original: ' + originalTestCase.originalTitle + '\\nChanged to: ' + originalTestCase.newDescription;
|
|
1273
|
+
} else if (status === 'remove') {
|
|
1274
|
+
resetValue = originalTestCase.title;
|
|
1249
1275
|
} else {
|
|
1250
1276
|
resetValue = originalTestCase.title;
|
|
1251
1277
|
}
|
|
@@ -1275,13 +1301,32 @@ tool(
|
|
|
1275
1301
|
const textarea = el.querySelector('textarea');
|
|
1276
1302
|
const originalTestCase = testCases[index];
|
|
1277
1303
|
|
|
1278
|
-
// Create the updated test case array
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1304
|
+
// Create the updated test case array based on the original format
|
|
1305
|
+
let updatedCase;
|
|
1306
|
+
const status = originalTestCase.status.toLowerCase();
|
|
1307
|
+
|
|
1308
|
+
if (status === 'modify') {
|
|
1309
|
+
// For modify: [updatedContent, newDescription, "Modify", testId]
|
|
1310
|
+
updatedCase = [
|
|
1311
|
+
textarea.value.trim(),
|
|
1312
|
+
originalTestCase.newDescription,
|
|
1313
|
+
originalTestCase.status,
|
|
1314
|
+
originalTestCase.testId
|
|
1315
|
+
];
|
|
1316
|
+
} else if (status === 'remove') {
|
|
1317
|
+
// For remove: [updatedContent, "Remove", testId]
|
|
1318
|
+
updatedCase = [
|
|
1319
|
+
textarea.value.trim(),
|
|
1320
|
+
originalTestCase.status,
|
|
1321
|
+
originalTestCase.testId
|
|
1322
|
+
];
|
|
1323
|
+
} else {
|
|
1324
|
+
// For new: [updatedContent, "New"]
|
|
1325
|
+
updatedCase = [
|
|
1326
|
+
textarea.value.trim(),
|
|
1327
|
+
originalTestCase.status
|
|
1328
|
+
];
|
|
1329
|
+
}
|
|
1285
1330
|
|
|
1286
1331
|
updatedTestCases.push(updatedCase);
|
|
1287
1332
|
}
|