appium-uiautomator2-driver 2.42.2 → 2.43.1
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 +14 -0
- package/build/lib/commands/actions.d.ts +22 -1
- package/build/lib/commands/actions.d.ts.map +1 -1
- package/build/lib/commands/actions.js +30 -62
- package/build/lib/commands/actions.js.map +1 -1
- package/build/lib/commands/alert.d.ts +28 -1
- package/build/lib/commands/alert.d.ts.map +1 -1
- package/build/lib/commands/alert.js +42 -23
- package/build/lib/commands/alert.js.map +1 -1
- package/build/lib/commands/app-management.d.ts +19 -0
- package/build/lib/commands/app-management.d.ts.map +1 -0
- package/build/lib/commands/app-management.js +45 -0
- package/build/lib/commands/app-management.js.map +1 -0
- package/build/lib/commands/app-strings.d.ts +9 -0
- package/build/lib/commands/app-strings.d.ts.map +1 -1
- package/build/lib/commands/app-strings.js +11 -79
- package/build/lib/commands/app-strings.js.map +1 -1
- package/build/lib/commands/battery.d.ts +7 -0
- package/build/lib/commands/battery.d.ts.map +1 -1
- package/build/lib/commands/battery.js +14 -20
- package/build/lib/commands/battery.js.map +1 -1
- package/build/lib/commands/element.d.ts +100 -1
- package/build/lib/commands/element.d.ts.map +1 -1
- package/build/lib/commands/element.js +175 -125
- package/build/lib/commands/element.js.map +1 -1
- package/build/lib/commands/execute.d.ts +25 -0
- package/build/lib/commands/execute.d.ts.map +1 -0
- package/build/lib/commands/execute.js +109 -0
- package/build/lib/commands/execute.js.map +1 -0
- package/build/lib/commands/find.d.ts +10 -0
- package/build/lib/commands/find.d.ts.map +1 -1
- package/build/lib/commands/find.js +25 -27
- package/build/lib/commands/find.js.map +1 -1
- package/build/lib/commands/gestures.d.ts +103 -1
- package/build/lib/commands/gestures.d.ts.map +1 -1
- package/build/lib/commands/gestures.js +202 -173
- package/build/lib/commands/gestures.js.map +1 -1
- package/build/lib/commands/keyboard.d.ts +47 -0
- package/build/lib/commands/keyboard.d.ts.map +1 -0
- package/build/lib/commands/keyboard.js +92 -0
- package/build/lib/commands/keyboard.js.map +1 -0
- package/build/lib/commands/misc.d.ts +48 -0
- package/build/lib/commands/misc.d.ts.map +1 -0
- package/build/lib/commands/misc.js +75 -0
- package/build/lib/commands/misc.js.map +1 -0
- package/build/lib/commands/navigation.d.ts +20 -0
- package/build/lib/commands/navigation.d.ts.map +1 -0
- package/build/lib/commands/navigation.js +35 -0
- package/build/lib/commands/navigation.js.map +1 -0
- package/build/lib/commands/screenshot.d.ts +24 -1
- package/build/lib/commands/screenshot.d.ts.map +1 -1
- package/build/lib/commands/screenshot.js +87 -64
- package/build/lib/commands/screenshot.js.map +1 -1
- package/build/lib/commands/touch.d.ts +81 -0
- package/build/lib/commands/touch.d.ts.map +1 -1
- package/build/lib/commands/touch.js +158 -41
- package/build/lib/commands/touch.js.map +1 -1
- package/build/lib/commands/viewport.d.ts +37 -1
- package/build/lib/commands/viewport.d.ts.map +1 -1
- package/build/lib/commands/viewport.js +80 -36
- package/build/lib/commands/viewport.js.map +1 -1
- package/build/lib/driver.d.ts +94 -24
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +114 -28
- package/build/lib/driver.js.map +1 -1
- package/build/lib/helpers.d.ts +12 -6
- package/build/lib/helpers.d.ts.map +1 -1
- package/build/lib/helpers.js +18 -18
- package/build/lib/helpers.js.map +1 -1
- package/build/lib/method-map.d.ts +0 -23
- package/build/lib/method-map.d.ts.map +1 -1
- package/build/lib/uiautomator2.js +3 -3
- package/build/lib/uiautomator2.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/lib/commands/actions.js +37 -114
- package/lib/commands/alert.js +51 -37
- package/lib/commands/app-management.js +42 -0
- package/lib/commands/app-strings.js +9 -89
- package/lib/commands/battery.js +16 -26
- package/lib/commands/element.js +235 -214
- package/lib/commands/execute.js +120 -0
- package/lib/commands/find.js +31 -37
- package/lib/commands/gestures.js +252 -234
- package/lib/commands/keyboard.js +103 -0
- package/lib/commands/misc.js +106 -0
- package/lib/commands/navigation.js +31 -0
- package/lib/commands/screenshot.js +96 -77
- package/lib/commands/touch.js +190 -48
- package/lib/commands/viewport.js +100 -50
- package/lib/driver.ts +225 -36
- package/lib/helpers.js +15 -22
- package/lib/uiautomator2.js +3 -3
- package/npm-shrinkwrap.json +34 -34
- package/package.json +2 -2
- package/build/lib/commands/general.d.ts +0 -4
- package/build/lib/commands/general.d.ts.map +0 -1
- package/build/lib/commands/general.js +0 -214
- package/build/lib/commands/general.js.map +0 -1
- package/build/lib/commands/index.d.ts +0 -2
- package/build/lib/commands/index.d.ts.map +0 -1
- package/build/lib/commands/index.js +0 -14
- package/build/lib/commands/index.js.map +0 -1
- package/build/lib/commands/mixins.d.ts +0 -87
- package/build/lib/commands/mixins.d.ts.map +0 -1
- package/build/lib/commands/mixins.js +0 -26
- package/build/lib/commands/mixins.js.map +0 -1
- package/build/lib/utils.d.ts +0 -10
- package/build/lib/utils.d.ts.map +0 -1
- package/build/lib/utils.js +0 -26
- package/build/lib/utils.js.map +0 -1
- package/lib/commands/general.js +0 -289
- package/lib/commands/index.js +0 -11
- package/lib/commands/mixins.ts +0 -169
- package/lib/utils.js +0 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [2.43.1](https://github.com/appium/appium-uiautomator2-driver/compare/v2.43.0...v2.43.1) (2024-01-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* createADB ([#724](https://github.com/appium/appium-uiautomator2-driver/issues/724)) ([fef068a](https://github.com/appium/appium-uiautomator2-driver/commit/fef068a4c5d4513223c1f9e3a5f1ba53c32adec6))
|
|
7
|
+
|
|
8
|
+
## [2.43.0](https://github.com/appium/appium-uiautomator2-driver/compare/v2.42.2...v2.43.0) (2024-01-25)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* Update android-driver ([#720](https://github.com/appium/appium-uiautomator2-driver/issues/720)) ([f352359](https://github.com/appium/appium-uiautomator2-driver/commit/f35235970904fd89f736b4fdd9a8635858719edb))
|
|
14
|
+
|
|
1
15
|
## [2.42.2](https://github.com/appium/appium-uiautomator2-driver/compare/v2.42.1...v2.42.2) (2024-01-23)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -1,2 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* See https://github.com/appium/appium-uiautomator2-driver/blob/master/docs/scheduled-actions.md#mobile-scheduleaction
|
|
3
|
+
* @this {AndroidUiautomator2Driver}
|
|
4
|
+
* @param {Record<string, any>} [opts={}]
|
|
5
|
+
* @returns {Promise<any>}
|
|
6
|
+
*/
|
|
7
|
+
export function mobileScheduleAction(this: import("../driver").AndroidUiautomator2Driver, opts?: Record<string, any> | undefined): Promise<any>;
|
|
8
|
+
/**
|
|
9
|
+
* @see https://github.com/appium/appium-uiautomator2-driver/blob/master/docs/scheduled-actions.md#mobile-getactionhistory
|
|
10
|
+
* @this {AndroidUiautomator2Driver}
|
|
11
|
+
* @param {import('./types').ActionArgs} [opts={}]
|
|
12
|
+
* @returns {Promise<import('./types').ActionResult>}
|
|
13
|
+
*/
|
|
14
|
+
export function mobileGetActionHistory(this: import("../driver").AndroidUiautomator2Driver, opts?: import("./types").ActionArgs | undefined): Promise<import('./types').ActionResult>;
|
|
15
|
+
/**
|
|
16
|
+
* @this {AndroidUiautomator2Driver}
|
|
17
|
+
* @see https://github.com/appium/appium-uiautomator2-driver/blob/master/docs/scheduled-actions.md#mobile-unscheduleaction
|
|
18
|
+
* @param {import('./types').ActionArgs} [opts={}]
|
|
19
|
+
* @returns {Promise<any>}
|
|
20
|
+
*/
|
|
21
|
+
export function mobileUnscheduleAction(this: import("../driver").AndroidUiautomator2Driver, opts?: import("./types").ActionArgs | undefined): Promise<any>;
|
|
22
|
+
export type AndroidUiautomator2Driver = import('../driver').AndroidUiautomator2Driver;
|
|
2
23
|
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../lib/commands/actions.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../lib/commands/actions.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,mIAFa,QAAQ,GAAG,CAAC,CAQxB;AAED;;;;;GAKG;AACH,8IAFa,QAAQ,OAAO,SAAS,EAAE,YAAY,CAAC,CAUnD;AAED;;;;;GAKG;AACH,8IAFa,QAAQ,GAAG,CAAC,CAQxB;wCAGY,OAAO,WAAW,EAAE,yBAAyB"}
|
|
@@ -1,69 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// @ts-check
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
|
|
3
|
+
exports.mobileUnscheduleAction = exports.mobileGetActionHistory = exports.mobileScheduleAction = void 0;
|
|
5
4
|
/**
|
|
6
|
-
*
|
|
7
|
-
* @
|
|
5
|
+
* See https://github.com/appium/appium-uiautomator2-driver/blob/master/docs/scheduled-actions.md#mobile-scheduleaction
|
|
6
|
+
* @this {AndroidUiautomator2Driver}
|
|
7
|
+
* @param {Record<string, any>} [opts={}]
|
|
8
|
+
* @returns {Promise<any>}
|
|
8
9
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
metastate,
|
|
14
|
-
flags,
|
|
15
|
-
});
|
|
16
|
-
},
|
|
17
|
-
async longPressKeyCode(keycode, metastate, flags) {
|
|
18
|
-
await this.uiautomator2.jwproxy.command('/appium/device/long_press_keycode', 'POST', {
|
|
19
|
-
keycode,
|
|
20
|
-
metastate,
|
|
21
|
-
flags,
|
|
22
|
-
});
|
|
23
|
-
},
|
|
24
|
-
async doSwipe(swipeOpts) {
|
|
25
|
-
await this.uiautomator2.jwproxy.command(`/touch/perform`, 'POST', swipeOpts);
|
|
26
|
-
},
|
|
27
|
-
async doDrag(dragOpts) {
|
|
28
|
-
await this.uiautomator2.jwproxy.command(`/touch/drag`, 'POST', dragOpts);
|
|
29
|
-
},
|
|
30
|
-
async getOrientation() {
|
|
31
|
-
return /** @type {import('@appium/types').Orientation} */ (await this.uiautomator2.jwproxy.command(`/orientation`, 'GET', {}));
|
|
32
|
-
},
|
|
33
|
-
async setOrientation(orientation) {
|
|
34
|
-
orientation = /** @type {import('@appium/types').Orientation} */ (orientation.toUpperCase());
|
|
35
|
-
await this.uiautomator2.jwproxy.command(`/orientation`, 'POST', { orientation });
|
|
36
|
-
},
|
|
37
|
-
async mobilePressKey(opts) {
|
|
38
|
-
const { keycode, metastate, flags, isLongPress = false } = opts;
|
|
39
|
-
await this.uiautomator2.jwproxy.command(`/appium/device/${isLongPress ? 'long_' : ''}press_keycode`, 'POST', {
|
|
40
|
-
keycode,
|
|
41
|
-
metastate,
|
|
42
|
-
flags,
|
|
43
|
-
});
|
|
44
|
-
},
|
|
45
|
-
/**
|
|
46
|
-
* See https://github.com/appium/appium-uiautomator2-driver/blob/master/docs/scheduled-actions.md#mobile-scheduleaction
|
|
47
|
-
* @param {Record<string, any>} opts
|
|
48
|
-
*/
|
|
49
|
-
async mobileScheduleAction(opts = {}) {
|
|
50
|
-
return await this.uiautomator2.jwproxy.command('/appium/schedule_action', 'POST', opts);
|
|
51
|
-
},
|
|
52
|
-
/**
|
|
53
|
-
* @see https://github.com/appium/appium-uiautomator2-driver/blob/master/docs/scheduled-actions.md#mobile-getactionhistory
|
|
54
|
-
*/
|
|
55
|
-
async mobileGetActionHistory(opts) {
|
|
56
|
-
return /** @type {import('./types').ActionResult} */ (await this.uiautomator2.jwproxy.command('/appium/action_history', 'POST', opts ?? {}));
|
|
57
|
-
},
|
|
58
|
-
/**
|
|
59
|
-
* @see https://github.com/appium/appium-uiautomator2-driver/blob/master/docs/scheduled-actions.md#mobile-unscheduleaction
|
|
60
|
-
*/
|
|
61
|
-
async mobileUnscheduleAction(opts) {
|
|
62
|
-
return await this.uiautomator2.jwproxy.command('/appium/unschedule_action', 'POST', opts ?? {});
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
(0, mixins_1.mixin)(ActionsMixin);
|
|
10
|
+
async function mobileScheduleAction(opts = {}) {
|
|
11
|
+
return await this.uiautomator2.jwproxy.command('/appium/schedule_action', 'POST', opts);
|
|
12
|
+
}
|
|
13
|
+
exports.mobileScheduleAction = mobileScheduleAction;
|
|
66
14
|
/**
|
|
67
|
-
* @
|
|
15
|
+
* @see https://github.com/appium/appium-uiautomator2-driver/blob/master/docs/scheduled-actions.md#mobile-getactionhistory
|
|
16
|
+
* @this {AndroidUiautomator2Driver}
|
|
17
|
+
* @param {import('./types').ActionArgs} [opts={}]
|
|
18
|
+
* @returns {Promise<import('./types').ActionResult>}
|
|
19
|
+
*/
|
|
20
|
+
async function mobileGetActionHistory(opts) {
|
|
21
|
+
return /** @type {import('./types').ActionResult} */ (await this.uiautomator2.jwproxy.command('/appium/action_history', 'POST', opts ?? {}));
|
|
22
|
+
}
|
|
23
|
+
exports.mobileGetActionHistory = mobileGetActionHistory;
|
|
24
|
+
/**
|
|
25
|
+
* @this {AndroidUiautomator2Driver}
|
|
26
|
+
* @see https://github.com/appium/appium-uiautomator2-driver/blob/master/docs/scheduled-actions.md#mobile-unscheduleaction
|
|
27
|
+
* @param {import('./types').ActionArgs} [opts={}]
|
|
28
|
+
* @returns {Promise<any>}
|
|
29
|
+
*/
|
|
30
|
+
async function mobileUnscheduleAction(opts) {
|
|
31
|
+
return await this.uiautomator2.jwproxy.command('/appium/unschedule_action', 'POST', opts ?? {});
|
|
32
|
+
}
|
|
33
|
+
exports.mobileUnscheduleAction = mobileUnscheduleAction;
|
|
34
|
+
/**
|
|
35
|
+
* @typedef {import('../driver').AndroidUiautomator2Driver} AndroidUiautomator2Driver
|
|
68
36
|
*/
|
|
69
37
|
//# sourceMappingURL=actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../lib/commands/actions.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../lib/commands/actions.js"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACI,KAAK,UAAU,oBAAoB,CAAC,IAAI,GAAG,EAAE;IAClD,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAC5C,yBAAyB,EACzB,MAAM,EACN,IAAI,CACL,CAAC;AACJ,CAAC;AAND,oDAMC;AAED;;;;;GAKG;AACI,KAAK,UAAU,sBAAsB,CAAC,IAAI;IAC/C,OAAO,6CAA6C,CAAC,CACnD,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CACrC,wBAAwB,EACxB,MAAM,EACN,IAAI,IAAI,EAAE,CACX,CACF,CAAC;AACJ,CAAC;AARD,wDAQC;AAED;;;;;GAKG;AACI,KAAK,UAAU,sBAAsB,CAAC,IAAI;IAC/C,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAC5C,2BAA2B,EAC3B,MAAM,EACN,IAAI,IAAI,EAAE,CACX,CAAC;AACJ,CAAC;AAND,wDAMC;AAED;;GAEG"}
|
|
@@ -1,2 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @this {AndroidUiautomator2Driver}
|
|
3
|
+
* @returns {Promise<string>}
|
|
4
|
+
*/
|
|
5
|
+
export function getAlertText(this: import("../driver").AndroidUiautomator2Driver): Promise<string>;
|
|
6
|
+
/**
|
|
7
|
+
* @this {AndroidUiautomator2Driver}
|
|
8
|
+
* @param {import('./types').AcceptAlertOptions} [opts={}]
|
|
9
|
+
* @returns {Promise<void>}
|
|
10
|
+
*/
|
|
11
|
+
export function mobileAcceptAlert(this: import("../driver").AndroidUiautomator2Driver, opts?: import("./types").AcceptAlertOptions | undefined): Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
* @this {AndroidUiautomator2Driver}
|
|
14
|
+
* @returns {Promise<void>}
|
|
15
|
+
*/
|
|
16
|
+
export function postAcceptAlert(this: import("../driver").AndroidUiautomator2Driver): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* @this {AndroidUiautomator2Driver}
|
|
19
|
+
* @param {import('./types').DismissAlertOptions} [opts={}]
|
|
20
|
+
* @returns {Promise<void>}
|
|
21
|
+
*/
|
|
22
|
+
export function mobileDismissAlert(this: import("../driver").AndroidUiautomator2Driver, opts?: import("./types").DismissAlertOptions | undefined): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* @this {AndroidUiautomator2Driver}
|
|
25
|
+
* @returns {Promise<void>}
|
|
26
|
+
*/
|
|
27
|
+
export function postDismissAlert(this: import("../driver").AndroidUiautomator2Driver): Promise<void>;
|
|
28
|
+
export type AndroidUiautomator2Driver = import('../driver').AndroidUiautomator2Driver;
|
|
2
29
|
//# sourceMappingURL=alert.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../lib/commands/alert.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../lib/commands/alert.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,mFAFa,QAAQ,MAAM,CAAC,CAU3B;AAED;;;;GAIG;AACH,iJAFa,QAAQ,IAAI,CAAC,CAQzB;AAED;;;GAGG;AACH,sFAFa,QAAQ,IAAI,CAAC,CAIzB;AAED;;;;GAIG;AACH,mJAFa,QAAQ,IAAI,CAAC,CAQzB;AAED;;;GAGG;AACH,uFAFa,QAAQ,IAAI,CAAC,CAIzB;wCAGY,OAAO,WAAW,EAAE,yBAAyB"}
|
|
@@ -1,30 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// @ts-check
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
|
|
3
|
+
exports.postDismissAlert = exports.mobileDismissAlert = exports.postAcceptAlert = exports.mobileAcceptAlert = exports.getAlertText = void 0;
|
|
5
4
|
/**
|
|
6
|
-
* @
|
|
7
|
-
* @
|
|
5
|
+
* @this {AndroidUiautomator2Driver}
|
|
6
|
+
* @returns {Promise<string>}
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
async mobileAcceptAlert(opts = {}) {
|
|
14
|
-
await this.uiautomator2.jwproxy.command('/alert/accept', 'POST', opts);
|
|
15
|
-
},
|
|
16
|
-
async postAcceptAlert() {
|
|
17
|
-
await this.mobileAcceptAlert();
|
|
18
|
-
},
|
|
19
|
-
async mobileDismissAlert(opts = {}) {
|
|
20
|
-
await this.uiautomator2.jwproxy.command('/alert/dismiss', 'POST', opts);
|
|
21
|
-
},
|
|
22
|
-
async postDismissAlert() {
|
|
23
|
-
await this.mobileDismissAlert();
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
(0, mixins_1.mixin)(AlertMixin);
|
|
8
|
+
async function getAlertText() {
|
|
9
|
+
return String(await this.uiautomator2.jwproxy.command('/alert/text', 'GET', {}));
|
|
10
|
+
}
|
|
11
|
+
exports.getAlertText = getAlertText;
|
|
27
12
|
/**
|
|
28
|
-
* @
|
|
13
|
+
* @this {AndroidUiautomator2Driver}
|
|
14
|
+
* @param {import('./types').AcceptAlertOptions} [opts={}]
|
|
15
|
+
* @returns {Promise<void>}
|
|
16
|
+
*/
|
|
17
|
+
async function mobileAcceptAlert(opts = {}) {
|
|
18
|
+
await this.uiautomator2.jwproxy.command('/alert/accept', 'POST', opts);
|
|
19
|
+
}
|
|
20
|
+
exports.mobileAcceptAlert = mobileAcceptAlert;
|
|
21
|
+
/**
|
|
22
|
+
* @this {AndroidUiautomator2Driver}
|
|
23
|
+
* @returns {Promise<void>}
|
|
24
|
+
*/
|
|
25
|
+
async function postAcceptAlert() {
|
|
26
|
+
await this.mobileAcceptAlert();
|
|
27
|
+
}
|
|
28
|
+
exports.postAcceptAlert = postAcceptAlert;
|
|
29
|
+
/**
|
|
30
|
+
* @this {AndroidUiautomator2Driver}
|
|
31
|
+
* @param {import('./types').DismissAlertOptions} [opts={}]
|
|
32
|
+
* @returns {Promise<void>}
|
|
33
|
+
*/
|
|
34
|
+
async function mobileDismissAlert(opts = {}) {
|
|
35
|
+
await this.uiautomator2.jwproxy.command('/alert/dismiss', 'POST', opts);
|
|
36
|
+
}
|
|
37
|
+
exports.mobileDismissAlert = mobileDismissAlert;
|
|
38
|
+
/**
|
|
39
|
+
* @this {AndroidUiautomator2Driver}
|
|
40
|
+
* @returns {Promise<void>}
|
|
41
|
+
*/
|
|
42
|
+
async function postDismissAlert() {
|
|
43
|
+
await this.mobileDismissAlert();
|
|
44
|
+
}
|
|
45
|
+
exports.postDismissAlert = postDismissAlert;
|
|
46
|
+
/**
|
|
47
|
+
* @typedef {import('../driver').AndroidUiautomator2Driver} AndroidUiautomator2Driver
|
|
29
48
|
*/
|
|
30
49
|
//# sourceMappingURL=alert.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.js","sourceRoot":"","sources":["../../../lib/commands/alert.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"alert.js","sourceRoot":"","sources":["../../../lib/commands/alert.js"],"names":[],"mappings":";;;AAAA;;;GAGG;AACI,KAAK,UAAU,YAAY;IAChC,OAAO,MAAM,CACX,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CACrC,aAAa,EACb,KAAK,EACL,EAAE,CACH,CACF,CAAC;AACJ,CAAC;AARD,oCAQC;AAED;;;;GAIG;AACI,KAAK,UAAU,iBAAiB,CAAC,IAAI,GAAG,EAAE;IAC/C,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CACrC,eAAe,EACf,MAAM,EACN,IAAI,CACL,CAAC;AACJ,CAAC;AAND,8CAMC;AAED;;;GAGG;AACI,KAAK,UAAU,eAAe;IACnC,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC;AACjC,CAAC;AAFD,0CAEC;AAED;;;;GAIG;AACI,KAAK,UAAU,kBAAkB,CAAC,IAAI,GAAG,EAAE;IAChD,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CACrC,gBAAgB,EAChB,MAAM,EACN,IAAI,CACL,CAAC;AACJ,CAAC;AAND,gDAMC;AAED;;;GAGG;AACI,KAAK,UAAU,gBAAgB;IACpC,MAAM,IAAI,CAAC,kBAAkB,EAAE,CAAC;AAClC,CAAC;AAFD,4CAEC;AAED;;GAEG"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Install multiple APKs with `install-multiple` option.
|
|
3
|
+
* @this {AndroidUiautomator2Driver}=
|
|
4
|
+
* @param {import('./types').InstallMultipleApksOptions} opts
|
|
5
|
+
* @throws {Error} if an error occured while installing the given APKs.
|
|
6
|
+
* @returns {Promise<void>}
|
|
7
|
+
*/
|
|
8
|
+
export function mobileInstallMultipleApks(this: import("../driver").AndroidUiautomator2Driver, opts: import('./types').InstallMultipleApksOptions): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Puts the app to background and waits the given number of seconds Then restores the app
|
|
11
|
+
* if necessary. The call is blocking.
|
|
12
|
+
* @this {AndroidUiautomator2Driver}=
|
|
13
|
+
* @param {import('./types').BackgroundAppOptions} [opts={}]
|
|
14
|
+
* @returns {Promise<void>}
|
|
15
|
+
*/
|
|
16
|
+
export function mobileBackgroundApp(this: import("../driver").AndroidUiautomator2Driver, opts?: import("./types").BackgroundAppOptions | undefined): Promise<void>;
|
|
17
|
+
export type AndroidUiautomator2Driver = import('../driver').AndroidUiautomator2Driver;
|
|
18
|
+
export type StringRecord<T = any> = import('@appium/types').StringRecord<T>;
|
|
19
|
+
//# sourceMappingURL=app-management.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-management.d.ts","sourceRoot":"","sources":["../../../lib/commands/app-management.js"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,qGAJW,OAAO,SAAS,EAAE,0BAA0B,GAE1C,QAAQ,IAAI,CAAC,CAUzB;AAED;;;;;;GAMG;AACH,qJAFa,QAAQ,IAAI,CAAC,CAKzB;wCAGY,OAAO,WAAW,EAAE,yBAAyB;oCAK7C,OAAO,eAAe,EAAE,YAAY,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.mobileBackgroundApp = exports.mobileInstallMultipleApks = void 0;
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
const bluebird_1 = __importDefault(require("bluebird"));
|
|
9
|
+
const driver_1 = require("appium/driver");
|
|
10
|
+
const extensions_1 = require("../extensions");
|
|
11
|
+
/**
|
|
12
|
+
* Install multiple APKs with `install-multiple` option.
|
|
13
|
+
* @this {AndroidUiautomator2Driver}=
|
|
14
|
+
* @param {import('./types').InstallMultipleApksOptions} opts
|
|
15
|
+
* @throws {Error} if an error occured while installing the given APKs.
|
|
16
|
+
* @returns {Promise<void>}
|
|
17
|
+
*/
|
|
18
|
+
async function mobileInstallMultipleApks(opts) {
|
|
19
|
+
if (!lodash_1.default.isArray(opts.apks) || lodash_1.default.isEmpty(opts.apks)) {
|
|
20
|
+
throw new driver_1.errors.InvalidArgumentError('No apks are given to install');
|
|
21
|
+
}
|
|
22
|
+
const apks = await bluebird_1.default.all(opts.apks.map((app) => this.helpers.configureApp(app, [extensions_1.APK_EXTENSION])));
|
|
23
|
+
await this.adb.installMultipleApks(apks, opts.options);
|
|
24
|
+
}
|
|
25
|
+
exports.mobileInstallMultipleApks = mobileInstallMultipleApks;
|
|
26
|
+
/**
|
|
27
|
+
* Puts the app to background and waits the given number of seconds Then restores the app
|
|
28
|
+
* if necessary. The call is blocking.
|
|
29
|
+
* @this {AndroidUiautomator2Driver}=
|
|
30
|
+
* @param {import('./types').BackgroundAppOptions} [opts={}]
|
|
31
|
+
* @returns {Promise<void>}
|
|
32
|
+
*/
|
|
33
|
+
async function mobileBackgroundApp(opts = {}) {
|
|
34
|
+
const { seconds = -1 } = opts;
|
|
35
|
+
await this.background(seconds);
|
|
36
|
+
}
|
|
37
|
+
exports.mobileBackgroundApp = mobileBackgroundApp;
|
|
38
|
+
/**
|
|
39
|
+
* @typedef {import('../driver').AndroidUiautomator2Driver} AndroidUiautomator2Driver
|
|
40
|
+
*/
|
|
41
|
+
/**
|
|
42
|
+
* @template [T=any]
|
|
43
|
+
* @typedef {import('@appium/types').StringRecord<T>} StringRecord
|
|
44
|
+
*/
|
|
45
|
+
//# sourceMappingURL=app-management.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-management.js","sourceRoot":"","sources":["../../../lib/commands/app-management.js"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AACvB,wDAAyB;AACzB,0CAAqC;AACrC,8CAA4C;AAE5C;;;;;;GAMG;AACI,KAAK,UAAU,yBAAyB,CAAC,IAAI;IAClD,IAAI,CAAC,gBAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,gBAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QACjD,MAAM,IAAI,eAAM,CAAC,oBAAoB,CAAC,8BAA8B,CAAC,CAAC;KACvE;IACD,MAAM,IAAI,GAAG,MAAM,kBAAC,CAAC,GAAG,CACtB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,0BAAa,CAAC,CAAC,CAAC,CACxE,CAAC;IACF,MAAM,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;AACzD,CAAC;AARD,8DAQC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,mBAAmB,CAAC,IAAI,GAAG,EAAE;IACjD,MAAM,EAAC,OAAO,GAAG,CAAC,CAAC,EAAC,GAAG,IAAI,CAAC;IAC5B,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC;AAHD,kDAGC;AAED;;GAEG;AAEH;;;GAGG"}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retrives app strings from its resources for the given language
|
|
3
|
+
* or the default device language.
|
|
4
|
+
* @this {AndroidUiautomator2Driver}
|
|
5
|
+
* @param {import('./types').GetAppStringsOptions} [opts={}]
|
|
6
|
+
* @returns {Promise<StringRecord>}
|
|
7
|
+
*/
|
|
8
|
+
export function mobileGetAppStrings(this: import("../driver").AndroidUiautomator2Driver, opts?: import("./types").GetAppStringsOptions | undefined): Promise<StringRecord>;
|
|
1
9
|
export type ADB = import('appium-adb').ADB;
|
|
2
10
|
export type StringRecord = import('@appium/types').StringRecord;
|
|
11
|
+
export type AndroidUiautomator2Driver = import('../driver').AndroidUiautomator2Driver;
|
|
3
12
|
//# sourceMappingURL=app-strings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-strings.d.ts","sourceRoot":"","sources":["../../../lib/commands/app-strings.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app-strings.d.ts","sourceRoot":"","sources":["../../../lib/commands/app-strings.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,qJAFa,QAAQ,YAAY,CAAC,CAIjC;kBAGY,OAAO,YAAY,EAAE,GAAG;2BACxB,OAAO,eAAe,EAAE,YAAY;wCACpC,OAAO,WAAW,EAAE,yBAAyB"}
|
|
@@ -1,88 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// @ts-check
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
|
|
8
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
-
const support_1 = require("appium/support");
|
|
3
|
+
exports.mobileGetAppStrings = void 0;
|
|
10
4
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
5
|
+
* Retrives app strings from its resources for the given language
|
|
6
|
+
* or the default device language.
|
|
7
|
+
* @this {AndroidUiautomator2Driver}
|
|
8
|
+
* @param {import('./types').GetAppStringsOptions} [opts={}]
|
|
9
|
+
* @returns {Promise<StringRecord>}
|
|
13
10
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
this.log.info(`No language specified, returning strings for: ${language}`);
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Clients require the resulting mapping to have both keys
|
|
22
|
-
* and values of type string
|
|
23
|
-
* @param {StringRecord} mapping
|
|
24
|
-
*/
|
|
25
|
-
const preprocessStringsMap = function (mapping) {
|
|
26
|
-
/** @type {StringRecord} */
|
|
27
|
-
const result = {};
|
|
28
|
-
for (const [key, value] of lodash_1.default.toPairs(mapping)) {
|
|
29
|
-
result[key] = lodash_1.default.isString(value) ? value : JSON.stringify(value);
|
|
30
|
-
}
|
|
31
|
-
return result;
|
|
32
|
-
};
|
|
33
|
-
if (this.apkStrings[language]) {
|
|
34
|
-
// Return cached strings
|
|
35
|
-
return preprocessStringsMap(this.apkStrings[language]);
|
|
36
|
-
}
|
|
37
|
-
if (!this.opts.app && !this.opts.appPackage) {
|
|
38
|
-
this.log.errorAndThrow("One of 'app' or 'appPackage' capabilities should must be specified");
|
|
39
|
-
throw new Error(); // unreachable
|
|
40
|
-
}
|
|
41
|
-
let app = this.opts.app;
|
|
42
|
-
const tmpRoot = await support_1.tempDir.openDir();
|
|
43
|
-
try {
|
|
44
|
-
if (!app) {
|
|
45
|
-
try {
|
|
46
|
-
app = await this.adb.pullApk(/** @type {string} */ (this.opts.appPackage), tmpRoot);
|
|
47
|
-
}
|
|
48
|
-
catch (err) {
|
|
49
|
-
this.log.errorAndThrow(`Failed to pull an apk from '${this.opts.appPackage}'. Original error: ${
|
|
50
|
-
/** @type {Error} */ (err).message}`);
|
|
51
|
-
throw new Error(); // unreachable
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
if (!(await support_1.fs.exists(app))) {
|
|
55
|
-
this.log.errorAndThrow(`The app at '${app}' does not exist`);
|
|
56
|
-
throw new Error(); // unreachable
|
|
57
|
-
}
|
|
58
|
-
try {
|
|
59
|
-
const { apkStrings } = await this.adb.extractStringsFromApk(app, language, tmpRoot);
|
|
60
|
-
this.apkStrings[language] = apkStrings;
|
|
61
|
-
return preprocessStringsMap(apkStrings);
|
|
62
|
-
}
|
|
63
|
-
catch (err) {
|
|
64
|
-
this.log.errorAndThrow(`Cannot extract strings from '${app}'. Original error: ${
|
|
65
|
-
/** @type {Error} */ (err).message}`);
|
|
66
|
-
throw new Error(); // unreachable
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
finally {
|
|
70
|
-
await support_1.fs.rimraf(tmpRoot);
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
/**
|
|
74
|
-
* Retrives app strings from its resources for the given language
|
|
75
|
-
* or the default device language.
|
|
76
|
-
*
|
|
77
|
-
* @returns App strings map
|
|
78
|
-
*/
|
|
79
|
-
async mobileGetAppStrings(opts) {
|
|
80
|
-
return await this.getStrings(opts?.language);
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
(0, mixins_1.mixin)(AppStringsMixin);
|
|
11
|
+
async function mobileGetAppStrings(opts) {
|
|
12
|
+
return await this.getStrings(opts?.language);
|
|
13
|
+
}
|
|
14
|
+
exports.mobileGetAppStrings = mobileGetAppStrings;
|
|
84
15
|
/**
|
|
85
16
|
* @typedef {import('appium-adb').ADB} ADB
|
|
86
17
|
* @typedef {import('@appium/types').StringRecord} StringRecord
|
|
18
|
+
* @typedef {import('../driver').AndroidUiautomator2Driver} AndroidUiautomator2Driver
|
|
87
19
|
*/
|
|
88
20
|
//# sourceMappingURL=app-strings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-strings.js","sourceRoot":"","sources":["../../../lib/commands/app-strings.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app-strings.js","sourceRoot":"","sources":["../../../lib/commands/app-strings.js"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACI,KAAK,UAAU,mBAAmB,CAAC,IAAI;IAC5C,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC/C,CAAC;AAFD,kDAEC;AAED;;;;GAIG"}
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads the battery information from the device under test.
|
|
3
|
+
* @this {AndroidUiautomator2Driver}
|
|
4
|
+
* @returns {Promise<import('./types').BatteryInfo>} The actual battery info
|
|
5
|
+
*/
|
|
6
|
+
export function mobileGetBatteryInfo(this: import("../driver").AndroidUiautomator2Driver): Promise<import('./types').BatteryInfo>;
|
|
1
7
|
export type BatteryInfo = import('./types').BatteryInfo;
|
|
8
|
+
export type AndroidUiautomator2Driver = import('../driver').AndroidUiautomator2Driver;
|
|
2
9
|
//# sourceMappingURL=battery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"battery.d.ts","sourceRoot":"","sources":["../../../lib/commands/battery.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"battery.d.ts","sourceRoot":"","sources":["../../../lib/commands/battery.js"],"names":[],"mappings":"AACA;;;;GAIG;AACH,2FAFa,QAAQ,OAAO,SAAS,EAAE,WAAW,CAAC,CAalD;0BAGY,OAAO,SAAS,EAAE,WAAW;wCAC7B,OAAO,WAAW,EAAE,yBAAyB"}
|
|
@@ -1,28 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// @ts-check
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
|
|
3
|
+
exports.mobileGetBatteryInfo = void 0;
|
|
5
4
|
/**
|
|
6
|
-
*
|
|
7
|
-
* @
|
|
5
|
+
* Reads the battery information from the device under test.
|
|
6
|
+
* @this {AndroidUiautomator2Driver}
|
|
7
|
+
* @returns {Promise<import('./types').BatteryInfo>} The actual battery info
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
// Give it the same name as in iOS
|
|
19
|
-
batteryInfo.state = result.status;
|
|
20
|
-
delete batteryInfo.status;
|
|
21
|
-
return /** @type {BatteryInfo} */ (batteryInfo);
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
(0, mixins_1.mixin)(BatteryMixin);
|
|
9
|
+
async function mobileGetBatteryInfo() {
|
|
10
|
+
const result = /** @type {import('./types').MapKey<BatteryInfo, 'state', 'status'>} */ (await /** @type {import('../uiautomator2').UiAutomator2Server} */ (this.uiautomator2).jwproxy.command('/appium/device/battery_info', 'GET', {}));
|
|
11
|
+
const batteryInfo = /** @type {any} */ (result);
|
|
12
|
+
// Give it the same name as in iOS
|
|
13
|
+
batteryInfo.state = result.status;
|
|
14
|
+
delete batteryInfo.status;
|
|
15
|
+
return /** @type {BatteryInfo} */ (batteryInfo);
|
|
16
|
+
}
|
|
17
|
+
exports.mobileGetBatteryInfo = mobileGetBatteryInfo;
|
|
25
18
|
/**
|
|
26
19
|
* @typedef {import('./types').BatteryInfo} BatteryInfo
|
|
20
|
+
* @typedef {import('../driver').AndroidUiautomator2Driver} AndroidUiautomator2Driver
|
|
27
21
|
*/
|
|
28
22
|
//# sourceMappingURL=battery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"battery.js","sourceRoot":"","sources":["../../../lib/commands/battery.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"battery.js","sourceRoot":"","sources":["../../../lib/commands/battery.js"],"names":[],"mappings":";;;AACA;;;;GAIG;AACI,KAAK,UAAU,oBAAoB;IACxC,MAAM,MAAM,GAAG,uEAAuE,CAAC,CACrF,MAAM,2DAA2D,CAAC,CAChE,IAAI,CAAC,YAAY,CAClB,CAAC,OAAO,CAAC,OAAO,CAAC,6BAA6B,EAAE,KAAK,EAAE,EAAE,CAAC,CAC5D,CAAC;IACF,MAAM,WAAW,GAAG,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;IAChD,kCAAkC;IAClC,WAAW,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;IAClC,OAAO,WAAW,CAAC,MAAM,CAAC;IAC1B,OAAO,0BAA0B,CAAC,CAAC,WAAW,CAAC,CAAC;AAClD,CAAC;AAXD,oDAWC;AAED;;;GAGG"}
|