@nbakka/mcp-appium 3.0.19 → 3.0.20

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.
@@ -1,106 +1,70 @@
1
1
  ******** START OF GUIDELINES ********
2
- You are an expert Appium test case generator. You will be given a set of instructions to follow to reach a certain goal in the app. You have to generate Appium code based on the elements you find on the screen while navigating through the app.
3
- When asked to open buy SRP, use deeplink to open https://housing.com/in/buy/mumbai/<locality name>. For example: if asked to open 'Mira Road East' buy SRP, then open this deeplink: https://housing.com/in/buy/mumbai/mira_road_east
4
- Homepage deeplink -> https://housing.com/in/buy/real-estate-mumbai
5
- Only use the locator data from the Google Sheet at the end while generating test cases, don't use to navigate through screens, always get current screen elements and navigate then at end use locator data to generate code, if xpath is already present in sheet then directly add xpath locatorName to code if not then add the required xpath in comments which will then be added to the sheet manually
6
- Project dedicated page deeplink -> https://housing.com/in/buy/projects/page/16192-lotus-sky-garden-by-a-m-construction-and-lotus-group-in-malad-west
7
- Filters on the filter screen may initially be offscreen and require scrolling to view.
8
- Stop execution if any step fails.
9
- IMPORTANT: If the element you looking for is not present you can use swipe
10
- (Remember this properly - Very important) After the execution is successful/completed, do NOT analyze what you found or did; only generate Appium code.
11
- - waitForElementToBeVisible("locator_key", Wait.SHORT); locator_key is locator key and wait can be SHORT, MEDIUM, or LONG.
12
- - w3CGestures.scrollUp(n); // n is the number of times to scroll. Up and Down in scroll methods are direction of finger movement.
13
- - w3CGestures.scrollScreen("image_tour_navbar", ScrollDirection.MEDIUM_UP, 2); // image_tour_navbar is locator key, ScrollDirection can be SMALL_UP, MEDIUM_UP, LARGE_UP, SMALL_DOWN, MEDIUM_DOWN, LARGE_DOWN and 2 is max number of scrolls to perform, if not found in 2 scrolls then it will throw error. (DO NOT USE other methods except these two for scrolling)
14
- - navigateBack(); // for back action.
15
- - deepLink.OpenDeepLink("deeplink_key"); // deeplink_key is deeplink name.
16
- - getText("locator_key"); // to get text of element.
17
- - click("search_select", Wait.SHORT)
18
- - sendKeys("locator_key", "string_to_be_passed", Wait.SHORT)
19
- Figure out dynamic paths like //android.widget.TextView[@text="View 180 Properties"] here 180 is not constant so create a xpath like //android.widget.TextView[contains(@text,"View") and contains(@text,"Properties")]
20
- For repeating logic, create loops
21
- No need to add comments in code and only mention locators that are new and not present in the locator sheet in comments at end of file as shown in sample code below.
22
- Automation code has to be generated only for approved test cases
23
- ** SAMPLE TESTCASES Automation code has to be generated only for approved test cases**
24
- /**
25
- * Test Method for Nearby Properties Verification on New Project Dedicated Page
26
- * Verifies that clicking on nearby properties opens the correct detail page
27
- */
2
+ Use mobile-mcp.
3
+ Navigate and explore the Housing app using the provided deeplink to validate, refine, and update the existing rough test scenarios.
4
+ If the app cannot be navigated for a certain scenario (e.g., UI element not reachable, deeplink not loading, or navigation gets stuck), then generate the test cases based on the partial understanding achieved + standard expected Housing app behavior.
28
5
 
29
- @Test(priority = 19, dataProvider = "test-data", dataProviderClass = TestDataProvider.class)
30
- @Description("Test Description: Verify nearby properties functionality on new project dedicated page")
31
- public void npNearbyPropertiesVerification(HashMap<String, String> testData) {
32
- detailPage.npNearbyPropertiesVerification(testData.get("np_dedicated_deeplink"));
33
- }
6
+ Rewrite every rough test case into clean, modernized test cases using this structure:
34
7
 
35
8
  /**
36
- * Method Definition for DetailPage.java
37
- * Add this method to the DetailPage class
9
+ * TEST CASE <number>:
10
+ * * SUMMARY:
11
+ * <Short high-level explanation of what is being validated>
12
+ * * SEVERITY:
13
+ * <Low / Medium / High / Critical>
14
+ * * TEST DATA:
15
+ * - Deeplink: https://housing.com/in/buy/projects/page/292551-treesourus-by-chandak-group-in-malad-west
16
+ * * TEST STEPS:
17
+ * 1. <step>
18
+ * 2. <step>
19
+ * ...
20
+ * * EXPECTED RESULTS:
21
+ * - <expected result 1>
22
+ * - <expected result 2>
38
23
  */
39
24
 
40
- public void npNearbyPropertiesVerification(String deeplink) {
41
- deepLink.OpenDeepLink(deeplink);
42
- if (waitForElementToBePresent("later_btn", Wait.SHORT)) {
43
- click("later_btn");
44
- }
45
- waitForElementToBeVisible("project_name", Wait.LONG);
46
- waitForElementToBeVisible("Overview", Wait.SHORT);
47
- w3CGestures.scrollScreen("high_value_project_title", ScrollDirection.MEDIUM_UP, 2);
48
- waitForElementToBeVisible("high_value_project_title", Wait.SHORT);
49
- String nearbyProjectsTitle = getElement("high_value_project_title").getText();
50
- Assert.assertTrue(nearbyProjectsTitle.contains("Premium projects nearby"),
51
- "Expected nearby projects section title to contain 'Premium projects nearby' but found: " + nearbyProjectsTitle);
52
- w3CGestures.scrollScreen("near_by_project_name1", ScrollDirection.MEDIUM_UP, 2);
53
- waitForElementToBeVisible("near_by_project_name1", Wait.SHORT);
54
- waitForElementToBeVisible("near_by_project_price1", Wait.SHORT);
55
- String expectedPropertyName = getElement("near_by_project_name1").getText();
56
- String expectedPropertyPrice = getElement("near_by_project_price1").getText();
57
- System.out.println("Expected Property Name: " + expectedPropertyName);
58
- System.out.println("Expected Property Price: " + expectedPropertyPrice);
59
- click("nearby_high_value_project1");
60
- waitForElementToBeVisible("project_name", Wait.LONG);
61
- waitForElementToBeVisible("project_price", Wait.SHORT);
62
- String actualPropertyName = getElement("project_name").getText();
63
- String actualPropertyPrice = getElement("project_price").getText();
64
- System.out.println("Actual Property Name: " + actualPropertyName);
65
- System.out.println("Actual Property Price: " + actualPropertyPrice);
66
- Assert.assertEquals(actualPropertyName, expectedPropertyName,
67
- "Property name mismatch. Expected: " + expectedPropertyName + " but found: " + actualPropertyName);
68
- Assert.assertEquals(actualPropertyPrice, expectedPropertyPrice,
69
- "Property price mismatch. Expected: " + expectedPropertyPrice + " but found: " + actualPropertyPrice);
70
- waitForElementToBeVisible("Overview", Wait.SHORT);
71
- waitForElementToBeVisible("Highlights", Wait.SHORT);
72
- waitForElementToBeVisible("Property Tour", Wait.SHORT);
73
- System.out.println("✓ Nearby properties verification completed successfully");
74
- System.out.println("✓ Property '" + expectedPropertyName + "' opened correctly with matching price: " + expectedPropertyPrice);
75
- }
25
+ Rules:
26
+ - Clean up, merge, and modernize outdated or rough test cases.
27
+ - Explore using mobile-mcp to verify flows and correct missing details.
28
+ - Always specify the exact order of UI elements (icons, tabs, instant links, buttons).
29
+ - When describing interactions, mention expected user-visible behavior (UI change, navigation, toggles, dialogs).
30
+ - If navigation is not fully possible, infer expected behavior and generate the most accurate test cases.
31
+ - Output only the test case blocks in the above format.
32
+ - Final output must be suitable for aicode.txt.
33
+
34
+
35
+ ==========================
36
+ EXAMPLE (follow EXACT style)
37
+ ==========================
76
38
 
77
39
  /**
78
- * Additional Locators to be added to the locator sheet or properties file:
79
- *
80
- * # Nearby Projects Section Locators
81
- * high_value_project_title=//android.widget.TextView[@text[contains(.,'Premium projects nearby')]]
82
- * high_value_project_section=//android.view.View[@content-desc='high_value_project_section']
83
- * near_by_project_name1=//android.widget.TextView[@content-desc='near_by_project_name1']
84
- * near_by_project_price1=//android.widget.TextView[@content-desc='near_by_project_price1']
85
- * near_by_project_name2=//android.widget.TextView[@content-desc='near_by_project_name2']
86
- * near_by_project_price2=//android.widget.TextView[@content-desc='near_by_project_price2']
87
- * near_by_project_name3=//android.widget.TextView[@content-desc='near_by_project_name3']
88
- * near_by_project_price3=//android.widget.TextView[@content-desc='near_by_project_price3']
89
- * near_by_project_name4=//android.widget.TextView[@content-desc='near_by_project_name4']
90
- * near_by_project_price4=//android.widget.TextView[@content-desc='near_by_project_price4']
91
- * nearby_high_value_project1=//android.view.View[@content-desc='nearby_high_value_project1']
92
- * nearby_high_value_project2=//android.view.View[@content-desc='nearby_high_value_project2']
93
- * nearby_high_value_project3=//android.view.View[@content-desc='nearby_high_value_project3']
94
- * nearby_high_value_project4=//android.view.View[@content-desc='nearby_high_value_project4']
95
- * project_name=//android.widget.TextView[@content-desc='project_name']
96
- * project_price=//android.widget.TextView[@content-desc='project_price']
97
- * project_address=//android.widget.TextView[@content-desc='project_address']
98
- * project_config=//android.widget.TextView[@content-desc='project_config']
99
- * later_btn=//android.widget.TextView[@text='Later']
100
- * Overview=//android.widget.TextView[@text='Overview']
101
- * Highlights=//android.widget.TextView[@text='Highlights']
102
- * Property Tour=//android.widget.TextView[@text='Property Tour']
103
- * Data Insights=//android.widget.TextView[@text='Data Insights']
40
+ * TEST CASE 1:
41
+ * * SUMMARY:
42
+ * Validate visibility, order, and interaction behavior of header icons (Back, Share, Save/Shortlist, Chat) on the Project Detail Page.
43
+ * * SEVERITY:
44
+ * High
45
+ * * TEST DATA:
46
+ * - Deeplink: https://housing.com/in/buy/projects/page/292551-treesourus-by-chandak-group-in-malad-west
47
+ * * TEST STEPS:
48
+ * 1. Open the PDP using the provided deeplink.
49
+ * 2. Wait for the screen to load completely.
50
+ * 3. Verify the header displays icons in the following exact order (left to right):
51
+ * - Back icon (far left)
52
+ * - Project Name (center when applicable)
53
+ * - Share icon
54
+ * - Save/Shortlist icon
55
+ * - Chat/Contact icon (if present in header or floating)
56
+ * 4. Validate that Share and Save/Shortlist icons appear adjacent to each other.
57
+ * 5. Tap the Share icon and verify that the system share sheet opens with available share targets.
58
+ * 6. Tap the Save/Shortlist icon and verify:
59
+ * - Icon changes state (filled vs. unfilled)
60
+ * - Property is added/removed from user’s shortlist
61
+ * 7. Locate the Chat/Contact icon and tap it.
62
+ * 8. Verify that interaction opens the expected contact flow (Developer chat screen, call options, or lead form).
63
+ * * EXPECTED RESULTS:
64
+ * - Header icons appear in the correct order as per Housing app UI patterns.
65
+ * - Share opens device share options without delay.
66
+ * - Save/Shortlist toggles between saved/unsaved state with visual feedback.
67
+ * - Chat/Contact opens the correct communication interface.
68
+ */
104
69
 
105
- ** END OF SAMPLE FILE **
106
70
  ******** END OF GUIDELINES ********
package/lib/server.js CHANGED
@@ -215,6 +215,33 @@ const createMcpServer = () => {
215
215
  }
216
216
  );
217
217
 
218
+ tool(
219
+ "mobile_learn_testcases_context",
220
+ "Reads previously saved app context notes and returns them so they can be used to validate or update test cases. This should be executed before generating manual test cases.",
221
+ {},
222
+ async () => {
223
+ try {
224
+ // Read app context notes from file
225
+ const notesFilePath = path.join(__dirname, "app_context.txt");
226
+ const fileContent = await fs.readFile(notesFilePath, "utf-8");
227
+
228
+ const notes = fileContent
229
+ .split("\n")
230
+ .map(line => line.trim())
231
+ .filter(line => line.length > 0);
232
+
233
+ if (notes.length === 0) {
234
+ return "No app context notes found.";
235
+ }
236
+
237
+ return `App context loaded for testcase generation: ${JSON.stringify({ notes })}`;
238
+ } catch (error) {
239
+ return `Error reading app context notes: ${error.message}`;
240
+ }
241
+ }
242
+ );
243
+
244
+
218
245
  tool("mobile_list_elements_on_screennn", "List elements on screen and their coordinates, with display text or accessibility label. Returns the complete XML structure to maintain hierarchy for XPath creation. Do not cache this result.", {}, async ({}) => {
219
246
  requireRobot();
220
247
  const xmlStructure = await robot.getElementsOnScreen();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nbakka/mcp-appium",
3
- "version": "3.0.19",
3
+ "version": "3.0.20",
4
4
  "description": "Appium MCP",
5
5
  "engines": {
6
6
  "node": ">=18"