@nbakka/mcp-appium 2.0.71 → 2.0.72
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 +48 -5
- package/package.json +1 -1
package/lib/server.js
CHANGED
|
@@ -613,7 +613,7 @@ tool(
|
|
|
613
613
|
);
|
|
614
614
|
|
|
615
615
|
tool(
|
|
616
|
-
"
|
|
616
|
+
"generate_testcases_from_ticket_data",
|
|
617
617
|
"Generate manual test cases by analyzing PNG design with JIRA requirements",
|
|
618
618
|
{
|
|
619
619
|
jiraSummary: zod_1.z.string().describe("Jira issue summary"),
|
|
@@ -621,6 +621,10 @@ tool(
|
|
|
621
621
|
},
|
|
622
622
|
async ({ jiraSummary, jiraDescription }) => {
|
|
623
623
|
try {
|
|
624
|
+
// Clear the generated test cases file before starting
|
|
625
|
+
const testCasesFilePath = path.join(__dirname, 'generated-testcases.txt');
|
|
626
|
+
await fs.writeFile(testCasesFilePath, ''); // Clear the file
|
|
627
|
+
|
|
624
628
|
// Load OpenAI API key from Desktop/openai.json
|
|
625
629
|
const openaiConfigPath = path.join(os.homedir(), "Desktop", "openai.json");
|
|
626
630
|
const configContent = await fs.readFile(openaiConfigPath, "utf-8");
|
|
@@ -646,7 +650,8 @@ tool(
|
|
|
646
650
|
const pngBuffer = await fs.readFile(pngPath);
|
|
647
651
|
const base64Image = pngBuffer.toString('base64');
|
|
648
652
|
|
|
649
|
-
|
|
653
|
+
// Start OpenAI generation (this will run in background due to timeout)
|
|
654
|
+
client.chat.completions.create({
|
|
650
655
|
model: "gpt-5", // Use GPT-5 model for image analysis
|
|
651
656
|
messages: [{
|
|
652
657
|
role: "user",
|
|
@@ -672,13 +677,51 @@ ${guidelines}`
|
|
|
672
677
|
]
|
|
673
678
|
}],
|
|
674
679
|
max_completion_tokens: 10000
|
|
680
|
+
}).then(async (completion) => {
|
|
681
|
+
// Save test cases to file when generation completes
|
|
682
|
+
const testCases = completion.choices[0].message.content;
|
|
683
|
+
await fs.writeFile(testCasesFilePath, testCases);
|
|
684
|
+
}).catch(async (error) => {
|
|
685
|
+
// Save error to file if generation fails
|
|
686
|
+
await fs.writeFile(testCasesFilePath, `Error generating test cases: ${error.message}`);
|
|
675
687
|
});
|
|
676
688
|
|
|
677
|
-
|
|
689
|
+
return "✅ Test case generation started. Use 'check_testcases_status' tool to check if generation is complete.";
|
|
690
|
+
} catch (err) {
|
|
691
|
+
return `❌ Error starting test case generation: ${err.message}`;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
);
|
|
695
|
+
|
|
696
|
+
tool(
|
|
697
|
+
"check_testcases_status",
|
|
698
|
+
"Check if test cases have been generated and saved to file",
|
|
699
|
+
{},
|
|
700
|
+
async () => {
|
|
701
|
+
try {
|
|
702
|
+
// Wait for 20 seconds before checking
|
|
703
|
+
await new Promise(resolve => setTimeout(resolve, 20000));
|
|
704
|
+
|
|
705
|
+
const testCasesFilePath = path.join(__dirname, 'generated-testcases.txt');
|
|
706
|
+
|
|
707
|
+
// Check if file exists and has content
|
|
708
|
+
try {
|
|
709
|
+
const fileContent = await fs.readFile(testCasesFilePath, 'utf-8');
|
|
710
|
+
|
|
711
|
+
if (fileContent.trim().length === 0) {
|
|
712
|
+
return "❌ Test cases are still being generated. Please wait and try again.";
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
if (fileContent.startsWith('Error generating test cases:')) {
|
|
716
|
+
return `❌ ${fileContent}`;
|
|
717
|
+
}
|
|
678
718
|
|
|
679
|
-
|
|
719
|
+
return `✅ Test cases generated successfully!\n\n${fileContent}`;
|
|
720
|
+
} catch (fileError) {
|
|
721
|
+
return "❌ Test cases file not found or still being created. Please wait and try again.";
|
|
722
|
+
}
|
|
680
723
|
} catch (err) {
|
|
681
|
-
return `❌ Error
|
|
724
|
+
return `❌ Error checking test cases status: ${err.message}`;
|
|
682
725
|
}
|
|
683
726
|
}
|
|
684
727
|
);
|