@nbakka/mcp-appium 3.0.24 → 3.0.26

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/android.js CHANGED
@@ -170,12 +170,16 @@ class AndroidRobot {
170
170
  }
171
171
  return elements;
172
172
  }
173
- async getElementsOnScreen() {
173
+ async getXmlStructure() {
174
174
  const parsedXml = await this.getUiAutomatorXml();
175
- // const hierarchy = parsedXml.hierarchy;
176
- // const elements = this.collectElements(hierarchy.node);
177
175
  return parsedXml;
178
176
  }
177
+ async getElementsOnScreen() {
178
+ const parsedXml = await this.getUiAutomatorXml();
179
+ const hierarchy = parsedXml.hierarchy;
180
+ const elements = this.collectElements(hierarchy.node);
181
+ return elements;
182
+ }
179
183
  async terminateApp(packageName) {
180
184
  this.adb("shell", "am", "force-stop", packageName);
181
185
  }
package/lib/ios.js CHANGED
@@ -124,6 +124,10 @@ class IosRobot {
124
124
  const wda = await this.wda();
125
125
  return await wda.getElementsOnScreen();
126
126
  }
127
+ async getXmlStructure() {
128
+ const wda = await this.wda();
129
+ return await wda.getXmlStructure();
130
+ }
127
131
  async getScreenshot() {
128
132
  await this.assertTunnelRunning();
129
133
  const tmpFilename = path_1.default.join((0, os_1.tmpdir)(), `screenshot-${(0, crypto_1.randomBytes)(8).toString("hex")}.png`);