appium-uiautomator2-driver 6.7.4 → 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 +12 -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 +17 -47
- package/package.json +2 -2
- package/lib/commands/element.js +0 -261
- package/lib/commands/gestures.js +0 -446
- package/lib/commands/misc.js +0 -109
|
@@ -1,51 +1,31 @@
|
|
|
1
|
+
import type { Orientation, StringRecord } from '@appium/types';
|
|
2
|
+
import type { AndroidUiautomator2Driver } from '../driver';
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @returns {Promise<string>}
|
|
4
|
+
* Retrieves the current page source.
|
|
4
5
|
*/
|
|
5
|
-
export function getPageSource(this:
|
|
6
|
+
export declare function getPageSource(this: AndroidUiautomator2Driver): Promise<string>;
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
-
* @returns {Promise<import('@appium/types').Orientation>}
|
|
8
|
+
* Gets the current device orientation.
|
|
9
9
|
*/
|
|
10
|
-
export function getOrientation(this:
|
|
10
|
+
export declare function getOrientation(this: AndroidUiautomator2Driver): Promise<Orientation>;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
* @param {import('@appium/types').Orientation} orientation
|
|
14
|
-
* @returns {Promise<void>}
|
|
12
|
+
* Sets the device orientation.
|
|
15
13
|
*/
|
|
16
|
-
export function setOrientation(this:
|
|
14
|
+
export declare function setOrientation(this: AndroidUiautomator2Driver, orientation: Orientation): Promise<void>;
|
|
17
15
|
/**
|
|
18
|
-
*
|
|
19
|
-
* @returns {Promise<void>}
|
|
16
|
+
* Opens the device notification shade.
|
|
20
17
|
*/
|
|
21
|
-
export function openNotifications(this:
|
|
18
|
+
export declare function openNotifications(this: AndroidUiautomator2Driver): Promise<void>;
|
|
22
19
|
/**
|
|
23
|
-
*
|
|
24
|
-
* @this {AndroidUiautomator2Driver}
|
|
25
|
-
* @returns {void}
|
|
20
|
+
* Stops proxying to Chromedriver and restores UIA2 proxy.
|
|
26
21
|
*/
|
|
27
|
-
export function suspendChromedriverProxy(this:
|
|
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
|
-
*
|
|
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:
|
|
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:
|
|
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.
|
|
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
|
-
*
|
|
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
|
-
*
|
|
19
|
-
* @returns {Promise<import('@appium/types').Orientation>}
|
|
17
|
+
* Gets the current device orientation.
|
|
20
18
|
*/
|
|
21
19
|
async function getOrientation() {
|
|
22
|
-
return
|
|
20
|
+
return (await this.uiautomator2.jwproxy.command(`/orientation`, 'GET', {}));
|
|
23
21
|
}
|
|
24
22
|
/**
|
|
25
|
-
*
|
|
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
|
-
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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 =
|
|
44
|
+
this.proxyCommand = this.uiautomator2.proxyCommand.bind(this.uiautomator2);
|
|
52
45
|
this.jwpProxyActive = true;
|
|
53
46
|
}
|
|
54
47
|
/**
|
|
55
|
-
*
|
|
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
|
|
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.
|
|
1
|
+
{"version":3,"file":"misc.js","sourceRoot":"","sources":["../../../lib/commands/misc.ts"],"names":[],"mappings":";;AAMA,sCAEC;AAKD,wCAEC;AAKD,wCAMC;AAKD,8CAEC;AAKD,4DASC;AAKD,kDAEC;AAKD,sEAEC;AA1DD;;GAEG;AACI,KAAK,UAAU,aAAa;IACjC,OAAO,MAAM,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/E,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,cAAc;IAClC,OAAO,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,EAAE,KAAK,EAAE,EAAE,CAAC,CAAgB,CAAC;AAC7F,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,cAAc,CAElC,WAAwB;IAExB,MAAM,qBAAqB,GAAG,WAAW,CAAC,WAAW,EAAiB,CAAC;IACvE,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,EAAE,EAAC,WAAW,EAAE,qBAAqB,EAAC,CAAC,CAAC;AACxG,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,iBAAiB;IACrC,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,mCAAmC,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;AAC3F,CAAC;AAED;;GAEG;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,SAAS,CAAC;IAC9B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACzE,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC3E,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;AAC7B,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,mBAAmB;IACvC,OAAO,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAiB,CAAC;AACjG,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,6BAA6B;IACjD,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,wBAAwB,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;AAChF,CAAC"}
|