@nbakka/mcp-appium 2.0.71 → 2.0.73
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 +108 -5
- package/lib/testcases-generation-context.txt +4 -1
- package/package.json +1 -1
package/lib/server.js
CHANGED
|
@@ -613,7 +613,67 @@ tool(
|
|
|
613
613
|
);
|
|
614
614
|
|
|
615
615
|
tool(
|
|
616
|
-
"
|
|
616
|
+
"fetch_testcases_from_tcms",
|
|
617
|
+
"Fetch test cases from TCMS tool for a specific folder",
|
|
618
|
+
{
|
|
619
|
+
projectKey: zod_1.z.string().describe("The project key (e.g., SCRUM)"),
|
|
620
|
+
folderName: zod_1.z.string().describe("The folder name to filter test cases (e.g., PDP)")
|
|
621
|
+
},
|
|
622
|
+
async ({ projectKey, folderName }) => {
|
|
623
|
+
try {
|
|
624
|
+
// Load AIO token from Desktop/aio.json
|
|
625
|
+
const aioConfigPath = path.join(os.homedir(), "Desktop", "aio.json");
|
|
626
|
+
const configContent = await fs.readFile(aioConfigPath, "utf-8");
|
|
627
|
+
const { token } = JSON.parse(configContent);
|
|
628
|
+
|
|
629
|
+
if (!token) throw new Error("AIO token missing in aio.json");
|
|
630
|
+
|
|
631
|
+
// Make API request to TCMS
|
|
632
|
+
const response = await axios.get(
|
|
633
|
+
`https://tcms.aiojiraapps.com/aio-tcms/api/v1/project/${projectKey}/testcase`,
|
|
634
|
+
{
|
|
635
|
+
headers: {
|
|
636
|
+
"accept": "application/json;charset=utf-8",
|
|
637
|
+
"Authorization": `AioAuth ${token}`
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
);
|
|
641
|
+
|
|
642
|
+
const testCases = response.data.items || [];
|
|
643
|
+
|
|
644
|
+
// Filter test cases by folder name
|
|
645
|
+
const filteredTestCases = testCases.filter(testCase =>
|
|
646
|
+
testCase.folder && testCase.folder.name === folderName
|
|
647
|
+
);
|
|
648
|
+
|
|
649
|
+
if (filteredTestCases.length === 0) {
|
|
650
|
+
return `No test cases found in folder: ${folderName}`;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
// Extract key, title, and folder name
|
|
654
|
+
const extractedTestCases = filteredTestCases.map(testCase => ({
|
|
655
|
+
key: testCase.key,
|
|
656
|
+
title: testCase.title,
|
|
657
|
+
folderName: testCase.folder.name
|
|
658
|
+
}));
|
|
659
|
+
|
|
660
|
+
return {
|
|
661
|
+
folderName: folderName,
|
|
662
|
+
totalCount: extractedTestCases.length,
|
|
663
|
+
testCases: extractedTestCases
|
|
664
|
+
};
|
|
665
|
+
|
|
666
|
+
} catch (err) {
|
|
667
|
+
if (err.response) {
|
|
668
|
+
return `❌ TCMS API Error: ${err.response.status} - ${err.response.data?.message || err.response.statusText}`;
|
|
669
|
+
}
|
|
670
|
+
return `❌ Error fetching test cases: ${err.message}`;
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
);
|
|
674
|
+
|
|
675
|
+
tool(
|
|
676
|
+
"generate_testcases_from_ticket_data",
|
|
617
677
|
"Generate manual test cases by analyzing PNG design with JIRA requirements",
|
|
618
678
|
{
|
|
619
679
|
jiraSummary: zod_1.z.string().describe("Jira issue summary"),
|
|
@@ -621,6 +681,10 @@ tool(
|
|
|
621
681
|
},
|
|
622
682
|
async ({ jiraSummary, jiraDescription }) => {
|
|
623
683
|
try {
|
|
684
|
+
// Clear the generated test cases file before starting
|
|
685
|
+
const testCasesFilePath = path.join(__dirname, 'generated-testcases.txt');
|
|
686
|
+
await fs.writeFile(testCasesFilePath, ''); // Clear the file
|
|
687
|
+
|
|
624
688
|
// Load OpenAI API key from Desktop/openai.json
|
|
625
689
|
const openaiConfigPath = path.join(os.homedir(), "Desktop", "openai.json");
|
|
626
690
|
const configContent = await fs.readFile(openaiConfigPath, "utf-8");
|
|
@@ -646,7 +710,8 @@ tool(
|
|
|
646
710
|
const pngBuffer = await fs.readFile(pngPath);
|
|
647
711
|
const base64Image = pngBuffer.toString('base64');
|
|
648
712
|
|
|
649
|
-
|
|
713
|
+
// Start OpenAI generation (this will run in background due to timeout)
|
|
714
|
+
client.chat.completions.create({
|
|
650
715
|
model: "gpt-5", // Use GPT-5 model for image analysis
|
|
651
716
|
messages: [{
|
|
652
717
|
role: "user",
|
|
@@ -672,13 +737,51 @@ ${guidelines}`
|
|
|
672
737
|
]
|
|
673
738
|
}],
|
|
674
739
|
max_completion_tokens: 10000
|
|
740
|
+
}).then(async (completion) => {
|
|
741
|
+
// Save test cases to file when generation completes
|
|
742
|
+
const testCases = completion.choices[0].message.content;
|
|
743
|
+
await fs.writeFile(testCasesFilePath, testCases);
|
|
744
|
+
}).catch(async (error) => {
|
|
745
|
+
// Save error to file if generation fails
|
|
746
|
+
await fs.writeFile(testCasesFilePath, `Error generating test cases: ${error.message}`);
|
|
675
747
|
});
|
|
676
748
|
|
|
677
|
-
|
|
749
|
+
return "✅ Test case generation started. Use 'check_testcases_status' tool to check if generation is complete.";
|
|
750
|
+
} catch (err) {
|
|
751
|
+
return `❌ Error starting test case generation: ${err.message}`;
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
);
|
|
755
|
+
|
|
756
|
+
tool(
|
|
757
|
+
"check_testcases_status",
|
|
758
|
+
"Check if test cases have been generated and saved to file",
|
|
759
|
+
{},
|
|
760
|
+
async () => {
|
|
761
|
+
try {
|
|
762
|
+
// Wait for 20 seconds before checking
|
|
763
|
+
await new Promise(resolve => setTimeout(resolve, 20000));
|
|
764
|
+
|
|
765
|
+
const testCasesFilePath = path.join(__dirname, 'generated-testcases.txt');
|
|
766
|
+
|
|
767
|
+
// Check if file exists and has content
|
|
768
|
+
try {
|
|
769
|
+
const fileContent = await fs.readFile(testCasesFilePath, 'utf-8');
|
|
678
770
|
|
|
679
|
-
|
|
771
|
+
if (fileContent.trim().length === 0) {
|
|
772
|
+
return "❌ Test cases are still being generated. Please wait and try again.";
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
if (fileContent.startsWith('Error generating test cases:')) {
|
|
776
|
+
return `❌ ${fileContent}`;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
return `✅ Test cases generated successfully!\n\n${fileContent}`;
|
|
780
|
+
} catch (fileError) {
|
|
781
|
+
return "❌ Test cases file not found or still being created. Please wait and try again.";
|
|
782
|
+
}
|
|
680
783
|
} catch (err) {
|
|
681
|
-
return `❌ Error
|
|
784
|
+
return `❌ Error checking test cases status: ${err.message}`;
|
|
682
785
|
}
|
|
683
786
|
}
|
|
684
787
|
);
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
generate test cases using jira summary, description and figma image,
|
|
2
|
-
don't
|
|
2
|
+
don't wait for extra user input,
|
|
3
|
+
test cases scope should be only for the changes mentioned in jira summary and description,
|
|
4
|
+
don't create test cases for other features visible in figma design because the design will also
|
|
5
|
+
have other features which are not part of the jira ticket,
|
|
3
6
|
final output should be test in following format
|
|
4
7
|
"Verify pay on credit banner exits on PDP", "Existing"
|
|
5
8
|
"Verify overview tab on PDP", "New"
|