appium-uiautomator2-driver 6.7.5 → 6.7.6

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 +1 @@
1
- {"version":3,"file":"gestures.d.ts","sourceRoot":"","sources":["../../../lib/commands/gestures.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,oGATW,MAAM,MAIN,MAAM,MACN,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAYzB;AAED;;;;;;;;;;;;;;GAcG;AACH,wGAXW,MAAM,MAIN,MAAM,MACN,MAAM,aACN,MAAM,GAEJ,OAAO,CAAC,IAAI,CAAC,CAazB;AAED;;;;;;;;;;;GAWG;AACH,0GATW,MAAM,MAIN,MAAM,MACN,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAYzB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,mGAdW,MAAM,WAIN,MAAM,WACN,MAAM,SACN,MAAM,SACN,MAAM,UACN,MAAM,GAGJ,OAAO,CAAC,IAAI,CAAC,CAqBzB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,mGAfW,MAAM,cAEN,MAAM,SAIN,MAAM,QACN,MAAM,UACN,MAAM,WACN,MAAM,UACN,MAAM,GAGJ,OAAO,CAAC,OAAO,CAAC,CAuB5B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,sGAhBW,MAAM,cAEN,MAAM,SAIN,MAAM,QACN,MAAM,UACN,MAAM,WACN,MAAM,UACN,MAAM,GAGJ,OAAO,CAAC,IAAI,CAAC,CAsBzB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,qGAhBW,MAAM,cAEN,MAAM,SAIN,MAAM,QACN,MAAM,UACN,MAAM,WACN,MAAM,UACN,MAAM,GAGJ,OAAO,CAAC,IAAI,CAAC,CAsBzB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,mGAlBW,MAAM,WAEN,MAAM,cAEN,MAAM,SAIN,MAAM,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15
  exports.mobileScrollBackTo = mobileScrollBackTo;
16
16
  exports.mobileScroll = mobileScroll;
17
+ const driver_1 = require("appium/driver");
17
18
  const support_1 = require("appium/support");
18
19
  const lodash_1 = __importDefault(require("lodash"));
19
- const driver_1 = require("appium/driver");
20
20
  /**
21
- * Performs a simple click/tap gesture
22
- *
23
- * @this {AndroidUiautomator2Driver}
24
- * @param {string} [elementId] The id of the element to be clicked.
25
- * If the element is missing then both click offset coordinates must be provided.
26
- * If both the element id and offset are provided then the coordinates are parsed
27
- * as relative offsets from the top left corner of the element.
28
- * @param {number} [x] The x coordinate to click on.
29
- * @param {number} [y] The y coordinate to click on.
30
- * @returns {Promise<void>}
31
- * @throws {Error} if provided options are not valid
21
+ * Performs a simple click/tap gesture.
32
22
  */
33
23
  async function mobileClickGesture(elementId, x, y) {
34
24
  await this.uiautomator2.jwproxy.command('/appium/gestures/click', 'POST', {
@@ -37,19 +27,7 @@ async function mobileClickGesture(elementId, x, y) {
37
27
  });
38
28
  }
39
29
  /**
40
- * Performs a click that lasts for the given duration
41
- *
42
- * @this {AndroidUiautomator2Driver}
43
- * @param {string} [elementId] The id of the element to be clicked.
44
- * If the element is missing then both click offset coordinates must be provided.
45
- * If both the element id and offset are provided then the coordinates are parsed
46
- * as relative offsets from the top left corner of the element.
47
- * @param {number} [x] The x coordinate to click on.
48
- * @param {number} [y] The y coordinate to click on.
49
- * @param {number} [duration] Click duration in milliseconds. The value must not be negative.
50
- * Default is 500.
51
- * @returns {Promise<void>}
52
- * @throws {Error} if provided options are not valid
30
+ * Performs a long click with an optional duration.
53
31
  */
54
32
  async function mobileLongClickGesture(elementId, x, y, duration) {
55
33
  await this.uiautomator2.jwproxy.command('/appium/gestures/long_click', 'POST', {
@@ -59,16 +37,7 @@ async function mobileLongClickGesture(elementId, x, y, duration) {
59
37
  });
60
38
  }
61
39
  /**
62
- * Performs a click that lasts for the given duration
63
- * @this {AndroidUiautomator2Driver}
64
- * @param {string} [elementId] The id of the element to be clicked.
65
- * If the element is missing then both click offset coordinates must be provided.
66
- * If both the element id and offset are provided then the coordinates are parsed
67
- * as relative offsets from the top left corner of the element.
68
- * @param {number} [x] The x coordinate to click on.
69
- * @param {number} [y] The y coordinate to click on.
70
- * @returns {Promise<void>}
71
- * @throws {Error} if provided options are not valid
40
+ * Performs a double-click gesture.
72
41
  */
73
42
  async function mobileDoubleClickGesture(elementId, x, y) {
74
43
  await this.uiautomator2.jwproxy.command('/appium/gestures/double_click', 'POST', {
@@ -77,21 +46,7 @@ async function mobileDoubleClickGesture(elementId, x, y) {
77
46
  });
78
47
  }
79
48
  /**
80
- * Drags this object to the specified location.
81
- * @this {AndroidUiautomator2Driver}
82
- * @param {string} [elementId] The id of the element to be dragged.
83
- * If the element id is missing then the start coordinates must be provided.
84
- * If both the element id and the start coordinates are provided then these
85
- * coordinates are considered as offsets from the top left element corner.
86
- * @param {number} [startX] The x coordinate where the dragging starts
87
- * @param {number} [startY] The y coordinate where the dragging starts
88
- * @param {number} [endX] The x coordinate where the dragging ends
89
- * @param {number} [endY] The y coordinate where the dragging ends
90
- * @param {number} [speed] The speed at which to perform this gesture in pixels per second.
91
- * The value must not be negative.
92
- * Default is 2500 * displayDensity.
93
- * @returns {Promise<void>}
94
- * @throws {Error} if provided options are not valid
49
+ * Drags from a start point to an end point.
95
50
  */
96
51
  async function mobileDragGesture(elementId, startX, startY, endX, endY, speed) {
97
52
  await this.uiautomator2.jwproxy.command('/appium/gestures/drag', 'POST', {
@@ -102,27 +57,10 @@ async function mobileDragGesture(elementId, startX, startY, endX, endY, speed) {
102
57
  });
103
58
  }
104
59
  /**
105
- * Drags to the specified location.
106
- *
107
- * @throws {Error} if provided options are not valid
108
- * @this {AndroidUiautomator2Driver}
109
- * @param {string} direction Direction of the fling.
110
- * Acceptable values are: `up`, `down`, `left` and `right` (case insensitive).
111
- * @param {string} [elementId] The id of the element to be flinged.
112
- * If the element id is missing then fling bounding area must be provided.
113
- * If both the element id and the fling bounding area are provided then this
114
- * area is effectively ignored.
115
- * @param {number} [left] The left coordinate of the fling bounding area.
116
- * @param {number} [top] The top coordinate of the fling bounding area.
117
- * @param {number} [width] The width of the fling bounding area.
118
- * @param {number} [height] The height of the fling bounding area.
119
- * @param {number} [speed] The speed at which to perform this gesture in pixels per second.
120
- * The value must be greater than the minimum fling velocity for the given view (50 by default).
121
- * Default is 7500 * displayDensity.
122
- * @returns {Promise<boolean>} True if the object can still scroll in the given direction.
60
+ * Performs a fling gesture and reports if further scrolling is possible.
123
61
  */
124
62
  async function mobileFlingGesture(direction, elementId, left, top, width, height, speed) {
125
- return /** @type {boolean} */ (await this.uiautomator2.jwproxy.command('/appium/gestures/fling', 'POST', {
63
+ return (await this.uiautomator2.jwproxy.command('/appium/gestures/fling', 'POST', {
126
64
  origin: toOrigin(elementId),
127
65
  area: toRect(left, top, width, height),
128
66
  direction,
@@ -130,23 +68,7 @@ async function mobileFlingGesture(direction, elementId, left, top, width, height
130
68
  }));
131
69
  }
132
70
  /**
133
- * Performs a pinch close gesture.
134
- * @this {AndroidUiautomator2Driver}
135
- * @param {number} percent The size of the pinch as a percentage of the pinch area size.
136
- * Valid values must be float numbers in range 0..1, where 1.0 is 100%
137
- * @param {string} [elementId] The id of the element to be pinched.
138
- * If the element id is missing then pinch bounding area must be provided.
139
- * If both the element id and the pinch bounding area are provided then the
140
- * area is effectively ignored.
141
- * @param {number} [left] The left coordinate of the pinch bounding area.
142
- * @param {number} [top] The top coordinate of the pinch bounding area.
143
- * @param {number} [width] The width of the pinch bounding area.
144
- * @param {number} [height] The height of the pinch bounding area.
145
- * @param {number} [speed] The speed at which to perform this gesture in pixels per second.
146
- * The value must not be negative.
147
- * Default is 2500 * displayDensity.
148
- * @returns {Promise<void>}
149
- * @throws {Error} if provided options are not valid
71
+ * Performs a pinch-close gesture.
150
72
  */
151
73
  async function mobilePinchCloseGesture(percent, elementId, left, top, width, height, speed) {
152
74
  await this.uiautomator2.jwproxy.command('/appium/gestures/pinch_close', 'POST', {
@@ -157,23 +79,7 @@ async function mobilePinchCloseGesture(percent, elementId, left, top, width, hei
157
79
  });
158
80
  }
159
81
  /**
160
- * Performs a pinch open gesture.
161
- * @this {AndroidUiautomator2Driver}
162
- * @param {number} percent The size of the pinch as a percentage of the pinch area size.
163
- * Valid values must be float numbers in range 0..1, where 1.0 is 100%
164
- * @param {string} [elementId] The id of the element to be pinched.
165
- * If the element id is missing then pinch bounding area must be provided.
166
- * If both the element id and the pinch bounding area are provided then the
167
- * area is effectively ignored.
168
- * @param {number} [left] The left coordinate of the pinch bounding area.
169
- * @param {number} [top] The top coordinate of the pinch bounding area.
170
- * @param {number} [width] The width of the pinch bounding area.
171
- * @param {number} [height] The height of the pinch bounding area.
172
- * @param {number} [speed] The speed at which to perform this gesture in pixels per second.
173
- * The value must not be negative.
174
- * Default is 2500 * displayDensity.
175
- * @returns {Promise<void>}
176
- * @throws {Error} if provided options are not valid
82
+ * Performs a pinch-open gesture.
177
83
  */
178
84
  async function mobilePinchOpenGesture(percent, elementId, left, top, width, height, speed) {
179
85
  await this.uiautomator2.jwproxy.command('/appium/gestures/pinch_open', 'POST', {
@@ -184,25 +90,7 @@ async function mobilePinchOpenGesture(percent, elementId, left, top, width, heig
184
90
  });
185
91
  }
186
92
  /**
187
- * Performs a swipe gesture.
188
- * @this {AndroidUiautomator2Driver}
189
- * @param {string} direction Direction of the swipe.
190
- * Acceptable values are: `up`, `down`, `left` and `right` (case insensitive).
191
- * @param {number} percent The size of the swipe as a percentage of the swipe area size.
192
- * Valid values must be float numbers in range 0..1, where 1.0 is 100%.
193
- * @param {string} [elementId] The id of the element to be swiped.
194
- * If the element id is missing then swipe bounding area must be provided.
195
- * If both the element id and the swipe bounding area are provided then the
196
- * area is effectively ignored.
197
- * @param {number} [left] The left coordinate of the swipe bounding area.
198
- * @param {number} [top] The top coordinate of the swipe bounding area.
199
- * @param {number} [width] The width of the swipe bounding area.
200
- * @param {number} [height] The height of the swipe bounding area.
201
- * @param {number} [speed] The speed at which to perform this gesture in pixels per second.
202
- * The value must not be negative.
203
- * Default is 5000 * displayDensity.
204
- * @returns {Promise<void>}
205
- * @throws {Error} if provided options are not valid
93
+ * Performs a swipe gesture for the given direction and percent.
206
94
  */
207
95
  async function mobileSwipeGesture(direction, percent, elementId, left, top, width, height, speed) {
208
96
  await this.uiautomator2.jwproxy.command('/appium/gestures/swipe', 'POST', {
@@ -214,29 +102,10 @@ async function mobileSwipeGesture(direction, percent, elementId, left, top, widt
214
102
  });
215
103
  }
216
104
  /**
217
- * Performs a scroll gesture.
218
- *
219
- * @throws {Error} if provided options are not valid
220
- * @this {AndroidUiautomator2Driver}
221
- * @param {string} direction Direction of the scroll.
222
- * Acceptable values are: `up`, `down`, `left` and `right` (case insensitive).
223
- * @param {number} percent The size of the scroll as a percentage of the scrolling area size.
224
- * Valid values must be float numbers greater than zero, where 1.0 is 100%.
225
- * @param {string} [elementId] The id of the element to be scrolled.
226
- * If the element id is missing then scroll bounding area must be provided.
227
- * If both the element id and the scroll bounding area are provided then this
228
- * area is effectively ignored.
229
- * @param {number} [left] The left coordinate of the scroll bounding area.
230
- * @param {number} [top] The top coordinate of the scroll bounding area.
231
- * @param {number} [width] The width of the scroll bounding area.
232
- * @param {number} [height] The height of the scroll bounding area.
233
- * @param {number} [speed] The speed at which to perform this gesture in pixels per second.
234
- * The value must not be negative.
235
- * Default is 5000 * displayDensity.
236
- * @returns {Promise<boolean>} True if the object can still scroll in the given direction.
105
+ * Performs a scroll gesture and reports if further scrolling is possible.
237
106
  */
238
107
  async function mobileScrollGesture(direction, percent, elementId, left, top, width, height, speed) {
239
- return /** @type {boolean} */ (await this.uiautomator2.jwproxy.command('/appium/gestures/scroll', 'POST', {
108
+ return (await this.uiautomator2.jwproxy.command('/appium/gestures/scroll', 'POST', {
240
109
  origin: toOrigin(elementId),
241
110
  area: toRect(left, top, width, height),
242
111
  direction,
@@ -245,21 +114,7 @@ async function mobileScrollGesture(direction, percent, elementId, left, top, wid
245
114
  }));
246
115
  }
247
116
  /**
248
- * Scrolls the given scrollable element `elementId` until `elementToId`
249
- * becomes visible. This function returns immediately if the `elementToId`
250
- * is already visible in the view port. Otherwise it would scroll
251
- * to the very beginning of the scrollable control and tries to reach the destination element
252
- * by scrolling its parent to the end step by step. The scroll direction (vertical or horizontal)
253
- * is detected automatically.
254
- * @this {AndroidUiautomator2Driver}
255
- * @param {string} elementId The identifier of the scrollable element, which is going to be scrolled.
256
- * It is required this element is a valid scrollable container and it was located
257
- * by `-android uiautomator` strategy.
258
- * @param {string} elementToId The identifier of the item, which belongs to the scrollable element above,
259
- * and which should become visible after the scrolling operation is finished.
260
- * It is required this element was located by `-android uiautomator` strategy.
261
- * @returns {Promise<void>}
262
- * @throws {Error} if the scrolling operation cannot be performed
117
+ * Scrolls a scrollable element until a target element becomes visible.
263
118
  */
264
119
  async function mobileScrollBackTo(elementId, elementToId) {
265
120
  if (!elementId || !elementToId) {
@@ -268,28 +123,7 @@ async function mobileScrollBackTo(elementId, elementToId) {
268
123
  await this.uiautomator2.jwproxy.command(`/appium/element/${support_1.util.unwrapElement(elementId)}/scroll_to/${support_1.util.unwrapElement(elementToId)}`, 'POST', {});
269
124
  }
270
125
  /**
271
- * Scrolls the given scrollable element until the element identified
272
- * by `strategy` and `selector` becomes visible. This function returns immediately if the
273
- * destination element is already visible in the view port. Otherwise it would scroll
274
- * to the very beginning of the scrollable control and tries to reach the destination element
275
- * by scrolling its parent to the end step by step. The scroll direction (vertical or horizontal)
276
- * is detected automatically.
277
- *
278
- * @this {AndroidUiautomator2Driver}
279
- * @param {string} strategy The following strategies are supported:
280
- * - `accessibility id` (UiSelector().description)
281
- * - `class name` (UiSelector().className)
282
- * - `-android uiautomator` (UiSelector)
283
- * @param {string} selector The corresponding lookup value for the given strategy.
284
- * @param {string} [elementId] The identifier of an element. It is required this element is a valid scrollable container
285
- * and it was located by `-android uiautomator` strategy.
286
- * If this property is not provided then the first currently available scrollable view
287
- * is selected for the interaction.
288
- * @param {number} [maxSwipes] The maximum number of swipes to perform on the target scrollable view in order to reach
289
- * the destination element. In case this value is unset then it would be retrieved from the
290
- * scrollable element itself (via `getMaxSearchSwipes()` property).
291
- * @returns {Promise<void>}
292
- * @throws {Error} if the scrolling operation cannot be performed
126
+ * Scrolls until an element located by the given strategy is visible.
293
127
  */
294
128
  async function mobileScroll(strategy, selector, elementId, maxSwipes) {
295
129
  if (!strategy || !selector) {
@@ -300,39 +134,15 @@ async function mobileScroll(strategy, selector, elementId, maxSwipes) {
300
134
  params: { strategy, selector, maxSwipes },
301
135
  });
302
136
  }
303
- // #region Internal Helpers
304
- /**
305
- *
306
- * @param {import('@appium/types').Element|string} [element]
307
- * @returns {import('@appium/types').Element|undefined}
308
- */
309
137
  function toOrigin(element) {
310
138
  return element ? support_1.util.wrapElement(support_1.util.unwrapElement(element)) : undefined;
311
139
  }
312
- /**
313
- *
314
- * @param {number} [x]
315
- * @param {number} [y]
316
- * @returns {Partial<import('@appium/types').Position>|undefined}
317
- */
318
140
  function toPoint(x, y) {
319
141
  return lodash_1.default.isFinite(x) && lodash_1.default.isFinite(y) ? { x, y } : undefined;
320
142
  }
321
- /**
322
- *
323
- * @param {number} [left]
324
- * @param {number} [top]
325
- * @param {number} [width]
326
- * @param {number} [height]
327
- * @returns {Partial<import('./types').RelativeRect>|undefined}
328
- */
329
143
  function toRect(left, top, width, height) {
330
144
  return [left, top, width, height].some((v) => !lodash_1.default.isFinite(v))
331
145
  ? undefined
332
146
  : { left, top, width, height };
333
147
  }
334
- // #endregion
335
- /**
336
- * @typedef {import('../driver').AndroidUiautomator2Driver} AndroidUiautomator2Driver
337
- */
338
148
  //# sourceMappingURL=gestures.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gestures.js","sourceRoot":"","sources":["../../../lib/commands/gestures.js"],"names":[],"mappings":";;;;;AAiBA,gDASC;AAiBD,wDAUC;AAcD,4DASC;AAmBD,8CAkBC;AAsBD,gDAqBC;AAqBD,0DAmBC;AAqBD,wDAmBC;AAuBD,gDAqBC;AAw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AAC,IAAI,gBAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,EAAE,CAAC,EAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7D,CAAC;AAED,SAAS,MAAM,CAAC,IAAa,EAAE,GAAY,EAAE,KAAc,EAAE,MAAe;IAC1E,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,gBAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC3D,CAAC,CAAC,SAAS;QACX,CAAC,CAAE,EAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAkB,CAAC;AACnD,CAAC"}
@@ -1,51 +1,31 @@
1
+ import type { Orientation, StringRecord } from '@appium/types';
2
+ import type { AndroidUiautomator2Driver } from '../driver';
1
3
  /**
2
- * @this {AndroidUiautomator2Driver}
3
- * @returns {Promise<string>}
4
+ * Retrieves the current page source.
4
5
  */
5
- export function getPageSource(this: import("../driver").AndroidUiautomator2Driver): Promise<string>;
6
+ export declare function getPageSource(this: AndroidUiautomator2Driver): Promise<string>;
6
7
  /**
7
- * @this {AndroidUiautomator2Driver}
8
- * @returns {Promise<import('@appium/types').Orientation>}
8
+ * Gets the current device orientation.
9
9
  */
10
- export function getOrientation(this: import("../driver").AndroidUiautomator2Driver): Promise<import("@appium/types").Orientation>;
10
+ export declare function getOrientation(this: AndroidUiautomator2Driver): Promise<Orientation>;
11
11
  /**
12
- * @this {AndroidUiautomator2Driver}
13
- * @param {import('@appium/types').Orientation} orientation
14
- * @returns {Promise<void>}
12
+ * Sets the device orientation.
15
13
  */
16
- export function setOrientation(this: import("../driver").AndroidUiautomator2Driver, orientation: import("@appium/types").Orientation): Promise<void>;
14
+ export declare function setOrientation(this: AndroidUiautomator2Driver, orientation: Orientation): Promise<void>;
17
15
  /**
18
- * @this {AndroidUiautomator2Driver}
19
- * @returns {Promise<void>}
16
+ * Opens the device notification shade.
20
17
  */
21
- export function openNotifications(this: import("../driver").AndroidUiautomator2Driver): Promise<void>;
18
+ export declare function openNotifications(this: AndroidUiautomator2Driver): Promise<void>;
22
19
  /**
23
- * Stop proxying to any Chromedriver and redirect to uiautomator2
24
- * @this {AndroidUiautomator2Driver}
25
- * @returns {void}
20
+ * Stops proxying to Chromedriver and restores UIA2 proxy.
26
21
  */
27
- export function suspendChromedriverProxy(this: import("../driver").AndroidUiautomator2Driver): void;
28
- export class suspendChromedriverProxy {
29
- chromedriver: any;
30
- proxyReqRes: any;
31
- proxyCommand: (<TReq = any, TRes = unknown>(url: string, method: import("@appium/types").HTTPMethod, body?: TReq) => Promise<TRes>) | undefined;
32
- jwpProxyActive: boolean | undefined;
33
- }
22
+ export declare function suspendChromedriverProxy(this: AndroidUiautomator2Driver): void;
34
23
  /**
35
- * The list of available info entries can be found at
36
- * https://github.com/appium/appium-uiautomator2-server/blob/master/app/src/main/java/io/appium/uiautomator2/handler/GetDeviceInfo.java
37
- * @this {AndroidUiautomator2Driver}
38
- * @returns {Promise<StringRecord>}
24
+ * Retrieves device info via the UIA2 server.
39
25
  */
40
- export function mobileGetDeviceInfo(this: import("../driver").AndroidUiautomator2Driver): Promise<StringRecord>;
26
+ export declare function mobileGetDeviceInfo(this: AndroidUiautomator2Driver): Promise<StringRecord>;
41
27
  /**
42
28
  * Resets the accessibility cache on the device.
43
- * This can be useful when the accessibility service cache becomes stale
44
- * and needs to be refreshed to reflect the current UI state.
45
- * @this {AndroidUiautomator2Driver}
46
- * @returns {Promise<void>}
47
29
  */
48
- export function mobileResetAccessibilityCache(this: import("../driver").AndroidUiautomator2Driver): Promise<void>;
49
- export type StringRecord<T = any> = import("@appium/types").StringRecord<T>;
50
- export type AndroidUiautomator2Driver<T = any> = import("../driver").AndroidUiautomator2Driver;
30
+ export declare function mobileResetAccessibilityCache(this: AndroidUiautomator2Driver): Promise<void>;
51
31
  //# sourceMappingURL=misc.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../../lib/commands/misc.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oFAFa,OAAO,CAAC,MAAM,CAAC,CAU3B;AAED;;;GAGG;AACH,qFAFa,OAAO,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC,CAUxD;AAED;;;;GAIG;AACH,iGAHW,OAAO,eAAe,EAAE,WAAW,GACjC,OAAO,CAAC,IAAI,CAAC,CASzB;AAED;;;GAGG;AACH,wFAFa,OAAO,CAAC,IAAI,CAAC,CAQzB;AAED;;;;GAIG;AACH,+FAFa,IAAI,CAehB;;IARC,kBAA6B;IAC7B,iBAEC;IACD,gJAEC;IACD,oCAA0B;;AAG5B;;;;;GAKG;AACH,0FAFa,OAAO,CAAC,YAAY,CAAC,CASjC;AAED;;;;;;GAMG;AACH,oGAFa,OAAO,CAAC,IAAI,CAAC,CAQzB;yBAGa,CAAC,UACF,OAAO,eAAe,EAAE,YAAY,CAAC,CAAC,CAAC;sCADtC,CAAC,UAEF,OAAO,WAAW,EAAE,yBAAyB"}
1
+ {"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../../lib/commands/misc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAC7D,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,WAAW,CAAC;AAEzD;;GAEG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,CAEpF;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,WAAW,CAAC,CAE1F;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,yBAAyB,EAC/B,WAAW,EAAE,WAAW,GACvB,OAAO,CAAC,IAAI,CAAC,CAGf;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAEtF;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,yBAAyB,GAAG,IAAI,CAS9E;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,YAAY,CAAC,CAEhG;AAED;;GAEG;AACH,wBAAsB,6BAA6B,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAElG"}
@@ -8,39 +8,32 @@ exports.suspendChromedriverProxy = suspendChromedriverProxy;
8
8
  exports.mobileGetDeviceInfo = mobileGetDeviceInfo;
9
9
  exports.mobileResetAccessibilityCache = mobileResetAccessibilityCache;
10
10
  /**
11
- * @this {AndroidUiautomator2Driver}
12
- * @returns {Promise<string>}
11
+ * Retrieves the current page source.
13
12
  */
14
13
  async function getPageSource() {
15
14
  return String(await this.uiautomator2.jwproxy.command('/source', 'GET', {}));
16
15
  }
17
16
  /**
18
- * @this {AndroidUiautomator2Driver}
19
- * @returns {Promise<import('@appium/types').Orientation>}
17
+ * Gets the current device orientation.
20
18
  */
21
19
  async function getOrientation() {
22
- return /** @type {import('@appium/types').Orientation} */ (await this.uiautomator2.jwproxy.command(`/orientation`, 'GET', {}));
20
+ return (await this.uiautomator2.jwproxy.command(`/orientation`, 'GET', {}));
23
21
  }
24
22
  /**
25
- * @this {AndroidUiautomator2Driver}
26
- * @param {import('@appium/types').Orientation} orientation
27
- * @returns {Promise<void>}
23
+ * Sets the device orientation.
28
24
  */
29
25
  async function setOrientation(orientation) {
30
- orientation = /** @type {import('@appium/types').Orientation} */ (orientation.toUpperCase());
31
- await this.uiautomator2.jwproxy.command(`/orientation`, 'POST', { orientation });
26
+ const normalizedOrientation = orientation.toUpperCase();
27
+ await this.uiautomator2.jwproxy.command(`/orientation`, 'POST', { orientation: normalizedOrientation });
32
28
  }
33
29
  /**
34
- * @this {AndroidUiautomator2Driver}
35
- * @returns {Promise<void>}
30
+ * Opens the device notification shade.
36
31
  */
37
32
  async function openNotifications() {
38
33
  await this.uiautomator2.jwproxy.command('/appium/device/open_notifications', 'POST', {});
39
34
  }
40
35
  /**
41
- * Stop proxying to any Chromedriver and redirect to uiautomator2
42
- * @this {AndroidUiautomator2Driver}
43
- * @returns {void}
36
+ * Stops proxying to Chromedriver and restores UIA2 proxy.
44
37
  */
45
38
  function suspendChromedriverProxy() {
46
39
  if (!this.uiautomator2?.proxyReqRes || !this.uiautomator2?.proxyCommand) {
@@ -48,31 +41,19 @@ function suspendChromedriverProxy() {
48
41
  }
49
42
  this.chromedriver = undefined;
50
43
  this.proxyReqRes = this.uiautomator2.proxyReqRes.bind(this.uiautomator2);
51
- this.proxyCommand = /** @type {typeof this.proxyCommand} */ (this.uiautomator2.proxyCommand.bind(this.uiautomator2));
44
+ this.proxyCommand = this.uiautomator2.proxyCommand.bind(this.uiautomator2);
52
45
  this.jwpProxyActive = true;
53
46
  }
54
47
  /**
55
- * The list of available info entries can be found at
56
- * https://github.com/appium/appium-uiautomator2-server/blob/master/app/src/main/java/io/appium/uiautomator2/handler/GetDeviceInfo.java
57
- * @this {AndroidUiautomator2Driver}
58
- * @returns {Promise<StringRecord>}
48
+ * Retrieves device info via the UIA2 server.
59
49
  */
60
50
  async function mobileGetDeviceInfo() {
61
- return /** @type {StringRecord} */ (await this.uiautomator2.jwproxy.command('/appium/device/info', 'GET'));
51
+ return (await this.uiautomator2.jwproxy.command('/appium/device/info', 'GET'));
62
52
  }
63
53
  /**
64
54
  * Resets the accessibility cache on the device.
65
- * This can be useful when the accessibility service cache becomes stale
66
- * and needs to be refreshed to reflect the current UI state.
67
- * @this {AndroidUiautomator2Driver}
68
- * @returns {Promise<void>}
69
55
  */
70
56
  async function mobileResetAccessibilityCache() {
71
57
  await this.uiautomator2.jwproxy.command('/appium/reset_ax_cache', 'POST', {});
72
58
  }
73
- /**
74
- * @template [T=any]
75
- * @typedef {import('@appium/types').StringRecord<T>} StringRecord
76
- * @typedef {import('../driver').AndroidUiautomator2Driver} AndroidUiautomator2Driver
77
- */
78
59
  //# sourceMappingURL=misc.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"misc.js","sourceRoot":"","sources":["../../../lib/commands/misc.js"],"names":[],"mappings":";;AAIA,sCAQC;AAMD,wCAQC;AAOD,wCAOC;AAMD,8CAMC;AAOD,4DAaC;AAQD,kDAOC;AASD,sEAMC;AAtGD;;;GAGG;AACI,KAAK,UAAU,aAAa;IACjC,OAAO,MAAM,CACX,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CACrC,SAAS,EACT,KAAK,EACL,EAAE,CACH,CACF,CAAC;AACJ,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,cAAc;IAClC,OAAO,kDAAkD,CAAC,CACxD,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CACrC,cAAc,EACd,KAAK,EACL,EAAE,CACH,CACF,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,cAAc,CAAC,WAAW;IAC9C,WAAW,GAAG,kDAAkD,CAAC,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC,CAAC;IAC7F,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CACrC,cAAc,EACd,MAAM,EACN,EAAC,WAAW,EAAC,CACd,CAAC;AACJ,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,iBAAiB;IACrC,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CACrC,mCAAmC,EACnC,MAAM,EACN,EAAE,CACH,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAgB,wBAAwB;IACtC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,WAAW,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,YAAY,EAAE,CAAC;QACxE,OAAO;IACT,CAAC;IAED,IAAI,CAAC,YAAY,GAAG,SA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