appium-uiautomator2-driver 6.7.5 → 6.7.7
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 +12 -0
- package/build/lib/commands/actions.d.ts +26 -29
- package/build/lib/commands/actions.d.ts.map +1 -1
- package/build/lib/commands/actions.js +19 -27
- package/build/lib/commands/actions.js.map +1 -1
- package/build/lib/commands/alert.d.ts +14 -22
- package/build/lib/commands/alert.d.ts.map +1 -1
- package/build/lib/commands/alert.js +8 -19
- package/build/lib/commands/alert.js.map +1 -1
- package/build/lib/commands/app-management.d.ts +7 -10
- package/build/lib/commands/app-management.d.ts.map +1 -1
- package/build/lib/commands/app-management.js +4 -14
- package/build/lib/commands/app-management.js.map +1 -1
- package/build/lib/commands/battery.d.ts +4 -5
- package/build/lib/commands/battery.d.ts.map +1 -1
- package/build/lib/commands/battery.js +4 -9
- package/build/lib/commands/battery.js.map +1 -1
- package/build/lib/commands/clipboard.d.ts +9 -13
- package/build/lib/commands/clipboard.d.ts.map +1 -1
- package/build/lib/commands/clipboard.js +7 -14
- package/build/lib/commands/clipboard.js.map +1 -1
- package/build/lib/commands/element.d.ts +64 -69
- package/build/lib/commands/element.d.ts.map +1 -1
- package/build/lib/commands/element.js +64 -84
- package/build/lib/commands/element.js.map +1 -1
- package/build/lib/commands/find.d.ts +13 -9
- package/build/lib/commands/find.d.ts.map +1 -1
- package/build/lib/commands/find.js +4 -16
- package/build/lib/commands/find.js.map +1 -1
- package/build/lib/commands/gestures.d.ts +87 -189
- package/build/lib/commands/gestures.d.ts.map +1 -1
- package/build/lib/commands/gestures.js +77 -204
- package/build/lib/commands/gestures.js.map +1 -1
- package/build/lib/commands/keyboard.d.ts +30 -41
- package/build/lib/commands/keyboard.d.ts.map +1 -1
- package/build/lib/commands/keyboard.js +22 -37
- package/build/lib/commands/keyboard.js.map +1 -1
- package/build/lib/commands/misc.d.ts +19 -35
- package/build/lib/commands/misc.d.ts.map +1 -1
- package/build/lib/commands/misc.js +15 -30
- package/build/lib/commands/misc.js.map +1 -1
- package/build/lib/commands/navigation.d.ts +11 -16
- package/build/lib/commands/navigation.d.ts.map +1 -1
- package/build/lib/commands/navigation.js +9 -17
- package/build/lib/commands/navigation.js.map +1 -1
- package/build/lib/commands/viewport.d.ts +23 -22
- package/build/lib/commands/viewport.d.ts.map +1 -1
- package/build/lib/commands/viewport.js +17 -24
- package/build/lib/commands/viewport.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/lib/commands/actions.ts +95 -0
- package/lib/commands/alert.ts +46 -0
- package/lib/commands/app-management.ts +25 -0
- package/lib/commands/battery.ts +19 -0
- package/lib/commands/clipboard.ts +29 -0
- package/lib/commands/element.ts +180 -0
- package/lib/commands/find.ts +48 -0
- package/lib/commands/gestures.ts +297 -0
- package/lib/commands/keyboard.ts +102 -0
- package/lib/commands/misc.ts +67 -0
- package/lib/commands/navigation.ts +32 -0
- package/lib/commands/viewport.ts +78 -0
- package/npm-shrinkwrap.json +16 -46
- package/package.json +1 -1
- package/lib/commands/actions.js +0 -107
- package/lib/commands/alert.js +0 -63
- package/lib/commands/app-management.js +0 -32
- package/lib/commands/battery.js +0 -23
- package/lib/commands/clipboard.js +0 -37
- package/lib/commands/element.js +0 -261
- package/lib/commands/find.js +0 -47
- package/lib/commands/gestures.js +0 -446
- package/lib/commands/keyboard.js +0 -108
- package/lib/commands/misc.js +0 -109
- package/lib/commands/navigation.js +0 -33
- package/lib/commands/viewport.js +0 -100
package/lib/commands/viewport.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
// memoized in constructor
|
|
3
|
-
/**
|
|
4
|
-
* @this {AndroidUiautomator2Driver}
|
|
5
|
-
* @returns {Promise<number>}
|
|
6
|
-
*/
|
|
7
|
-
export async function getStatusBarHeight() {
|
|
8
|
-
const {statusBar} = /** @type {{statusBar: number}} */ (
|
|
9
|
-
await /** @type {import('../uiautomator2').UiAutomator2Server} */ (
|
|
10
|
-
this.uiautomator2
|
|
11
|
-
).jwproxy.command(`/appium/device/system_bars`, 'GET', {})
|
|
12
|
-
);
|
|
13
|
-
return statusBar;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// memoized in constructor
|
|
17
|
-
/**
|
|
18
|
-
* @this {AndroidUiautomator2Driver}
|
|
19
|
-
* @returns {Promise<string>}
|
|
20
|
-
*/
|
|
21
|
-
export async function getDevicePixelRatio() {
|
|
22
|
-
return String(
|
|
23
|
-
await /** @type {import('../uiautomator2').UiAutomator2Server} */ (
|
|
24
|
-
this.uiautomator2
|
|
25
|
-
).jwproxy.command('/appium/device/pixel_ratio', 'GET', {})
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* @this {AndroidUiautomator2Driver}
|
|
31
|
-
* @returns {Promise<import('./types').RelativeRect>}
|
|
32
|
-
*/
|
|
33
|
-
export async function getViewPortRect() {
|
|
34
|
-
const windowSize = await this.getWindowSize();
|
|
35
|
-
const statusBarHeight = await this.getStatusBarHeight();
|
|
36
|
-
// android returns the upscaled window size, so to get the true size of the
|
|
37
|
-
// rect we have to downscale
|
|
38
|
-
return {
|
|
39
|
-
left: 0,
|
|
40
|
-
top: statusBarHeight,
|
|
41
|
-
width: windowSize.width,
|
|
42
|
-
height: windowSize.height - statusBarHeight,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Returns the viewport coordinates.
|
|
48
|
-
* @this {AndroidUiautomator2Driver}
|
|
49
|
-
* @returns {Promise<import('./types').RelativeRect>} The viewport coordinates.
|
|
50
|
-
*/
|
|
51
|
-
export async function mobileViewPortRect() {
|
|
52
|
-
return await this.getViewPortRect();
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// For W3C
|
|
56
|
-
/**
|
|
57
|
-
* @this {AndroidUiautomator2Driver}
|
|
58
|
-
* @returns {Promise<import('@appium/types').Rect>}
|
|
59
|
-
*/
|
|
60
|
-
export async function getWindowRect() {
|
|
61
|
-
const {width, height} = await this.getWindowSize();
|
|
62
|
-
return {
|
|
63
|
-
width,
|
|
64
|
-
height,
|
|
65
|
-
x: 0,
|
|
66
|
-
y: 0,
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* @this {AndroidUiautomator2Driver}
|
|
72
|
-
* @returns {Promise<number>}
|
|
73
|
-
*/
|
|
74
|
-
export async function getDisplayDensity() {
|
|
75
|
-
return /** @type {number} */ (
|
|
76
|
-
await this.uiautomator2.jwproxy.command(
|
|
77
|
-
'/appium/device/display_density',
|
|
78
|
-
'GET',
|
|
79
|
-
{}
|
|
80
|
-
)
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* @this {AndroidUiautomator2Driver}
|
|
86
|
-
* @returns {Promise<import('@appium/types').Size>}
|
|
87
|
-
*/
|
|
88
|
-
export async function getWindowSize() {
|
|
89
|
-
return /** @type {import('@appium/types').Size} */ (
|
|
90
|
-
await this.uiautomator2.jwproxy.command(
|
|
91
|
-
'/window/current/size',
|
|
92
|
-
'GET',
|
|
93
|
-
{}
|
|
94
|
-
)
|
|
95
|
-
);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* @typedef {import('../driver').AndroidUiautomator2Driver} AndroidUiautomator2Driver
|
|
100
|
-
*/
|