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.
- package/CHANGELOG.md +6 -0
- package/build/lib/commands/element.d.ts +35 -69
- package/build/lib/commands/element.d.ts.map +1 -1
- package/build/lib/commands/element.js +35 -84
- package/build/lib/commands/element.js.map +1 -1
- package/build/lib/commands/gestures.d.ts +24 -189
- package/build/lib/commands/gestures.d.ts.map +1 -1
- package/build/lib/commands/gestures.js +14 -204
- package/build/lib/commands/gestures.js.map +1 -1
- package/build/lib/commands/misc.d.ts +15 -35
- package/build/lib/commands/misc.d.ts.map +1 -1
- package/build/lib/commands/misc.js +11 -30
- package/build/lib/commands/misc.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/lib/commands/element.ts +151 -0
- package/lib/commands/gestures.ts +234 -0
- package/lib/commands/misc.ts +63 -0
- package/npm-shrinkwrap.json +16 -46
- package/package.json +1 -1
- package/lib/commands/element.js +0 -261
- package/lib/commands/gestures.js +0 -446
- package/lib/commands/misc.js +0 -109
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import {PROTOCOLS} from 'appium/driver';
|
|
2
|
+
import B from 'bluebird';
|
|
3
|
+
import _ from 'lodash';
|
|
4
|
+
import type {DoSetElementValueOpts} from 'appium-android-driver';
|
|
5
|
+
import type {Element as AppiumElement, Position, Rect, Size} from '@appium/types';
|
|
6
|
+
import type {AndroidUiautomator2Driver} from '../driver';
|
|
7
|
+
import type {Chromedriver} from 'appium-chromedriver';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Gets the currently active element.
|
|
11
|
+
*/
|
|
12
|
+
export async function active(this: AndroidUiautomator2Driver): Promise<AppiumElement> {
|
|
13
|
+
return (await this.uiautomator2.jwproxy.command('/element/active', 'GET')) as AppiumElement;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Gets an element attribute value.
|
|
18
|
+
*/
|
|
19
|
+
export async function getAttribute(this: AndroidUiautomator2Driver, attribute: string, elementId: string): Promise<string> {
|
|
20
|
+
return String(await this.uiautomator2.jwproxy.command(`/element/${elementId}/attribute/${attribute}`, 'GET', {}));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Returns whether the element is displayed.
|
|
25
|
+
*/
|
|
26
|
+
export async function elementDisplayed(this: AndroidUiautomator2Driver, elementId: string): Promise<boolean> {
|
|
27
|
+
return toBool(await this.getAttribute('displayed', elementId));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Returns whether the element is enabled.
|
|
32
|
+
*/
|
|
33
|
+
export async function elementEnabled(this: AndroidUiautomator2Driver, elementId: string): Promise<boolean> {
|
|
34
|
+
return toBool(await this.getAttribute('enabled', elementId));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Returns whether the element is selected.
|
|
39
|
+
*/
|
|
40
|
+
export async function elementSelected(this: AndroidUiautomator2Driver, elementId: string): Promise<boolean> {
|
|
41
|
+
return toBool(await this.getAttribute('selected', elementId));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Gets the element tag name.
|
|
46
|
+
*/
|
|
47
|
+
export async function getName(this: AndroidUiautomator2Driver, elementId: string): Promise<string> {
|
|
48
|
+
return (await this.uiautomator2.jwproxy.command(`/element/${elementId}/name`, 'GET', {})) as string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Gets the element location.
|
|
53
|
+
*/
|
|
54
|
+
export async function getLocation(this: AndroidUiautomator2Driver, elementId: string): Promise<Position> {
|
|
55
|
+
return (await this.uiautomator2.jwproxy.command(`/element/${elementId}/location`, 'GET', {})) as Position;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Gets the element size.
|
|
60
|
+
*/
|
|
61
|
+
export async function getSize(this: AndroidUiautomator2Driver, elementId: string): Promise<Size> {
|
|
62
|
+
return (await this.uiautomator2.jwproxy.command(`/element/${elementId}/size`, 'GET', {})) as Size;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Sets the value of an element using the upstream driver API.
|
|
67
|
+
*/
|
|
68
|
+
export async function doSetElementValue(this: AndroidUiautomator2Driver, params: DoSetElementValueOpts): Promise<void> {
|
|
69
|
+
await this.uiautomator2.jwproxy.command(`/element/${params.elementId}/value`, 'POST', params);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Sends text to an element without replacement.
|
|
74
|
+
*/
|
|
75
|
+
export async function setValueImmediate(
|
|
76
|
+
this: AndroidUiautomator2Driver,
|
|
77
|
+
keys: string | string[],
|
|
78
|
+
elementId: string,
|
|
79
|
+
): Promise<void> {
|
|
80
|
+
await this.uiautomator2.jwproxy.command(`/element/${elementId}/value`, 'POST', {
|
|
81
|
+
elementId,
|
|
82
|
+
text: _.isArray(keys) ? keys.join('') : keys,
|
|
83
|
+
replace: false,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Gets the element text.
|
|
89
|
+
*/
|
|
90
|
+
export async function getText(this: AndroidUiautomator2Driver, elementId: string): Promise<string> {
|
|
91
|
+
return String(await this.uiautomator2.jwproxy.command(`/element/${elementId}/text`, 'GET', {}));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Clicks the given element.
|
|
96
|
+
*/
|
|
97
|
+
export async function click(this: AndroidUiautomator2Driver, element: string): Promise<void> {
|
|
98
|
+
await this.uiautomator2.jwproxy.command(`/element/${element}/click`, 'POST', {element});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Takes a screenshot of the element.
|
|
103
|
+
*/
|
|
104
|
+
export async function getElementScreenshot(this: AndroidUiautomator2Driver, element: string): Promise<string> {
|
|
105
|
+
return String(await this.uiautomator2.jwproxy.command(`/element/${element}/screenshot`, 'GET', {}));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Clears the element text.
|
|
110
|
+
*/
|
|
111
|
+
export async function clear(this: AndroidUiautomator2Driver, elementId: string): Promise<void> {
|
|
112
|
+
await this.uiautomator2.jwproxy.command(`/element/${elementId}/clear`, 'POST', {elementId});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Gets the element rectangle.
|
|
117
|
+
*/
|
|
118
|
+
export async function getElementRect(this: AndroidUiautomator2Driver, elementId: string): Promise<Rect> {
|
|
119
|
+
if (!this.isWebContext()) {
|
|
120
|
+
return (await this.uiautomator2.jwproxy.command(`/element/${elementId}/rect`, 'GET')) as Rect;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const chromedriver = this.chromedriver as Chromedriver;
|
|
124
|
+
if (chromedriver.jwproxy.downstreamProtocol === PROTOCOLS.MJSONWP) {
|
|
125
|
+
const [{x, y}, {width, height}] = (await B.all([
|
|
126
|
+
chromedriver.jwproxy.command(`/element/${elementId}/location`, 'GET'),
|
|
127
|
+
chromedriver.jwproxy.command(`/element/${elementId}/size`, 'GET'),
|
|
128
|
+
])) as [Position, Size];
|
|
129
|
+
return {x, y, width, height};
|
|
130
|
+
}
|
|
131
|
+
return (await chromedriver.jwproxy.command(`/element/${elementId}/rect`, 'GET')) as Rect;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Replaces the element text.
|
|
136
|
+
*/
|
|
137
|
+
export async function mobileReplaceElementValue(
|
|
138
|
+
this: AndroidUiautomator2Driver,
|
|
139
|
+
elementId: string,
|
|
140
|
+
text: string,
|
|
141
|
+
): Promise<void> {
|
|
142
|
+
await this.uiautomator2.jwproxy.command(`/element/${elementId}/value`, 'POST', {
|
|
143
|
+
text,
|
|
144
|
+
replace: true,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function toBool(value: any): boolean {
|
|
149
|
+
return _.isString(value) ? value.toLowerCase() === 'true' : !!value;
|
|
150
|
+
}
|
|
151
|
+
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import {errors} from 'appium/driver';
|
|
2
|
+
import {util} from 'appium/support';
|
|
3
|
+
import _ from 'lodash';
|
|
4
|
+
import type {Element as AppiumElement, Position} from '@appium/types';
|
|
5
|
+
import type {RelativeRect} from './types';
|
|
6
|
+
import type {AndroidUiautomator2Driver} from '../driver';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Performs a simple click/tap gesture.
|
|
10
|
+
*/
|
|
11
|
+
export async function mobileClickGesture(
|
|
12
|
+
this: AndroidUiautomator2Driver,
|
|
13
|
+
elementId?: AppiumElement | string,
|
|
14
|
+
x?: number,
|
|
15
|
+
y?: number,
|
|
16
|
+
): Promise<void> {
|
|
17
|
+
await this.uiautomator2.jwproxy.command('/appium/gestures/click', 'POST', {
|
|
18
|
+
origin: toOrigin(elementId),
|
|
19
|
+
offset: toPoint(x, y),
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Performs a long click with an optional duration.
|
|
25
|
+
*/
|
|
26
|
+
export async function mobileLongClickGesture(
|
|
27
|
+
this: AndroidUiautomator2Driver,
|
|
28
|
+
elementId?: AppiumElement | string,
|
|
29
|
+
x?: number,
|
|
30
|
+
y?: number,
|
|
31
|
+
duration?: number,
|
|
32
|
+
): Promise<void> {
|
|
33
|
+
await this.uiautomator2.jwproxy.command('/appium/gestures/long_click', 'POST', {
|
|
34
|
+
origin: toOrigin(elementId),
|
|
35
|
+
offset: toPoint(x, y),
|
|
36
|
+
duration,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Performs a double-click gesture.
|
|
42
|
+
*/
|
|
43
|
+
export async function mobileDoubleClickGesture(
|
|
44
|
+
this: AndroidUiautomator2Driver,
|
|
45
|
+
elementId?: AppiumElement | string,
|
|
46
|
+
x?: number,
|
|
47
|
+
y?: number,
|
|
48
|
+
): Promise<void> {
|
|
49
|
+
await this.uiautomator2.jwproxy.command('/appium/gestures/double_click', 'POST', {
|
|
50
|
+
origin: toOrigin(elementId),
|
|
51
|
+
offset: toPoint(x, y),
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Drags from a start point to an end point.
|
|
57
|
+
*/
|
|
58
|
+
export async function mobileDragGesture(
|
|
59
|
+
this: AndroidUiautomator2Driver,
|
|
60
|
+
elementId?: AppiumElement | string,
|
|
61
|
+
startX?: number,
|
|
62
|
+
startY?: number,
|
|
63
|
+
endX?: number,
|
|
64
|
+
endY?: number,
|
|
65
|
+
speed?: number,
|
|
66
|
+
): Promise<void> {
|
|
67
|
+
await this.uiautomator2.jwproxy.command('/appium/gestures/drag', 'POST', {
|
|
68
|
+
origin: toOrigin(elementId),
|
|
69
|
+
start: toPoint(startX, startY),
|
|
70
|
+
end: toPoint(endX, endY),
|
|
71
|
+
speed,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Performs a fling gesture and reports if further scrolling is possible.
|
|
77
|
+
*/
|
|
78
|
+
export async function mobileFlingGesture(
|
|
79
|
+
this: AndroidUiautomator2Driver,
|
|
80
|
+
direction: string,
|
|
81
|
+
elementId?: AppiumElement | string,
|
|
82
|
+
left?: number,
|
|
83
|
+
top?: number,
|
|
84
|
+
width?: number,
|
|
85
|
+
height?: number,
|
|
86
|
+
speed?: number,
|
|
87
|
+
): Promise<boolean> {
|
|
88
|
+
return (await this.uiautomator2.jwproxy.command('/appium/gestures/fling', 'POST', {
|
|
89
|
+
origin: toOrigin(elementId),
|
|
90
|
+
area: toRect(left, top, width, height),
|
|
91
|
+
direction,
|
|
92
|
+
speed,
|
|
93
|
+
})) as boolean;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Performs a pinch-close gesture.
|
|
98
|
+
*/
|
|
99
|
+
export async function mobilePinchCloseGesture(
|
|
100
|
+
this: AndroidUiautomator2Driver,
|
|
101
|
+
percent: number,
|
|
102
|
+
elementId?: AppiumElement | string,
|
|
103
|
+
left?: number,
|
|
104
|
+
top?: number,
|
|
105
|
+
width?: number,
|
|
106
|
+
height?: number,
|
|
107
|
+
speed?: number,
|
|
108
|
+
): Promise<void> {
|
|
109
|
+
await this.uiautomator2.jwproxy.command('/appium/gestures/pinch_close', 'POST', {
|
|
110
|
+
origin: toOrigin(elementId),
|
|
111
|
+
area: toRect(left, top, width, height),
|
|
112
|
+
percent,
|
|
113
|
+
speed,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Performs a pinch-open gesture.
|
|
119
|
+
*/
|
|
120
|
+
export async function mobilePinchOpenGesture(
|
|
121
|
+
this: AndroidUiautomator2Driver,
|
|
122
|
+
percent: number,
|
|
123
|
+
elementId?: AppiumElement | string,
|
|
124
|
+
left?: number,
|
|
125
|
+
top?: number,
|
|
126
|
+
width?: number,
|
|
127
|
+
height?: number,
|
|
128
|
+
speed?: number,
|
|
129
|
+
): Promise<void> {
|
|
130
|
+
await this.uiautomator2.jwproxy.command('/appium/gestures/pinch_open', 'POST', {
|
|
131
|
+
origin: toOrigin(elementId),
|
|
132
|
+
area: toRect(left, top, width, height),
|
|
133
|
+
percent,
|
|
134
|
+
speed,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Performs a swipe gesture for the given direction and percent.
|
|
140
|
+
*/
|
|
141
|
+
export async function mobileSwipeGesture(
|
|
142
|
+
this: AndroidUiautomator2Driver,
|
|
143
|
+
direction: string,
|
|
144
|
+
percent: number,
|
|
145
|
+
elementId?: AppiumElement | string,
|
|
146
|
+
left?: number,
|
|
147
|
+
top?: number,
|
|
148
|
+
width?: number,
|
|
149
|
+
height?: number,
|
|
150
|
+
speed?: number,
|
|
151
|
+
): Promise<void> {
|
|
152
|
+
await this.uiautomator2.jwproxy.command('/appium/gestures/swipe', 'POST', {
|
|
153
|
+
origin: toOrigin(elementId),
|
|
154
|
+
area: toRect(left, top, width, height),
|
|
155
|
+
direction,
|
|
156
|
+
percent,
|
|
157
|
+
speed,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Performs a scroll gesture and reports if further scrolling is possible.
|
|
163
|
+
*/
|
|
164
|
+
export async function mobileScrollGesture(
|
|
165
|
+
this: AndroidUiautomator2Driver,
|
|
166
|
+
direction: string,
|
|
167
|
+
percent: number,
|
|
168
|
+
elementId?: AppiumElement | string,
|
|
169
|
+
left?: number,
|
|
170
|
+
top?: number,
|
|
171
|
+
width?: number,
|
|
172
|
+
height?: number,
|
|
173
|
+
speed?: number,
|
|
174
|
+
): Promise<boolean> {
|
|
175
|
+
return (await this.uiautomator2.jwproxy.command('/appium/gestures/scroll', 'POST', {
|
|
176
|
+
origin: toOrigin(elementId),
|
|
177
|
+
area: toRect(left, top, width, height),
|
|
178
|
+
direction,
|
|
179
|
+
percent,
|
|
180
|
+
speed,
|
|
181
|
+
})) as boolean;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Scrolls a scrollable element until a target element becomes visible.
|
|
186
|
+
*/
|
|
187
|
+
export async function mobileScrollBackTo(
|
|
188
|
+
this: AndroidUiautomator2Driver,
|
|
189
|
+
elementId?: string,
|
|
190
|
+
elementToId?: string,
|
|
191
|
+
): Promise<void> {
|
|
192
|
+
if (!elementId || !elementToId) {
|
|
193
|
+
throw new errors.InvalidArgumentError(`Both elementId and elementToId arguments must be provided`);
|
|
194
|
+
}
|
|
195
|
+
await this.uiautomator2.jwproxy.command(
|
|
196
|
+
`/appium/element/${util.unwrapElement(elementId)}/scroll_to/${util.unwrapElement(elementToId)}`,
|
|
197
|
+
'POST',
|
|
198
|
+
{},
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Scrolls until an element located by the given strategy is visible.
|
|
204
|
+
*/
|
|
205
|
+
export async function mobileScroll(
|
|
206
|
+
this: AndroidUiautomator2Driver,
|
|
207
|
+
strategy: string,
|
|
208
|
+
selector: string,
|
|
209
|
+
elementId?: AppiumElement | string,
|
|
210
|
+
maxSwipes?: number,
|
|
211
|
+
): Promise<void> {
|
|
212
|
+
if (!strategy || !selector) {
|
|
213
|
+
throw new errors.InvalidArgumentError(`Both strategy and selector arguments must be provided`);
|
|
214
|
+
}
|
|
215
|
+
await this.uiautomator2.jwproxy.command('/gestures/scroll_to', 'POST', {
|
|
216
|
+
origin: toOrigin(elementId),
|
|
217
|
+
params: {strategy, selector, maxSwipes},
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function toOrigin(element?: AppiumElement | string): AppiumElement | undefined {
|
|
222
|
+
return element ? (util.wrapElement(util.unwrapElement(element)) as AppiumElement) : undefined;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function toPoint(x?: number, y?: number): Partial<Position> | undefined {
|
|
226
|
+
return _.isFinite(x) && _.isFinite(y) ? {x, y} : undefined;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function toRect(left?: number, top?: number, width?: number, height?: number): RelativeRect | undefined {
|
|
230
|
+
return [left, top, width, height].some((v) => !_.isFinite(v))
|
|
231
|
+
? undefined
|
|
232
|
+
: ({left, top, width, height} as RelativeRect);
|
|
233
|
+
}
|
|
234
|
+
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type {Orientation, StringRecord} from '@appium/types';
|
|
2
|
+
import type {AndroidUiautomator2Driver} from '../driver';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves the current page source.
|
|
6
|
+
*/
|
|
7
|
+
export async function getPageSource(this: AndroidUiautomator2Driver): Promise<string> {
|
|
8
|
+
return String(await this.uiautomator2.jwproxy.command('/source', 'GET', {}));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Gets the current device orientation.
|
|
13
|
+
*/
|
|
14
|
+
export async function getOrientation(this: AndroidUiautomator2Driver): Promise<Orientation> {
|
|
15
|
+
return (await this.uiautomator2.jwproxy.command(`/orientation`, 'GET', {})) as Orientation;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Sets the device orientation.
|
|
20
|
+
*/
|
|
21
|
+
export async function setOrientation(
|
|
22
|
+
this: AndroidUiautomator2Driver,
|
|
23
|
+
orientation: Orientation,
|
|
24
|
+
): Promise<void> {
|
|
25
|
+
const normalizedOrientation = orientation.toUpperCase() as Orientation;
|
|
26
|
+
await this.uiautomator2.jwproxy.command(`/orientation`, 'POST', {orientation: normalizedOrientation});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Opens the device notification shade.
|
|
31
|
+
*/
|
|
32
|
+
export async function openNotifications(this: AndroidUiautomator2Driver): Promise<void> {
|
|
33
|
+
await this.uiautomator2.jwproxy.command('/appium/device/open_notifications', 'POST', {});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Stops proxying to Chromedriver and restores UIA2 proxy.
|
|
38
|
+
*/
|
|
39
|
+
export function suspendChromedriverProxy(this: AndroidUiautomator2Driver): void {
|
|
40
|
+
if (!this.uiautomator2?.proxyReqRes || !this.uiautomator2?.proxyCommand) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
this.chromedriver = undefined;
|
|
45
|
+
this.proxyReqRes = this.uiautomator2.proxyReqRes.bind(this.uiautomator2);
|
|
46
|
+
this.proxyCommand = this.uiautomator2.proxyCommand.bind(this.uiautomator2);
|
|
47
|
+
this.jwpProxyActive = true;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Retrieves device info via the UIA2 server.
|
|
52
|
+
*/
|
|
53
|
+
export async function mobileGetDeviceInfo(this: AndroidUiautomator2Driver): Promise<StringRecord> {
|
|
54
|
+
return (await this.uiautomator2.jwproxy.command('/appium/device/info', 'GET')) as StringRecord;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Resets the accessibility cache on the device.
|
|
59
|
+
*/
|
|
60
|
+
export async function mobileResetAccessibilityCache(this: AndroidUiautomator2Driver): Promise<void> {
|
|
61
|
+
await this.uiautomator2.jwproxy.command('/appium/reset_ax_cache', 'POST', {});
|
|
62
|
+
}
|
|
63
|
+
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "appium-uiautomator2-driver",
|
|
3
|
-
"version": "6.7.
|
|
3
|
+
"version": "6.7.6",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "appium-uiautomator2-driver",
|
|
9
|
-
"version": "6.7.
|
|
9
|
+
"version": "6.7.6",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"appium-adb": "^14.0.0",
|
|
@@ -626,9 +626,9 @@
|
|
|
626
626
|
}
|
|
627
627
|
},
|
|
628
628
|
"node_modules/appium-adb": {
|
|
629
|
-
"version": "14.1.
|
|
630
|
-
"resolved": "https://registry.npmjs.org/appium-adb/-/appium-adb-14.1.
|
|
631
|
-
"integrity": "sha512
|
|
629
|
+
"version": "14.1.8",
|
|
630
|
+
"resolved": "https://registry.npmjs.org/appium-adb/-/appium-adb-14.1.8.tgz",
|
|
631
|
+
"integrity": "sha512-GjJg3/1ZmwFk2YEWsPc/4CuejnpC4G3UN7ZP0dlBpYNHmbaLuUswnZnAhGpp/7yU2cAZXWZf43/5aJdFeoRxJg==",
|
|
632
632
|
"license": "Apache-2.0",
|
|
633
633
|
"dependencies": {
|
|
634
634
|
"@appium/support": "^7.0.0-rc.1",
|
|
@@ -639,22 +639,7 @@
|
|
|
639
639
|
"lodash": "^4.0.0",
|
|
640
640
|
"lru-cache": "^11.1.0",
|
|
641
641
|
"semver": "^7.0.0",
|
|
642
|
-
"teen_process": "^
|
|
643
|
-
},
|
|
644
|
-
"engines": {
|
|
645
|
-
"node": "^20.19.0 || ^22.12.0 || >=24.0.0",
|
|
646
|
-
"npm": ">=10"
|
|
647
|
-
}
|
|
648
|
-
},
|
|
649
|
-
"node_modules/appium-adb/node_modules/teen_process": {
|
|
650
|
-
"version": "3.0.6",
|
|
651
|
-
"resolved": "https://registry.npmjs.org/teen_process/-/teen_process-3.0.6.tgz",
|
|
652
|
-
"integrity": "sha512-nUw1B4MogSZzzy67n37IM1vg4doj+bWOZ7VwIFZGfD7MDmO+FRlhQlA2+22xJnTELVDDlOaTAMpKuuMI2vkDtg==",
|
|
653
|
-
"license": "Apache-2.0",
|
|
654
|
-
"dependencies": {
|
|
655
|
-
"bluebird": "^3.7.2",
|
|
656
|
-
"lodash": "^4.17.21",
|
|
657
|
-
"shell-quote": "^1.8.1"
|
|
642
|
+
"teen_process": "^4.0.4"
|
|
658
643
|
},
|
|
659
644
|
"engines": {
|
|
660
645
|
"node": "^20.19.0 || ^22.12.0 || >=24.0.0",
|
|
@@ -662,9 +647,9 @@
|
|
|
662
647
|
}
|
|
663
648
|
},
|
|
664
649
|
"node_modules/appium-android-driver": {
|
|
665
|
-
"version": "12.6.
|
|
666
|
-
"resolved": "https://registry.npmjs.org/appium-android-driver/-/appium-android-driver-12.6.
|
|
667
|
-
"integrity": "sha512-
|
|
650
|
+
"version": "12.6.2",
|
|
651
|
+
"resolved": "https://registry.npmjs.org/appium-android-driver/-/appium-android-driver-12.6.2.tgz",
|
|
652
|
+
"integrity": "sha512-jQbYHQXtBGgcpXskEvv2s+xtvC1MvcSOU5HD8eKdHpVZvQEnTdcOx3mZyG31UgxryVwj/rboIKRseDy4fTaXew==",
|
|
668
653
|
"license": "Apache-2.0",
|
|
669
654
|
"dependencies": {
|
|
670
655
|
"@appium/support": "^7.0.0-rc.1",
|
|
@@ -681,7 +666,7 @@
|
|
|
681
666
|
"moment-timezone": "^0.x",
|
|
682
667
|
"portscanner": "^2.2.0",
|
|
683
668
|
"semver": "^7.0.0",
|
|
684
|
-
"teen_process": "^
|
|
669
|
+
"teen_process": "^4.0.7",
|
|
685
670
|
"ws": "^8.0.0"
|
|
686
671
|
},
|
|
687
672
|
"engines": {
|
|
@@ -692,25 +677,10 @@
|
|
|
692
677
|
"appium": "^3.0.0-rc.2"
|
|
693
678
|
}
|
|
694
679
|
},
|
|
695
|
-
"node_modules/appium-android-driver/node_modules/teen_process": {
|
|
696
|
-
"version": "3.0.6",
|
|
697
|
-
"resolved": "https://registry.npmjs.org/teen_process/-/teen_process-3.0.6.tgz",
|
|
698
|
-
"integrity": "sha512-nUw1B4MogSZzzy67n37IM1vg4doj+bWOZ7VwIFZGfD7MDmO+FRlhQlA2+22xJnTELVDDlOaTAMpKuuMI2vkDtg==",
|
|
699
|
-
"license": "Apache-2.0",
|
|
700
|
-
"dependencies": {
|
|
701
|
-
"bluebird": "^3.7.2",
|
|
702
|
-
"lodash": "^4.17.21",
|
|
703
|
-
"shell-quote": "^1.8.1"
|
|
704
|
-
},
|
|
705
|
-
"engines": {
|
|
706
|
-
"node": "^20.19.0 || ^22.12.0 || >=24.0.0",
|
|
707
|
-
"npm": ">=10"
|
|
708
|
-
}
|
|
709
|
-
},
|
|
710
680
|
"node_modules/appium-chromedriver": {
|
|
711
|
-
"version": "8.0
|
|
712
|
-
"resolved": "https://registry.npmjs.org/appium-chromedriver/-/appium-chromedriver-8.0.
|
|
713
|
-
"integrity": "sha512-
|
|
681
|
+
"version": "8.1.0",
|
|
682
|
+
"resolved": "https://registry.npmjs.org/appium-chromedriver/-/appium-chromedriver-8.1.0.tgz",
|
|
683
|
+
"integrity": "sha512-zrruUWsDYSk5fdApN7yv9CY35VUp45oTOct+Hc+IidPXPQDyuHcgyeMgpTY8y4FhiiQ89fD4NZNsjwAcqbIxuA==",
|
|
714
684
|
"license": "Apache-2.0",
|
|
715
685
|
"dependencies": {
|
|
716
686
|
"@appium/base-driver": "^10.0.0-rc.2",
|
|
@@ -4089,9 +4059,9 @@
|
|
|
4089
4059
|
}
|
|
4090
4060
|
},
|
|
4091
4061
|
"node_modules/teen_process": {
|
|
4092
|
-
"version": "4.0.
|
|
4093
|
-
"resolved": "https://registry.npmjs.org/teen_process/-/teen_process-4.0.
|
|
4094
|
-
"integrity": "sha512-
|
|
4062
|
+
"version": "4.0.7",
|
|
4063
|
+
"resolved": "https://registry.npmjs.org/teen_process/-/teen_process-4.0.7.tgz",
|
|
4064
|
+
"integrity": "sha512-t7+1xY+WfihWM8M2JxL9ueH/SfDE7bhMuuVMR8bqrttQ0nn95hvOpGqThtZ2S/4+RvrJx2+UWO9no7wDFrOdsw==",
|
|
4095
4065
|
"license": "Apache-2.0",
|
|
4096
4066
|
"dependencies": {
|
|
4097
4067
|
"bluebird": "^3.7.2",
|