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.
Files changed (114) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/build/lib/commands/actions.d.ts +22 -1
  3. package/build/lib/commands/actions.d.ts.map +1 -1
  4. package/build/lib/commands/actions.js +30 -62
  5. package/build/lib/commands/actions.js.map +1 -1
  6. package/build/lib/commands/alert.d.ts +28 -1
  7. package/build/lib/commands/alert.d.ts.map +1 -1
  8. package/build/lib/commands/alert.js +42 -23
  9. package/build/lib/commands/alert.js.map +1 -1
  10. package/build/lib/commands/app-management.d.ts +19 -0
  11. package/build/lib/commands/app-management.d.ts.map +1 -0
  12. package/build/lib/commands/app-management.js +45 -0
  13. package/build/lib/commands/app-management.js.map +1 -0
  14. package/build/lib/commands/app-strings.d.ts +9 -0
  15. package/build/lib/commands/app-strings.d.ts.map +1 -1
  16. package/build/lib/commands/app-strings.js +11 -79
  17. package/build/lib/commands/app-strings.js.map +1 -1
  18. package/build/lib/commands/battery.d.ts +7 -0
  19. package/build/lib/commands/battery.d.ts.map +1 -1
  20. package/build/lib/commands/battery.js +14 -20
  21. package/build/lib/commands/battery.js.map +1 -1
  22. package/build/lib/commands/element.d.ts +100 -1
  23. package/build/lib/commands/element.d.ts.map +1 -1
  24. package/build/lib/commands/element.js +175 -125
  25. package/build/lib/commands/element.js.map +1 -1
  26. package/build/lib/commands/execute.d.ts +25 -0
  27. package/build/lib/commands/execute.d.ts.map +1 -0
  28. package/build/lib/commands/execute.js +109 -0
  29. package/build/lib/commands/execute.js.map +1 -0
  30. package/build/lib/commands/find.d.ts +10 -0
  31. package/build/lib/commands/find.d.ts.map +1 -1
  32. package/build/lib/commands/find.js +25 -27
  33. package/build/lib/commands/find.js.map +1 -1
  34. package/build/lib/commands/gestures.d.ts +103 -1
  35. package/build/lib/commands/gestures.d.ts.map +1 -1
  36. package/build/lib/commands/gestures.js +202 -173
  37. package/build/lib/commands/gestures.js.map +1 -1
  38. package/build/lib/commands/keyboard.d.ts +47 -0
  39. package/build/lib/commands/keyboard.d.ts.map +1 -0
  40. package/build/lib/commands/keyboard.js +92 -0
  41. package/build/lib/commands/keyboard.js.map +1 -0
  42. package/build/lib/commands/misc.d.ts +48 -0
  43. package/build/lib/commands/misc.d.ts.map +1 -0
  44. package/build/lib/commands/misc.js +75 -0
  45. package/build/lib/commands/misc.js.map +1 -0
  46. package/build/lib/commands/navigation.d.ts +20 -0
  47. package/build/lib/commands/navigation.d.ts.map +1 -0
  48. package/build/lib/commands/navigation.js +35 -0
  49. package/build/lib/commands/navigation.js.map +1 -0
  50. package/build/lib/commands/screenshot.d.ts +24 -1
  51. package/build/lib/commands/screenshot.d.ts.map +1 -1
  52. package/build/lib/commands/screenshot.js +87 -64
  53. package/build/lib/commands/screenshot.js.map +1 -1
  54. package/build/lib/commands/touch.d.ts +81 -0
  55. package/build/lib/commands/touch.d.ts.map +1 -1
  56. package/build/lib/commands/touch.js +158 -41
  57. package/build/lib/commands/touch.js.map +1 -1
  58. package/build/lib/commands/viewport.d.ts +37 -1
  59. package/build/lib/commands/viewport.d.ts.map +1 -1
  60. package/build/lib/commands/viewport.js +80 -36
  61. package/build/lib/commands/viewport.js.map +1 -1
  62. package/build/lib/driver.d.ts +94 -24
  63. package/build/lib/driver.d.ts.map +1 -1
  64. package/build/lib/driver.js +114 -28
  65. package/build/lib/driver.js.map +1 -1
  66. package/build/lib/helpers.d.ts +12 -6
  67. package/build/lib/helpers.d.ts.map +1 -1
  68. package/build/lib/helpers.js +18 -18
  69. package/build/lib/helpers.js.map +1 -1
  70. package/build/lib/method-map.d.ts +0 -23
  71. package/build/lib/method-map.d.ts.map +1 -1
  72. package/build/lib/uiautomator2.js +3 -3
  73. package/build/lib/uiautomator2.js.map +1 -1
  74. package/build/tsconfig.tsbuildinfo +1 -1
  75. package/lib/commands/actions.js +37 -114
  76. package/lib/commands/alert.js +51 -37
  77. package/lib/commands/app-management.js +42 -0
  78. package/lib/commands/app-strings.js +9 -89
  79. package/lib/commands/battery.js +16 -26
  80. package/lib/commands/element.js +235 -214
  81. package/lib/commands/execute.js +120 -0
  82. package/lib/commands/find.js +31 -37
  83. package/lib/commands/gestures.js +252 -234
  84. package/lib/commands/keyboard.js +103 -0
  85. package/lib/commands/misc.js +106 -0
  86. package/lib/commands/navigation.js +31 -0
  87. package/lib/commands/screenshot.js +96 -77
  88. package/lib/commands/touch.js +190 -48
  89. package/lib/commands/viewport.js +100 -50
  90. package/lib/driver.ts +225 -36
  91. package/lib/helpers.js +15 -22
  92. package/lib/uiautomator2.js +3 -3
  93. package/npm-shrinkwrap.json +34 -34
  94. package/package.json +2 -2
  95. package/build/lib/commands/general.d.ts +0 -4
  96. package/build/lib/commands/general.d.ts.map +0 -1
  97. package/build/lib/commands/general.js +0 -214
  98. package/build/lib/commands/general.js.map +0 -1
  99. package/build/lib/commands/index.d.ts +0 -2
  100. package/build/lib/commands/index.d.ts.map +0 -1
  101. package/build/lib/commands/index.js +0 -14
  102. package/build/lib/commands/index.js.map +0 -1
  103. package/build/lib/commands/mixins.d.ts +0 -87
  104. package/build/lib/commands/mixins.d.ts.map +0 -1
  105. package/build/lib/commands/mixins.js +0 -26
  106. package/build/lib/commands/mixins.js.map +0 -1
  107. package/build/lib/utils.d.ts +0 -10
  108. package/build/lib/utils.d.ts.map +0 -1
  109. package/build/lib/utils.js +0 -26
  110. package/build/lib/utils.js.map +0 -1
  111. package/lib/commands/general.js +0 -289
  112. package/lib/commands/index.js +0 -11
  113. package/lib/commands/mixins.ts +0 -169
  114. package/lib/utils.js +0 -19
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../../lib/commands/keyboard.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,2FALW,MAAM,GAAC,MAAM,+DAGX,QAAQ,IAAI,CAAC,CAYzB;AAED;;;;;;GAMG;AACH,+FALW,MAAM,GAAC,MAAM,aACb,MAAM,+BAEJ,QAAQ,IAAI,CAAC,CAYzB;AAED;;;;GAIG;AACH,0FAHW,OAAO,SAAS,EAAE,eAAe,GAC/B,QAAQ,IAAI,CAAC,CAczB;AAED;;;;;;;;GAQG;AACH,sFAJW,OAAO,SAAS,EAAE,aAAa,GAC7B,QAAQ,OAAO,CAAC,CAS5B;AAED;;;;GAIG;AACH,wFAHW,OAAO,uBAAuB,EAAE,YAAY,GAC1C,QAAQ,IAAI,CAAC,CAQzB;AAED;;;;;GAKG;AACH,uFAJW,MAAM,GAAC,MAAM,mCAEX,QAAQ,IAAI,CAAC,CAKzB;wCAGY,OAAO,WAAW,EAAE,yBAAyB"}
@@ -0,0 +1,92 @@
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.keyevent = exports.doSendKeys = exports.mobileType = exports.mobilePressKey = exports.longPressKeyCode = exports.pressKeyCode = void 0;
7
+ const lodash_1 = __importDefault(require("lodash"));
8
+ /**
9
+ * @this {AndroidUiautomator2Driver}
10
+ * @param {string|number} keycode
11
+ * @param {number} [metastate]
12
+ * @param {number} [flags]
13
+ * @returns {Promise<void>}
14
+ */
15
+ async function pressKeyCode(keycode, metastate, flags) {
16
+ await this.uiautomator2.jwproxy.command('/appium/device/press_keycode', 'POST', {
17
+ keycode,
18
+ metastate,
19
+ flags,
20
+ });
21
+ }
22
+ exports.pressKeyCode = pressKeyCode;
23
+ /**
24
+ * @this {AndroidUiautomator2Driver}
25
+ * @param {string|number} keycode
26
+ * @param {number} metastate
27
+ * @param {number} [flags]
28
+ * @returns {Promise<void>}
29
+ */
30
+ async function longPressKeyCode(keycode, metastate, flags) {
31
+ await this.uiautomator2.jwproxy.command('/appium/device/long_press_keycode', 'POST', {
32
+ keycode,
33
+ metastate,
34
+ flags,
35
+ });
36
+ }
37
+ exports.longPressKeyCode = longPressKeyCode;
38
+ /**
39
+ * @this {AndroidUiautomator2Driver}
40
+ * @param {import('./types').PressKeyOptions} opts
41
+ * @returns {Promise<void>}
42
+ */
43
+ async function mobilePressKey(opts) {
44
+ const { keycode, metastate, flags, isLongPress = false } = opts;
45
+ await this.uiautomator2.jwproxy.command(`/appium/device/${isLongPress ? 'long_' : ''}press_keycode`, 'POST', {
46
+ keycode,
47
+ metastate,
48
+ flags,
49
+ });
50
+ }
51
+ exports.mobilePressKey = mobilePressKey;
52
+ /**
53
+ * Types the given Unicode string.
54
+ * It is expected that the focus is already put
55
+ * to the destination input field before this method is called.
56
+ * @this {AndroidUiautomator2Driver}
57
+ * @param {import('./types').TypingOptions} opts
58
+ * @returns {Promise<boolean>} `true` if the input text has been successfully sent to adb
59
+ * @throws {Error} if `text` property has not been provided
60
+ */
61
+ async function mobileType(opts) {
62
+ const { text } = opts;
63
+ if (lodash_1.default.isUndefined(text)) {
64
+ throw this.log.errorAndThrow(`The 'text' argument is mandatory`);
65
+ }
66
+ return await this.settingsApp.typeUnicode(String(text));
67
+ }
68
+ exports.mobileType = mobileType;
69
+ /**
70
+ * @this {AndroidUiautomator2Driver}
71
+ * @param {import('appium-android-driver').SendKeysOpts} params
72
+ * @returns {Promise<void>}
73
+ */
74
+ async function doSendKeys(params) {
75
+ await this.uiautomator2.jwproxy.command('/keys', 'POST', params);
76
+ }
77
+ exports.doSendKeys = doSendKeys;
78
+ /**
79
+ * @this {AndroidUiautomator2Driver}
80
+ * @param {string|number} keycode
81
+ * @param {number} [metastate]
82
+ * @returns {Promise<void>}
83
+ */
84
+ async function keyevent(keycode, metastate) {
85
+ this.log.debug(`Ignoring metastate ${metastate}`);
86
+ await this.adb.keyevent(keycode);
87
+ }
88
+ exports.keyevent = keyevent;
89
+ /**
90
+ * @typedef {import('../driver').AndroidUiautomator2Driver} AndroidUiautomator2Driver
91
+ */
92
+ //# sourceMappingURL=keyboard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyboard.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CAAC;AAC1D,CAAC;AAND,gCAMC;AAED;;;;GAIG;AACI,KAAK,UAAU,UAAU,CAAC,MAAM;IACrC,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CACrC,OAAO,EACP,MAAM,EACN,MAAM,CACP,CAAC;AACJ,CAAC;AAND,gCAMC;AAED;;;;;GAKG;AACI,KAAK,UAAU,QAAQ,CAAC,OAAO,EAAE,SAAS;IAC/C,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,sBAAsB,SAAS,EAAE,CAAC,CAAC;IAClD,MAAM,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AACnC,CAAC;AAHD,4BAGC;AAED;;GAEG"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * @this {AndroidUiautomator2Driver}
3
+ * @returns {Promise<string>}
4
+ */
5
+ export function getPageSource(this: import("../driver").AndroidUiautomator2Driver): Promise<string>;
6
+ /**
7
+ * @this {AndroidUiautomator2Driver}
8
+ * @returns {Promise<import('@appium/types').Orientation>}
9
+ */
10
+ export function getOrientation(this: import("../driver").AndroidUiautomator2Driver): Promise<import('@appium/types').Orientation>;
11
+ /**
12
+ * @this {AndroidUiautomator2Driver}
13
+ * @param {import('@appium/types').Orientation} orientation
14
+ * @returns {Promise<void>}
15
+ */
16
+ export function setOrientation(this: import("../driver").AndroidUiautomator2Driver, orientation: import('@appium/types').Orientation): Promise<void>;
17
+ /**
18
+ * @this {AndroidUiautomator2Driver}
19
+ * @returns {Promise<string>}
20
+ */
21
+ export function getClipboard(this: import("../driver").AndroidUiautomator2Driver): Promise<string>;
22
+ /**
23
+ * @this {AndroidUiautomator2Driver}
24
+ * @returns {Promise<void>}
25
+ */
26
+ export function openNotifications(this: import("../driver").AndroidUiautomator2Driver): Promise<void>;
27
+ /**
28
+ * Stop proxying to any Chromedriver and redirect to uiautomator2
29
+ * @this {AndroidUiautomator2Driver}
30
+ * @returns {void}
31
+ */
32
+ export function suspendChromedriverProxy(this: import("../driver").AndroidUiautomator2Driver): void;
33
+ export class suspendChromedriverProxy {
34
+ chromedriver: any;
35
+ proxyReqRes: any;
36
+ proxyCommand: (<TReq = any, TRes = unknown>(url: string, method: import("@appium/types").HTTPMethod, body?: TReq | undefined) => Promise<TRes>) | undefined;
37
+ jwpProxyActive: boolean;
38
+ }
39
+ /**
40
+ * The list of available info entries can be found at
41
+ * https://github.com/appium/appium-uiautomator2-server/blob/master/app/src/main/java/io/appium/uiautomator2/handler/GetDeviceInfo.java
42
+ * @this {AndroidUiautomator2Driver}
43
+ * @returns {Promise<StringRecord>}
44
+ */
45
+ export function mobileGetDeviceInfo(this: import("../driver").AndroidUiautomator2Driver): Promise<StringRecord>;
46
+ export type StringRecord<T = any> = import('@appium/types').StringRecord<T>;
47
+ export type AndroidUiautomator2Driver<T = any> = import('../driver').AndroidUiautomator2Driver;
48
+ //# sourceMappingURL=misc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../../lib/commands/misc.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oFAFa,QAAQ,MAAM,CAAC,CAU3B;AAED;;;GAGG;AACH,qFAFa,QAAQ,OAAO,eAAe,EAAE,WAAW,CAAC,CAUxD;AAED;;;;GAIG;AACH,iGAHW,OAAO,eAAe,EAAE,WAAW,GACjC,QAAQ,IAAI,CAAC,CASzB;AAED;;;GAGG;AACH,mFAFa,QAAQ,MAAM,CAAC,CAY3B;AAED;;;GAGG;AACH,wFAFa,QAAQ,IAAI,CAAC,CAQzB;AAED;;;;GAIG;AACH,+FAFa,IAAI,CAWhB;;IARC,kBAA6B;IAC7B,iBAEC;IACD,4JAEC;IACD,wBAA0B;;AAG5B;;;;;GAKG;AACH,0FAFa,QAAQ,YAAY,CAAC,CASjC;oCAIY,OAAO,eAAe,EAAE,YAAY,CAAC,CAAC,CAAC;iDACvC,OAAO,WAAW,EAAE,yBAAyB"}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mobileGetDeviceInfo = exports.suspendChromedriverProxy = exports.openNotifications = exports.getClipboard = exports.setOrientation = exports.getOrientation = exports.getPageSource = void 0;
4
+ /**
5
+ * @this {AndroidUiautomator2Driver}
6
+ * @returns {Promise<string>}
7
+ */
8
+ async function getPageSource() {
9
+ return String(await this.uiautomator2.jwproxy.command('/source', 'GET', {}));
10
+ }
11
+ exports.getPageSource = getPageSource;
12
+ /**
13
+ * @this {AndroidUiautomator2Driver}
14
+ * @returns {Promise<import('@appium/types').Orientation>}
15
+ */
16
+ async function getOrientation() {
17
+ return /** @type {import('@appium/types').Orientation} */ (await this.uiautomator2.jwproxy.command(`/orientation`, 'GET', {}));
18
+ }
19
+ exports.getOrientation = getOrientation;
20
+ /**
21
+ * @this {AndroidUiautomator2Driver}
22
+ * @param {import('@appium/types').Orientation} orientation
23
+ * @returns {Promise<void>}
24
+ */
25
+ async function setOrientation(orientation) {
26
+ orientation = /** @type {import('@appium/types').Orientation} */ (orientation.toUpperCase());
27
+ await this.uiautomator2.jwproxy.command(`/orientation`, 'POST', { orientation });
28
+ }
29
+ exports.setOrientation = setOrientation;
30
+ /**
31
+ * @this {AndroidUiautomator2Driver}
32
+ * @returns {Promise<string>}
33
+ */
34
+ async function getClipboard() {
35
+ return String((await this.adb.getApiLevel()) < 29
36
+ ? await this.uiautomator2.jwproxy.command('/appium/device/get_clipboard', 'POST', {})
37
+ : await this.settingsApp.getClipboard());
38
+ }
39
+ exports.getClipboard = getClipboard;
40
+ /**
41
+ * @this {AndroidUiautomator2Driver}
42
+ * @returns {Promise<void>}
43
+ */
44
+ async function openNotifications() {
45
+ await this.uiautomator2.jwproxy.command('/appium/device/open_notifications', 'POST', {});
46
+ }
47
+ exports.openNotifications = openNotifications;
48
+ /**
49
+ * Stop proxying to any Chromedriver and redirect to uiautomator2
50
+ * @this {AndroidUiautomator2Driver}
51
+ * @returns {void}
52
+ */
53
+ function suspendChromedriverProxy() {
54
+ this.chromedriver = undefined;
55
+ this.proxyReqRes = this.uiautomator2.proxyReqRes.bind(this.uiautomator2);
56
+ this.proxyCommand = /** @type {typeof this.proxyCommand} */ (this.uiautomator2.proxyCommand.bind(this.uiautomator2));
57
+ this.jwpProxyActive = true;
58
+ }
59
+ exports.suspendChromedriverProxy = suspendChromedriverProxy;
60
+ /**
61
+ * The list of available info entries can be found at
62
+ * https://github.com/appium/appium-uiautomator2-server/blob/master/app/src/main/java/io/appium/uiautomator2/handler/GetDeviceInfo.java
63
+ * @this {AndroidUiautomator2Driver}
64
+ * @returns {Promise<StringRecord>}
65
+ */
66
+ async function mobileGetDeviceInfo() {
67
+ return /** @type {StringRecord} */ (await this.uiautomator2.jwproxy.command('/appium/device/info', 'GET'));
68
+ }
69
+ exports.mobileGetDeviceInfo = mobileGetDeviceInfo;
70
+ /**
71
+ * @template [T=any]
72
+ * @typedef {import('@appium/types').StringRecord<T>} StringRecord
73
+ * @typedef {import('../driver').AndroidUiautomator2Driver} AndroidUiautomator2Driver
74
+ */
75
+ //# sourceMappingURL=misc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"misc.js","sourceRoot":"","sources":["../../../lib/commands/misc.js"],"names":[],"mappings":";;;AAAA;;;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;AARD,sCAQC;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;AARD,wCAQC;AAED;;;;GAIG;AACI,KAAK,UAAU,cAAc,CAAC,WAAW;IAC9C,WAAW,GAAG,kDAAkD,CAAC,CAAC,WAAW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,kDAOC;AAED;;;;GAIG"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @this {AndroidUiautomator2Driver}
3
+ * @param {string} url
4
+ * @returns {Promise<void>}
5
+ */
6
+ export function setUrl(this: import("../driver").AndroidUiautomator2Driver, url: string): Promise<void>;
7
+ /**
8
+ * Start URL that take users directly to specific content in the app
9
+ * @this {AndroidUiautomator2Driver}
10
+ * @param {import('./types').DeepLinkOpts} opts
11
+ * @returns {Promise<void>}
12
+ */
13
+ export function mobileDeepLink(this: import("../driver").AndroidUiautomator2Driver, opts: import('./types').DeepLinkOpts): Promise<void>;
14
+ /**
15
+ * @this {AndroidUiautomator2Driver}
16
+ * @returns {Promise<void>}
17
+ */
18
+ export function back(this: import("../driver").AndroidUiautomator2Driver): Promise<void>;
19
+ export type AndroidUiautomator2Driver = import('../driver').AndroidUiautomator2Driver;
20
+ //# sourceMappingURL=navigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../lib/commands/navigation.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,iFAHW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAIzB;AAED;;;;;GAKG;AACH,0FAHW,OAAO,SAAS,EAAE,YAAY,GAC5B,QAAQ,IAAI,CAAC,CAKzB;AAED;;;GAGG;AACH,2EAFa,QAAQ,IAAI,CAAC,CAIzB;wCAGY,OAAO,WAAW,EAAE,yBAAyB"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.back = exports.mobileDeepLink = exports.setUrl = void 0;
4
+ /**
5
+ * @this {AndroidUiautomator2Driver}
6
+ * @param {string} url
7
+ * @returns {Promise<void>}
8
+ */
9
+ async function setUrl(url) {
10
+ await this.adb.startUri(url, /** @type {string} */ (this.opts.appPackage));
11
+ }
12
+ exports.setUrl = setUrl;
13
+ /**
14
+ * Start URL that take users directly to specific content in the app
15
+ * @this {AndroidUiautomator2Driver}
16
+ * @param {import('./types').DeepLinkOpts} opts
17
+ * @returns {Promise<void>}
18
+ */
19
+ async function mobileDeepLink(opts) {
20
+ const { url, package: pkg, waitForLaunch } = opts;
21
+ return await this.adb.startUri(url, pkg, { waitForLaunch });
22
+ }
23
+ exports.mobileDeepLink = mobileDeepLink;
24
+ /**
25
+ * @this {AndroidUiautomator2Driver}
26
+ * @returns {Promise<void>}
27
+ */
28
+ async function back() {
29
+ await this.adb.keyevent(4);
30
+ }
31
+ exports.back = back;
32
+ /**
33
+ * @typedef {import('../driver').AndroidUiautomator2Driver} AndroidUiautomator2Driver
34
+ */
35
+ //# sourceMappingURL=navigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../../lib/commands/navigation.js"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACI,KAAK,UAAU,MAAM,CAAC,GAAG;IAC9B,MAAM,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,qBAAqB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;AAC7E,CAAC;AAFD,wBAEC;AAED;;;;;GAKG;AACI,KAAK,UAAU,cAAc,CAAC,IAAI;IACvC,MAAM,EAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,aAAa,EAAC,GAAG,IAAI,CAAC;IAChD,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,EAAC,aAAa,EAAC,CAAC,CAAC;AAC5D,CAAC;AAHD,wCAGC;AAED;;;GAGG;AACI,KAAK,UAAU,IAAI;IACxB,MAAM,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AAC7B,CAAC;AAFD,oBAEC;AAED;;GAEG"}
@@ -1,2 +1,25 @@
1
- export {};
1
+ /**
2
+ * @this {AndroidUiautomator2Driver}
3
+ * @returns {Promise<string>}
4
+ */
5
+ export function mobileViewportScreenshot(this: import("../driver").AndroidUiautomator2Driver): Promise<string>;
6
+ /**
7
+ * @this {AndroidUiautomator2Driver}
8
+ * @returns {Promise<string>}
9
+ */
10
+ export function getViewportScreenshot(this: import("../driver").AndroidUiautomator2Driver): Promise<string>;
11
+ /**
12
+ * @this {AndroidUiautomator2Driver}
13
+ * @returns {Promise<string>}
14
+ */
15
+ export function getScreenshot(this: import("../driver").AndroidUiautomator2Driver): Promise<string>;
16
+ /**
17
+ * Retrieves screenshots of each display available to Android.
18
+ * This functionality is only supported since Android 10.
19
+ * @this {AndroidUiautomator2Driver}
20
+ * @param {import('./types').ScreenshotsOpts} [opts={}]
21
+ * @returns {Promise<import('@appium/types').StringRecord<import('./types').Screenshot>>}
22
+ */
23
+ export function mobileScreenshots(this: import("../driver").AndroidUiautomator2Driver, opts?: import("./types").ScreenshotsOpts | undefined): Promise<import('@appium/types').StringRecord<import('./types').Screenshot>>;
24
+ export type AndroidUiautomator2Driver = import('../driver').AndroidUiautomator2Driver;
2
25
  //# sourceMappingURL=screenshot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../../lib/commands/screenshot.js"],"names":[],"mappings":""}
1
+ {"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../../lib/commands/screenshot.js"],"names":[],"mappings":"AAOA;;;GAGG;AACH,+FAFa,QAAQ,MAAM,CAAC,CAI3B;AAED;;;GAGG;AACH,4FAFa,QAAQ,MAAM,CAAC,CAM3B;AAED;;;GAGG;AACH,oFAFa,QAAQ,MAAM,CAAC,CAkB3B;AAED;;;;;;GAMG;AACH,8IAFa,QAAQ,OAAO,eAAe,EAAE,YAAY,CAAC,OAAO,SAAS,EAAE,UAAU,CAAC,CAAC,CAyDvF;wCAGY,OAAO,WAAW,EAAE,yBAAyB"}
@@ -1,80 +1,103 @@
1
1
  "use strict";
2
- // @ts-check
3
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
4
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
5
4
  };
6
5
  Object.defineProperty(exports, "__esModule", { value: true });
7
- const mixins_1 = require("./mixins");
6
+ exports.mobileScreenshots = exports.getScreenshot = exports.getViewportScreenshot = exports.mobileViewportScreenshot = void 0;
8
7
  const lodash_1 = __importDefault(require("lodash"));
9
8
  const bluebird_1 = __importDefault(require("bluebird"));
9
+ const support_1 = require("appium/support");
10
10
  // Display 4619827259835644672 (HWC display 0): port=0 pnpId=GGL displayName="EMU_display_0"
11
11
  const DISPLAY_PATTERN = /^Display\s+(\d+)\s+\(.+display\s+(\d+)\).+displayName="([^"]*)/gm;
12
12
  /**
13
- * @type {import('./mixins').UIA2ScreenshotMixin}
14
- * @satisfies {import('@appium/types').ExternalDriver}
13
+ * @this {AndroidUiautomator2Driver}
14
+ * @returns {Promise<string>}
15
15
  */
16
- const ScreenshotMixin = {
17
- async getScreenshot() {
18
- if (this.mjpegStream) {
19
- const data = await this.mjpegStream.lastChunkPNGBase64();
20
- if (data) {
21
- return data;
22
- }
23
- this.log.warn('Tried to get screenshot from active MJPEG stream, but there ' +
24
- 'was no data yet. Falling back to regular screenshot methods.');
16
+ async function mobileViewportScreenshot() {
17
+ return await this.getViewportScreenshot();
18
+ }
19
+ exports.mobileViewportScreenshot = mobileViewportScreenshot;
20
+ /**
21
+ * @this {AndroidUiautomator2Driver}
22
+ * @returns {Promise<string>}
23
+ */
24
+ async function getViewportScreenshot() {
25
+ const screenshot = await this.getScreenshot();
26
+ const rect = await this.getViewPortRect();
27
+ return await support_1.imageUtil.cropBase64Image(screenshot, rect);
28
+ }
29
+ exports.getViewportScreenshot = getViewportScreenshot;
30
+ /**
31
+ * @this {AndroidUiautomator2Driver}
32
+ * @returns {Promise<string>}
33
+ */
34
+ async function getScreenshot() {
35
+ if (this.mjpegStream) {
36
+ const data = await this.mjpegStream.lastChunkPNGBase64();
37
+ if (data) {
38
+ return data;
25
39
  }
26
- return String(await /** @type {import('../uiautomator2').UiAutomator2Server} */ (this.uiautomator2).jwproxy.command('/screenshot', 'GET'));
27
- },
40
+ this.log.warn('Tried to get screenshot from active MJPEG stream, but there ' +
41
+ 'was no data yet. Falling back to regular screenshot methods.');
42
+ }
43
+ return String(await /** @type {import('../uiautomator2').UiAutomator2Server} */ (this.uiautomator2).jwproxy.command('/screenshot', 'GET'));
44
+ }
45
+ exports.getScreenshot = getScreenshot;
46
+ /**
47
+ * Retrieves screenshots of each display available to Android.
48
+ * This functionality is only supported since Android 10.
49
+ * @this {AndroidUiautomator2Driver}
50
+ * @param {import('./types').ScreenshotsOpts} [opts={}]
51
+ * @returns {Promise<import('@appium/types').StringRecord<import('./types').Screenshot>>}
52
+ */
53
+ async function mobileScreenshots(opts = {}) {
54
+ const displaysInfo = await /** @type {import('appium-adb').ADB} */ (this.adb).shell([
55
+ 'dumpsys',
56
+ 'SurfaceFlinger',
57
+ '--display-id',
58
+ ]);
59
+ /** @type {import('@appium/types').StringRecord<import('./types').Screenshot>} */
60
+ const infos = {};
61
+ let match;
62
+ while ((match = DISPLAY_PATTERN.exec(displaysInfo))) {
63
+ infos[match[1]] = /** @type {any} */ ({
64
+ id: match[1],
65
+ isDefault: match[2] === '0',
66
+ name: match[3],
67
+ });
68
+ }
69
+ if (lodash_1.default.isEmpty(infos)) {
70
+ this.log.debug(displaysInfo);
71
+ throw new Error('Cannot determine the information about connected Android displays');
72
+ }
73
+ this.log.info(`Parsed Android display infos: ${JSON.stringify(infos)}`);
28
74
  /**
29
- * Retrieves screenshots of each display available to Android.
30
- * This functionality is only supported since Android 10.
75
+ * @param {string} dispId
31
76
  */
32
- async mobileScreenshots(opts = {}) {
33
- const displaysInfo = await /** @type {import('appium-adb').ADB} */ (this.adb).shell([
34
- 'dumpsys',
35
- 'SurfaceFlinger',
36
- '--display-id',
37
- ]);
38
- /** @type {import('@appium/types').StringRecord<import('./types').Screenshot>} */
39
- const infos = {};
40
- let match;
41
- while ((match = DISPLAY_PATTERN.exec(displaysInfo))) {
42
- infos[match[1]] = /** @type {any} */ ({
43
- id: match[1],
44
- isDefault: match[2] === '0',
45
- name: match[3],
46
- });
77
+ const toB64Screenshot = async (dispId) => (await /** @type {import('appium-adb').ADB} */ (this.adb).takeScreenshot(dispId)).toString('base64');
78
+ const { displayId } = opts;
79
+ const displayIdStr = lodash_1.default.isNaN(displayId) ? null : `${displayId}`;
80
+ if (displayIdStr) {
81
+ if (!infos[displayIdStr]) {
82
+ throw new Error(`The provided display identifier '${displayId}' is not known. ` +
83
+ `Only the following displays have been detected: ${JSON.stringify(infos)}`);
47
84
  }
48
- if (lodash_1.default.isEmpty(infos)) {
49
- this.log.debug(displaysInfo);
50
- throw new Error('Cannot determine the information about connected Android displays');
51
- }
52
- this.log.info(`Parsed Android display infos: ${JSON.stringify(infos)}`);
53
- /**
54
- * @param {string} dispId
55
- */
56
- const toB64Screenshot = async (dispId) => (await /** @type {import('appium-adb').ADB} */ (this.adb).takeScreenshot(dispId)).toString('base64');
57
- const { displayId } = opts;
58
- const displayIdStr = lodash_1.default.isNaN(displayId) ? null : `${displayId}`;
59
- if (displayIdStr) {
60
- if (!infos[displayIdStr]) {
61
- throw new Error(`The provided display identifier '${displayId}' is not known. ` +
62
- `Only the following displays have been detected: ${JSON.stringify(infos)}`);
63
- }
64
- return {
65
- [displayIdStr]: {
66
- ...infos[displayIdStr],
67
- payload: await toB64Screenshot(displayIdStr),
68
- },
69
- };
70
- }
71
- const allInfos = lodash_1.default.values(infos);
72
- const screenshots = await bluebird_1.default.all(allInfos.map(({ id }) => toB64Screenshot(id)));
73
- for (const [info, payload] of /** @type {[import('./types').Screenshot, string][]} */ (lodash_1.default.zip(allInfos, screenshots))) {
74
- info.payload = payload;
75
- }
76
- return infos;
77
- },
78
- };
79
- (0, mixins_1.mixin)(ScreenshotMixin);
85
+ return {
86
+ [displayIdStr]: {
87
+ ...infos[displayIdStr],
88
+ payload: await toB64Screenshot(displayIdStr),
89
+ },
90
+ };
91
+ }
92
+ const allInfos = lodash_1.default.values(infos);
93
+ const screenshots = await bluebird_1.default.all(allInfos.map(({ id }) => toB64Screenshot(id)));
94
+ for (const [info, payload] of /** @type {[import('./types').Screenshot, string][]} */ (lodash_1.default.zip(allInfos, screenshots))) {
95
+ info.payload = payload;
96
+ }
97
+ return infos;
98
+ }
99
+ exports.mobileScreenshots = mobileScreenshots;
100
+ /**
101
+ * @typedef {import('../driver').AndroidUiautomator2Driver} AndroidUiautomator2Driver
102
+ */
80
103
  //# sourceMappingURL=screenshot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"screenshot.js","sourceRoot":"","sources":["../../../lib/commands/screenshot.js"],"names":[],"mappings":";AAAA,YAAY;;;;;AAEZ,qCAA+B;AAC/B,oDAAuB;AACvB,wDAAyB;AAEzB,4FAA4F;AAC5F,MAAM,eAAe,GAAG,kEAAkE,CAAC;AAE3F;;;GAGG;AACH,MAAM,eAAe,GAAG;IACtB,KAAK,CAAC,aAAa;QACjB,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,kBAAkB,EAAE,CAAC;YACzD,IAAI,IAAI,EAAE;gBACR,OAAO,IAAI,CAAC;aACb;YACD,IAAI,CAAC,GAAG,CAAC,IAAI,CACX,8DAA8D;gBAC5D,8DAA8D,CACjE,CAAC;SACH;QACD,OAAO,MAAM,CACX,MAAM,2DAA2D,CAAC,CAChE,IAAI,CAAC,YAAY,CAClB,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,EAAE,KAAK,CAAC,CACxC,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,iBAAiB,CAAC,IAAI,GAAG,EAAE;QAC/B,MAAM,YAAY,GAAG,MAAM,uCAAuC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC;YAClF,SAAS;YACT,gBAAgB;YAChB,cAAc;SACf,CAAC,CAAC;QACH,iFAAiF;QACjF,MAAM,KAAK,GAAG,EAAE,CAAC;QACjB,IAAI,KAAK,C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
@@ -1,2 +1,83 @@
1
+ /**
2
+ * @deprecated
3
+ * @this {AndroidUiautomator2Driver}
4
+ * @param {import('appium-android-driver').SwipeOpts} swipeOpts
5
+ * @returns {Promise<void>}
6
+ */
7
+ export function doSwipe(this: import("../driver").AndroidUiautomator2Driver, swipeOpts: import('appium-android-driver').SwipeOpts): Promise<void>;
8
+ /**
9
+ * @deprecated
10
+ * @this {AndroidUiautomator2Driver}
11
+ * @param {import('appium-android-driver').DragOpts} dragOpts
12
+ * @returns {Promise<void>}
13
+ */
14
+ export function doDrag(this: import("../driver").AndroidUiautomator2Driver, dragOpts: import('appium-android-driver').DragOpts): Promise<void>;
15
+ /**
16
+ * @deprecated
17
+ * @this {AndroidUiautomator2Driver}
18
+ * @param {string} element
19
+ * @param {number} x
20
+ * @param {number} y
21
+ * @param {number} duration
22
+ * @returns {Promise<void>}
23
+ */
24
+ export function touchLongClick(this: import("../driver").AndroidUiautomator2Driver, element: string, x: number, y: number, duration: number): Promise<void>;
25
+ /**
26
+ * @deprecated
27
+ * @this {AndroidUiautomator2Driver}
28
+ * @param {string} element
29
+ * @param {number} x
30
+ * @param {number} y
31
+ * @returns {Promise<void>}
32
+ */
33
+ export function touchDown(this: import("../driver").AndroidUiautomator2Driver, element: string, x: number, y: number): Promise<void>;
34
+ /**
35
+ * @deprecated
36
+ * @this {AndroidUiautomator2Driver}
37
+ * @param {string} element
38
+ * @param {number} x
39
+ * @param {number} y
40
+ * @returns {Promise<void>}
41
+ */
42
+ export function touchUp(this: import("../driver").AndroidUiautomator2Driver, element: string, x: number, y: number): Promise<void>;
43
+ /**
44
+ * @deprecated
45
+ * @this {AndroidUiautomator2Driver}
46
+ * @param {string} element
47
+ * @param {number} x
48
+ * @param {number} y
49
+ * @returns {Promise<void>}
50
+ */
51
+ export function touchMove(this: import("../driver").AndroidUiautomator2Driver, element: string, x: number, y: number): Promise<void>;
52
+ /**
53
+ * @deprecated
54
+ * @this {AndroidUiautomator2Driver}
55
+ * @param {string?} [elementId=null]
56
+ * @param {number?} [x=null]
57
+ * @param {number?} [y=null]
58
+ * @param {number} [count=1]
59
+ * @returns {Promise<void>}
60
+ */
61
+ export function tap(this: import("../driver").AndroidUiautomator2Driver, elementId?: string | null | undefined, x?: number | null | undefined, y?: number | null | undefined, count?: number | undefined): Promise<void>;
62
+ /**
63
+ * @deprecated
64
+ * @this {AndroidUiautomator2Driver}
65
+ * @param {string} elementId
66
+ * @param {import('appium-android-driver').TouchState[]} states
67
+ * @returns {Promise<void>}
68
+ */
69
+ export function doPerformMultiAction(this: import("../driver").AndroidUiautomator2Driver, elementId: string, states: import('appium-android-driver').TouchState[]): Promise<void>;
70
+ /**
71
+ * @this {AndroidUiautomator2Driver}
72
+ * @param {import('@appium/types').StringRecord} actions
73
+ * @returns {Promise<void>}
74
+ */
75
+ export function performActions(this: import("../driver").AndroidUiautomator2Driver, actions: import('@appium/types').StringRecord): Promise<void>;
76
+ /**
77
+ * @this {AndroidUiautomator2Driver}
78
+ * @returns {Promise<void>}
79
+ */
80
+ export function releaseActions(this: import("../driver").AndroidUiautomator2Driver): Promise<void>;
1
81
  export type UiAutomator2Server = import('../uiautomator2').UiAutomator2Server;
82
+ export type AndroidUiautomator2Driver = import('../driver').AndroidUiautomator2Driver;
2
83
  //# sourceMappingURL=touch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"touch.d.ts","sourceRoot":"","sources":["../../../lib/commands/touch.js"],"names":[],"mappings":"iCAqEa,OAAO,iBAAiB,EAAE,kBAAkB"}
1
+ {"version":3,"file":"touch.d.ts","sourceRoot":"","sources":["../../../lib/commands/touch.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wFAHW,OAAO,uBAAuB,EAAE,SAAS,GACvC,QAAQ,IAAI,CAAC,CAQzB;AAED;;;;;GAKG;AACH,sFAHW,OAAO,uBAAuB,EAAE,QAAQ,GACtC,QAAQ,IAAI,CAAC,CAQzB;AAED;;;;;;;;GAQG;AACH,6FANW,MAAM,KACN,MAAM,KACN,MAAM,YACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CASzB;AAED;;;;;;;GAOG;AACH,wFALW,MAAM,KACN,MAAM,KACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CASzB;AAED;;;;;;;GAOG;AACH,sFALW,MAAM,KACN,MAAM,KACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CASzB;AAED;;;;;;;GAOG;AACH,wFALW,MAAM,KACN,MAAM,KACN,MAAM,GACJ,QAAQ,IAAI,CAAC,CASzB;AAED;;;;;;;;GAQG;AACH,2MAFa,QAAQ,IAAI,CAAC,CA4BzB;AAED;;;;;;GAMG;AACH,qGAJW,MAAM,UACN,OAAO,uBAAuB,EAAE,UAAU,EAAE,GAC1C,QAAQ,IAAI,CAAC,CAyBzB;AAED;;;;GAIG;AACH,6FAHW,OAAO,eAAe,EAAE,YAAY,GAClC,QAAQ,IAAI,CAAC,CA0BzB;AAED;;;GAGG;AAEH,qFAHa,QAAQ,IAAI,CAAC,CAKzB;iCAGY,OAAO,iBAAiB,EAAE,kBAAkB;wCAC5C,OAAO,WAAW,EAAE,yBAAyB"}