@nbakka/mcp-appium 3.0.6 → 3.0.7
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 +44 -11
- package/package.json +1 -1
package/lib/server.js
CHANGED
|
@@ -858,6 +858,22 @@ tool(
|
|
|
858
858
|
}
|
|
859
859
|
});
|
|
860
860
|
|
|
861
|
+
// Helper function to get display text for test cases
|
|
862
|
+
const getTestCaseDisplayText = (testCase) => {
|
|
863
|
+
const status = testCase.status.toLowerCase();
|
|
864
|
+
|
|
865
|
+
if (status === 'modify') {
|
|
866
|
+
// For modify cases, show original → changed format
|
|
867
|
+
return `${testCase.title}\n\nOriginal: ${testCase.originalCase || 'Not specified'}\nChanged to: ${testCase.description || 'Not specified'}`;
|
|
868
|
+
} else if (status === 'remove') {
|
|
869
|
+
// For remove cases, just show the title
|
|
870
|
+
return testCase.title;
|
|
871
|
+
} else {
|
|
872
|
+
// For new cases, just show the title
|
|
873
|
+
return testCase.title;
|
|
874
|
+
}
|
|
875
|
+
};
|
|
876
|
+
|
|
861
877
|
// Main review page with proper handling
|
|
862
878
|
app.get('/', (req, res) => {
|
|
863
879
|
try {
|
|
@@ -1154,19 +1170,29 @@ tool(
|
|
|
1154
1170
|
</div>
|
|
1155
1171
|
|
|
1156
1172
|
<div class="test-cases">
|
|
1157
|
-
${processedTestCases.map((testCase, index) =>
|
|
1173
|
+
${processedTestCases.map((testCase, index) => {
|
|
1174
|
+
const displayText = getTestCaseDisplayText(testCase);
|
|
1175
|
+
const statusLabel = testCase.status === 'Remove' ? 'Remove' : testCase.status;
|
|
1176
|
+
const refText = testCase.originalCase && testCase.status.toLowerCase() === 'remove'
|
|
1177
|
+
? `Ref: ${testCase.originalCase}`
|
|
1178
|
+
: testCase.originalCase && testCase.status.toLowerCase() !== 'modify'
|
|
1179
|
+
? `Ref: ${testCase.originalCase}`
|
|
1180
|
+
: '';
|
|
1181
|
+
|
|
1182
|
+
return `
|
|
1158
1183
|
<div class="test-case" data-index="${index}">
|
|
1159
1184
|
<div class="test-case-header">
|
|
1160
1185
|
<div class="test-case-meta">
|
|
1161
1186
|
<span class="test-case-index">#${index + 1}</span>
|
|
1162
|
-
<span class="test-case-status status-${testCase.status.toLowerCase()}">${
|
|
1163
|
-
${
|
|
1187
|
+
<span class="test-case-status status-${testCase.status.toLowerCase()}">${statusLabel}</span>
|
|
1188
|
+
${refText ? `<span style="font-size: 12px; color: #6c757d;">${refText}</span>` : ''}
|
|
1164
1189
|
</div>
|
|
1165
1190
|
<button class="btn btn-delete" onclick="toggleDelete(${index})">Delete</button>
|
|
1166
1191
|
</div>
|
|
1167
|
-
<textarea data-index="${index}" placeholder="Enter test case details...">${
|
|
1192
|
+
<textarea data-index="${index}" placeholder="Enter test case details...">${displayText}</textarea>
|
|
1168
1193
|
</div>
|
|
1169
|
-
|
|
1194
|
+
`;
|
|
1195
|
+
}).join('')}
|
|
1170
1196
|
</div>
|
|
1171
1197
|
</div>
|
|
1172
1198
|
|
|
@@ -1210,7 +1236,17 @@ tool(
|
|
|
1210
1236
|
// Reset textarea value
|
|
1211
1237
|
const textarea = el.querySelector('textarea');
|
|
1212
1238
|
const originalTestCase = testCases[index];
|
|
1213
|
-
|
|
1239
|
+
|
|
1240
|
+
// Use proper display format based on status
|
|
1241
|
+
let resetValue = '';
|
|
1242
|
+
const status = originalTestCase.status.toLowerCase();
|
|
1243
|
+
|
|
1244
|
+
if (status === 'modify') {
|
|
1245
|
+
resetValue = originalTestCase.title + '\\n\\nOriginal: ' + (originalTestCase.originalCase || 'Not specified') + '\\nChanged to: ' + (originalTestCase.description || 'Not specified');
|
|
1246
|
+
} else {
|
|
1247
|
+
resetValue = originalTestCase.title;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1214
1250
|
textarea.value = resetValue;
|
|
1215
1251
|
});
|
|
1216
1252
|
updateStats();
|
|
@@ -1285,11 +1321,8 @@ tool(
|
|
|
1285
1321
|
if (e.target.tagName === 'TEXTAREA') {
|
|
1286
1322
|
const index = parseInt(e.target.getAttribute('data-index'));
|
|
1287
1323
|
if (!isNaN(index) && testCases[index]) {
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
if (stepsIndex !== -1) {
|
|
1291
|
-
testCases[index].description = e.target.value.substring(stepsIndex + 9);
|
|
1292
|
-
}
|
|
1324
|
+
// Update the title with the textarea content
|
|
1325
|
+
testCases[index].title = e.target.value.trim();
|
|
1293
1326
|
}
|
|
1294
1327
|
}
|
|
1295
1328
|
});
|