appium-uiautomator2-driver 2.42.2 → 2.43.0
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 +7 -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 +31 -31
- 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
|
@@ -1,44 +1,42 @@
|
|
|
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 });
|
|
6
|
+
exports.doFindElementOrEls = void 0;
|
|
7
7
|
const css_converter_1 = __importDefault(require("../css-converter"));
|
|
8
|
-
const mixins_1 = require("./mixins");
|
|
9
8
|
// we override the xpath search for this first-visible-child selector, which
|
|
10
9
|
// looks like /*[@firstVisible="true"]
|
|
11
10
|
const MAGIC_FIRST_VIS_CHILD_SEL = /\/\*\[@firstVisible ?= ?('|")true\1\]/;
|
|
12
11
|
const MAGIC_SCROLLABLE_SEL = /\/\/\*\[@scrollable ?= ?('|")true\1\]/;
|
|
13
12
|
const MAGIC_SCROLLABLE_BY = 'new UiSelector().scrollable(true)';
|
|
14
13
|
/**
|
|
15
|
-
* @
|
|
16
|
-
*
|
|
14
|
+
* @privateRemarks Overriding helpers.doFindElementOrEls functionality of appium-android-driver,
|
|
15
|
+
* this.element initialized in find.js of appium-android-drive.
|
|
16
|
+
*
|
|
17
|
+
* @this {AndroidUiautomator2Driver}
|
|
18
|
+
* @param {import('appium-android-driver').FindElementOpts} params
|
|
19
|
+
* @returns {Promise<Element | Element[]>}
|
|
17
20
|
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
params.selector = new css_converter_1.default(params.selector, this.opts.appPackage).toUiAutomatorSelector();
|
|
36
|
-
}
|
|
37
|
-
return /** @type {Element|Element[]} */ (await uiautomator2.jwproxy.command(`/element${params.multiple ? 's' : ''}`, 'POST', params));
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
(0, mixins_1.mixin)(FindMixin);
|
|
21
|
+
async function doFindElementOrEls(params) {
|
|
22
|
+
const uiautomator2 = /** @type {import('../uiautomator2').UiAutomator2Server} */ (this.uiautomator2);
|
|
23
|
+
if (params.strategy === 'xpath' && MAGIC_FIRST_VIS_CHILD_SEL.test(params.selector)) {
|
|
24
|
+
let elementId = params.context;
|
|
25
|
+
return /** @type {Element} */ (await uiautomator2.jwproxy.command(`/appium/element/${elementId}/first_visible`, 'GET', {}));
|
|
26
|
+
}
|
|
27
|
+
if (params.strategy === 'xpath' && MAGIC_SCROLLABLE_SEL.test(params.selector)) {
|
|
28
|
+
params.strategy = '-android uiautomator';
|
|
29
|
+
params.selector = MAGIC_SCROLLABLE_BY;
|
|
30
|
+
}
|
|
31
|
+
if (params.strategy === 'css selector') {
|
|
32
|
+
params.strategy = '-android uiautomator';
|
|
33
|
+
params.selector = new css_converter_1.default(params.selector, this.opts.appPackage).toUiAutomatorSelector();
|
|
34
|
+
}
|
|
35
|
+
return /** @type {Element|Element[]} */ (await uiautomator2.jwproxy.command(`/element${params.multiple ? 's' : ''}`, 'POST', params));
|
|
36
|
+
}
|
|
37
|
+
exports.doFindElementOrEls = doFindElementOrEls;
|
|
41
38
|
/**
|
|
42
39
|
* @typedef {import('@appium/types').Element} Element
|
|
40
|
+
* @typedef {import('../driver').AndroidUiautomator2Driver} AndroidUiautomator2Driver
|
|
43
41
|
*/
|
|
44
42
|
//# sourceMappingURL=find.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find.js","sourceRoot":"","sources":["../../../lib/commands/find.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"find.js","sourceRoot":"","sources":["../../../lib/commands/find.js"],"names":[],"mappings":";;;;;;AAAA,qEAA4C;AAE5C,4EAA4E;AAC5E,sCAAsC;AACtC,MAAM,yBAAyB,GAAG,uCAAuC,CAAC;AAE1E,MAAM,oBAAoB,GAAG,uCAAuC,CAAC;AACrE,MAAM,mBAAmB,GAAG,mCAAmC,CAAC;AAEhE;;;;;;;GAOG;AACI,KAAK,UAAU,kBAAkB,CAAC,MAAM;IAC7C,MAAM,YAAY,GAAG,2DAA2D,CAAC,CAC/E,IAAI,CAAC,YAAY,CAClB,CAAC;IACF,IAAI,MAAM,CAAC,QAAQ,KAAK,OAAO,IAAI,yBAAyB,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;QAClF,IAAI,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC;QAC/B,OAAO,sBAAsB,CAAC,CAC5B,MAAM,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,mBAAmB,SAAS,gBAAgB,EAAE,KAAK,EAAE,EAAE,CAAC,CAC5F,CAAC;KACH;IACD,IAAI,MAAM,CAAC,QAAQ,KAAK,OAAO,IAAI,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;QAC7E,MAAM,CAAC,QAAQ,GAAG,sBAAsB,CAAC;QACzC,MAAM,CAAC,QAAQ,GAAG,mBAAmB,CAAC;KACvC;IACD,IAAI,MAAM,CAAC,QAAQ,KAAK,cAAc,EAAE;QACtC,MAAM,CAAC,QAAQ,GAAG,sBAAsB,CAAC;QACzC,MAAM,CAAC,QAAQ,GAAG,IAAI,uBAAY,CAChC,MAAM,CAAC,QAAQ,EACf,IAAI,CAAC,IAAI,CAAC,UAAU,CACrB,CAAC,qBAAqB,EAAE,CAAC;KAC3B;IACD,OAAO,gCAAgC,CAAC,CACtC,MAAM,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,CAC5F,CAAC;AACJ,CAAC;AAxBD,gDAwBC;AAED;;;GAGG"}
|
|
@@ -1,2 +1,104 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Performs a simple click/tap gesture
|
|
3
|
+
*
|
|
4
|
+
* @this {AndroidUiautomator2Driver}
|
|
5
|
+
* @param {import('./types').ClickOptions} [opts={}]
|
|
6
|
+
* @returns {Promise<void>}
|
|
7
|
+
* @throws {Error} if provided options are not valid
|
|
8
|
+
*/
|
|
9
|
+
export function mobileClickGesture(this: import("../driver").AndroidUiautomator2Driver, opts?: import("./types").ClickOptions | undefined): Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* Performs a click that lasts for the given duration
|
|
12
|
+
*
|
|
13
|
+
* @this {AndroidUiautomator2Driver}
|
|
14
|
+
* @param {import('./types').LongClickOptions} [opts={}]
|
|
15
|
+
* @returns {Promise<void>}
|
|
16
|
+
* @throws {Error} if provided options are not valid
|
|
17
|
+
*/
|
|
18
|
+
export function mobileLongClickGesture(this: import("../driver").AndroidUiautomator2Driver, opts?: import("./types").LongClickOptions | undefined): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Performs a click that lasts for the given duration
|
|
21
|
+
* @this {AndroidUiautomator2Driver}
|
|
22
|
+
* @param {import('./types').DoubleClickOptions} [opts={}]
|
|
23
|
+
* @returns {Promise<void>}
|
|
24
|
+
* @throws {Error} if provided options are not valid
|
|
25
|
+
*/
|
|
26
|
+
export function mobileDoubleClickGesture(this: import("../driver").AndroidUiautomator2Driver, opts?: import("./types").ClickOptions | undefined): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Drags this object to the specified location.
|
|
29
|
+
* @this {AndroidUiautomator2Driver}
|
|
30
|
+
* @param {import('./types').DragOptions} opts
|
|
31
|
+
* @returns {Promise<void>}
|
|
32
|
+
* @throws {Error} if provided options are not valid
|
|
33
|
+
*/
|
|
34
|
+
export function mobileDragGesture(this: import("../driver").AndroidUiautomator2Driver, opts: import('./types').DragOptions): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Drags to the specified location.
|
|
37
|
+
*
|
|
38
|
+
* @throws {Error} if provided options are not valid
|
|
39
|
+
* @this {AndroidUiautomator2Driver}
|
|
40
|
+
* @param {import('./types').FlingOptions} opts
|
|
41
|
+
* @returns {Promise<boolean>} True if the object can still scroll in the given direction.
|
|
42
|
+
*/
|
|
43
|
+
export function mobileFlingGesture(this: import("../driver").AndroidUiautomator2Driver, opts: import('./types').FlingOptions): Promise<boolean>;
|
|
44
|
+
/**
|
|
45
|
+
* Performs a pinch close gesture.
|
|
46
|
+
* @this {AndroidUiautomator2Driver}
|
|
47
|
+
* @param {import('./types').PinchOptions} opts
|
|
48
|
+
* @returns {Promise<void>}
|
|
49
|
+
* @throws {Error} if provided options are not valid
|
|
50
|
+
*/
|
|
51
|
+
export function mobilePinchCloseGesture(this: import("../driver").AndroidUiautomator2Driver, opts: import('./types').PinchOptions): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Performs a pinch open gesture.
|
|
54
|
+
* @this {AndroidUiautomator2Driver}
|
|
55
|
+
* @param {import('./types').PinchOptions} opts
|
|
56
|
+
* @returns {Promise<void>}
|
|
57
|
+
* @throws {Error} if provided options are not valid
|
|
58
|
+
*/
|
|
59
|
+
export function mobilePinchOpenGesture(this: import("../driver").AndroidUiautomator2Driver, opts: import('./types').PinchOptions): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Performs a swipe gesture.
|
|
62
|
+
* @this {AndroidUiautomator2Driver}
|
|
63
|
+
* @param {import('./types').SwipeOptions} opts
|
|
64
|
+
* @returns {Promise<void>}
|
|
65
|
+
* @throws {Error} if provided options are not valid
|
|
66
|
+
*/
|
|
67
|
+
export function mobileSwipeGesture(this: import("../driver").AndroidUiautomator2Driver, opts: import('./types').SwipeOptions): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Performs a scroll gesture.
|
|
70
|
+
*
|
|
71
|
+
* @throws {Error} if provided options are not valid
|
|
72
|
+
* @this {AndroidUiautomator2Driver}
|
|
73
|
+
* @param {import('./types').ScrollGestureOptions} opts
|
|
74
|
+
* @returns {Promise<boolean>} True if the object can still scroll in the given direction.
|
|
75
|
+
*/
|
|
76
|
+
export function mobileScrollGesture(this: import("../driver").AndroidUiautomator2Driver, opts: import('./types').ScrollGestureOptions): Promise<boolean>;
|
|
77
|
+
/**
|
|
78
|
+
* Scrolls the given scrollable element `elementId` until `elementToId`
|
|
79
|
+
* becomes visible. This function returns immediately if the `elementToId`
|
|
80
|
+
* is already visible in the view port. Otherwise it would scroll
|
|
81
|
+
* to the very beginning of the scrollable control and tries to reach the destination element
|
|
82
|
+
* by scrolling its parent to the end step by step. The scroll direction (vertical or horizontal)
|
|
83
|
+
* is detected automatically.
|
|
84
|
+
* @this {AndroidUiautomator2Driver}
|
|
85
|
+
* @param {import('./types').ScrollElementToElementOpts} opts
|
|
86
|
+
* @returns {Promise<void>}
|
|
87
|
+
* @throws {Error} if the scrolling operation cannot be performed
|
|
88
|
+
*/
|
|
89
|
+
export function mobileScrollBackTo(this: import("../driver").AndroidUiautomator2Driver, opts: import('./types').ScrollElementToElementOpts): Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* Scrolls the given scrollable element until the element identified
|
|
92
|
+
* by `strategy` and `selector` becomes visible. This function returns immediately if the
|
|
93
|
+
* destination element is already visible in the view port. Otherwise it would scroll
|
|
94
|
+
* to the very beginning of the scrollable control and tries to reach the destination element
|
|
95
|
+
* by scrolling its parent to the end step by step. The scroll direction (vertical or horizontal)
|
|
96
|
+
* is detected automatically.
|
|
97
|
+
* @this {AndroidUiautomator2Driver}
|
|
98
|
+
* @param {import('./types').ScrollOptions} opts
|
|
99
|
+
* @returns {Promise<void>}
|
|
100
|
+
* @throws {Error} if the scrolling operation cannot be performed
|
|
101
|
+
*/
|
|
102
|
+
export function mobileScroll(this: import("../driver").AndroidUiautomator2Driver, opts: import('./types').ScrollOptions): Promise<void>;
|
|
103
|
+
export type AndroidUiautomator2Driver = import('../driver').AndroidUiautomator2Driver;
|
|
2
104
|
//# sourceMappingURL=gestures.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gestures.d.ts","sourceRoot":"","sources":["../../../lib/commands/gestures.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gestures.d.ts","sourceRoot":"","sources":["../../../lib/commands/gestures.js"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,4IAHa,QAAQ,IAAI,CAAC,CAazB;AAED;;;;;;;GAOG;AACH,oJAHa,QAAQ,IAAI,CAAC,CAczB;AAED;;;;;;GAMG;AACH,kJAHa,QAAQ,IAAI,CAAC,CAazB;AAED;;;;;;GAMG;AACH,6FAJW,OAAO,SAAS,EAAE,WAAW,GAC3B,QAAQ,IAAI,CAAC,CAezB;AAED;;;;;;;GAOG;AACH,8FAHW,OAAO,SAAS,EAAE,YAAY,GAC5B,QAAQ,OAAO,CAAC,CAgB5B;AAED;;;;;;GAMG;AACH,mGAJW,OAAO,SAAS,EAAE,YAAY,GAC5B,QAAQ,IAAI,CAAC,CAezB;AAED;;;;;;GAMG;AACH,kGAJW,OAAO,SAAS,EAAE,YAAY,GAC5B,QAAQ,IAAI,CAAC,CAezB;AAED;;;;;;GAMG;AACH,8FAJW,OAAO,SAAS,EAAE,YAAY,GAC5B,QAAQ,IAAI,CAAC,CAgBzB;AAED;;;;;;;GAOG;AACH,+FAHW,OAAO,SAAS,EAAE,oBAAoB,GACpC,QAAQ,OAAO,CAAC,CAiB5B;AAED;;;;;;;;;;;GAWG;AACH,8FAJW,OAAO,SAAS,EAAE,0BAA0B,GAC1C,QAAQ,IAAI,CAAC,CAiBzB;AAED;;;;;;;;;;;GAWG;AACH,wFAJW,OAAO,SAAS,EAAE,aAAa,GAC7B,QAAQ,IAAI,CAAC,CAwBzB;wCAwCY,OAAO,WAAW,EAAE,yBAAyB"}
|
|
@@ -3,11 +3,209 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
const mixins_1 = require("./mixins");
|
|
6
|
+
exports.mobileScroll = exports.mobileScrollBackTo = exports.mobileScrollGesture = exports.mobileSwipeGesture = exports.mobilePinchOpenGesture = exports.mobilePinchCloseGesture = exports.mobileFlingGesture = exports.mobileDragGesture = exports.mobileDoubleClickGesture = exports.mobileLongClickGesture = exports.mobileClickGesture = void 0;
|
|
8
7
|
const support_1 = require("appium/support");
|
|
9
8
|
const lodash_1 = __importDefault(require("lodash"));
|
|
10
9
|
const driver_1 = require("appium/driver");
|
|
10
|
+
/**
|
|
11
|
+
* Performs a simple click/tap gesture
|
|
12
|
+
*
|
|
13
|
+
* @this {AndroidUiautomator2Driver}
|
|
14
|
+
* @param {import('./types').ClickOptions} [opts={}]
|
|
15
|
+
* @returns {Promise<void>}
|
|
16
|
+
* @throws {Error} if provided options are not valid
|
|
17
|
+
*/
|
|
18
|
+
async function mobileClickGesture(opts = {}) {
|
|
19
|
+
const { elementId, x, y } = opts;
|
|
20
|
+
await this.uiautomator2.jwproxy.command('/appium/gestures/click', 'POST', {
|
|
21
|
+
origin: toOrigin(elementId),
|
|
22
|
+
offset: toPoint(x, y),
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
exports.mobileClickGesture = mobileClickGesture;
|
|
26
|
+
/**
|
|
27
|
+
* Performs a click that lasts for the given duration
|
|
28
|
+
*
|
|
29
|
+
* @this {AndroidUiautomator2Driver}
|
|
30
|
+
* @param {import('./types').LongClickOptions} [opts={}]
|
|
31
|
+
* @returns {Promise<void>}
|
|
32
|
+
* @throws {Error} if provided options are not valid
|
|
33
|
+
*/
|
|
34
|
+
async function mobileLongClickGesture(opts = {}) {
|
|
35
|
+
const { elementId, x, y, duration } = opts;
|
|
36
|
+
await this.uiautomator2.jwproxy.command('/appium/gestures/long_click', 'POST', {
|
|
37
|
+
origin: toOrigin(elementId),
|
|
38
|
+
offset: toPoint(x, y),
|
|
39
|
+
duration,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
exports.mobileLongClickGesture = mobileLongClickGesture;
|
|
43
|
+
/**
|
|
44
|
+
* Performs a click that lasts for the given duration
|
|
45
|
+
* @this {AndroidUiautomator2Driver}
|
|
46
|
+
* @param {import('./types').DoubleClickOptions} [opts={}]
|
|
47
|
+
* @returns {Promise<void>}
|
|
48
|
+
* @throws {Error} if provided options are not valid
|
|
49
|
+
*/
|
|
50
|
+
async function mobileDoubleClickGesture(opts = {}) {
|
|
51
|
+
const { elementId, x, y } = opts;
|
|
52
|
+
await this.uiautomator2.jwproxy.command('/appium/gestures/double_click', 'POST', {
|
|
53
|
+
origin: toOrigin(elementId),
|
|
54
|
+
offset: toPoint(x, y),
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
exports.mobileDoubleClickGesture = mobileDoubleClickGesture;
|
|
58
|
+
/**
|
|
59
|
+
* Drags this object to the specified location.
|
|
60
|
+
* @this {AndroidUiautomator2Driver}
|
|
61
|
+
* @param {import('./types').DragOptions} opts
|
|
62
|
+
* @returns {Promise<void>}
|
|
63
|
+
* @throws {Error} if provided options are not valid
|
|
64
|
+
*/
|
|
65
|
+
async function mobileDragGesture(opts) {
|
|
66
|
+
const { elementId, startX, startY, endX, endY, speed } = opts;
|
|
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
|
+
exports.mobileDragGesture = mobileDragGesture;
|
|
75
|
+
/**
|
|
76
|
+
* Drags to the specified location.
|
|
77
|
+
*
|
|
78
|
+
* @throws {Error} if provided options are not valid
|
|
79
|
+
* @this {AndroidUiautomator2Driver}
|
|
80
|
+
* @param {import('./types').FlingOptions} opts
|
|
81
|
+
* @returns {Promise<boolean>} True if the object can still scroll in the given direction.
|
|
82
|
+
*/
|
|
83
|
+
async function mobileFlingGesture(opts) {
|
|
84
|
+
const { elementId, left, top, width, height, direction, speed } = opts;
|
|
85
|
+
return /** @type {boolean} */ (await this.uiautomator2.jwproxy.command('/appium/gestures/fling', 'POST', {
|
|
86
|
+
origin: toOrigin(elementId),
|
|
87
|
+
area: toRect(left, top, width, height),
|
|
88
|
+
direction,
|
|
89
|
+
speed,
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
exports.mobileFlingGesture = mobileFlingGesture;
|
|
93
|
+
/**
|
|
94
|
+
* Performs a pinch close gesture.
|
|
95
|
+
* @this {AndroidUiautomator2Driver}
|
|
96
|
+
* @param {import('./types').PinchOptions} opts
|
|
97
|
+
* @returns {Promise<void>}
|
|
98
|
+
* @throws {Error} if provided options are not valid
|
|
99
|
+
*/
|
|
100
|
+
async function mobilePinchCloseGesture(opts) {
|
|
101
|
+
const { elementId, left, top, width, height, percent, speed } = opts;
|
|
102
|
+
await this.uiautomator2.jwproxy.command('/appium/gestures/pinch_close', 'POST', {
|
|
103
|
+
origin: toOrigin(elementId),
|
|
104
|
+
area: toRect(left, top, width, height),
|
|
105
|
+
percent,
|
|
106
|
+
speed,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
exports.mobilePinchCloseGesture = mobilePinchCloseGesture;
|
|
110
|
+
/**
|
|
111
|
+
* Performs a pinch open gesture.
|
|
112
|
+
* @this {AndroidUiautomator2Driver}
|
|
113
|
+
* @param {import('./types').PinchOptions} opts
|
|
114
|
+
* @returns {Promise<void>}
|
|
115
|
+
* @throws {Error} if provided options are not valid
|
|
116
|
+
*/
|
|
117
|
+
async function mobilePinchOpenGesture(opts) {
|
|
118
|
+
const { elementId, left, top, width, height, percent, speed } = opts;
|
|
119
|
+
await this.uiautomator2.jwproxy.command('/appium/gestures/pinch_open', 'POST', {
|
|
120
|
+
origin: toOrigin(elementId),
|
|
121
|
+
area: toRect(left, top, width, height),
|
|
122
|
+
percent,
|
|
123
|
+
speed,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
exports.mobilePinchOpenGesture = mobilePinchOpenGesture;
|
|
127
|
+
/**
|
|
128
|
+
* Performs a swipe gesture.
|
|
129
|
+
* @this {AndroidUiautomator2Driver}
|
|
130
|
+
* @param {import('./types').SwipeOptions} opts
|
|
131
|
+
* @returns {Promise<void>}
|
|
132
|
+
* @throws {Error} if provided options are not valid
|
|
133
|
+
*/
|
|
134
|
+
async function mobileSwipeGesture(opts) {
|
|
135
|
+
const { elementId, left, top, width, height, direction, percent, speed } = opts;
|
|
136
|
+
await this.uiautomator2.jwproxy.command('/appium/gestures/swipe', 'POST', {
|
|
137
|
+
origin: toOrigin(elementId),
|
|
138
|
+
area: toRect(left, top, width, height),
|
|
139
|
+
direction,
|
|
140
|
+
percent,
|
|
141
|
+
speed,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
exports.mobileSwipeGesture = mobileSwipeGesture;
|
|
145
|
+
/**
|
|
146
|
+
* Performs a scroll gesture.
|
|
147
|
+
*
|
|
148
|
+
* @throws {Error} if provided options are not valid
|
|
149
|
+
* @this {AndroidUiautomator2Driver}
|
|
150
|
+
* @param {import('./types').ScrollGestureOptions} opts
|
|
151
|
+
* @returns {Promise<boolean>} True if the object can still scroll in the given direction.
|
|
152
|
+
*/
|
|
153
|
+
async function mobileScrollGesture(opts) {
|
|
154
|
+
const { elementId, left, top, width, height, direction, percent, speed } = opts;
|
|
155
|
+
return /** @type {boolean} */ (await this.uiautomator2.jwproxy.command('/appium/gestures/scroll', 'POST', {
|
|
156
|
+
origin: toOrigin(elementId),
|
|
157
|
+
area: toRect(left, top, width, height),
|
|
158
|
+
direction,
|
|
159
|
+
percent,
|
|
160
|
+
speed,
|
|
161
|
+
}));
|
|
162
|
+
}
|
|
163
|
+
exports.mobileScrollGesture = mobileScrollGesture;
|
|
164
|
+
/**
|
|
165
|
+
* Scrolls the given scrollable element `elementId` until `elementToId`
|
|
166
|
+
* becomes visible. This function returns immediately if the `elementToId`
|
|
167
|
+
* is already visible in the view port. Otherwise it would scroll
|
|
168
|
+
* to the very beginning of the scrollable control and tries to reach the destination element
|
|
169
|
+
* by scrolling its parent to the end step by step. The scroll direction (vertical or horizontal)
|
|
170
|
+
* is detected automatically.
|
|
171
|
+
* @this {AndroidUiautomator2Driver}
|
|
172
|
+
* @param {import('./types').ScrollElementToElementOpts} opts
|
|
173
|
+
* @returns {Promise<void>}
|
|
174
|
+
* @throws {Error} if the scrolling operation cannot be performed
|
|
175
|
+
*/
|
|
176
|
+
async function mobileScrollBackTo(opts) {
|
|
177
|
+
const { elementId, elementToId } = opts;
|
|
178
|
+
if (!elementId || !elementToId) {
|
|
179
|
+
throw new driver_1.errors.InvalidArgumentError(`Both elementId and elementToId arguments must be provided`);
|
|
180
|
+
}
|
|
181
|
+
await this.uiautomator2.jwproxy.command(`/appium/element/${support_1.util.unwrapElement(elementId)}/scroll_to/${support_1.util.unwrapElement(elementToId)}`, 'POST', {});
|
|
182
|
+
}
|
|
183
|
+
exports.mobileScrollBackTo = mobileScrollBackTo;
|
|
184
|
+
/**
|
|
185
|
+
* Scrolls the given scrollable element until the element identified
|
|
186
|
+
* by `strategy` and `selector` becomes visible. This function returns immediately if the
|
|
187
|
+
* destination element is already visible in the view port. Otherwise it would scroll
|
|
188
|
+
* to the very beginning of the scrollable control and tries to reach the destination element
|
|
189
|
+
* by scrolling its parent to the end step by step. The scroll direction (vertical or horizontal)
|
|
190
|
+
* is detected automatically.
|
|
191
|
+
* @this {AndroidUiautomator2Driver}
|
|
192
|
+
* @param {import('./types').ScrollOptions} opts
|
|
193
|
+
* @returns {Promise<void>}
|
|
194
|
+
* @throws {Error} if the scrolling operation cannot be performed
|
|
195
|
+
*/
|
|
196
|
+
async function mobileScroll(opts) {
|
|
197
|
+
const { element, elementId, // `element` is deprecated, use `elementId` instead
|
|
198
|
+
strategy, selector, maxSwipes, } = opts;
|
|
199
|
+
if (!strategy || !selector) {
|
|
200
|
+
throw new driver_1.errors.InvalidArgumentError(`Both strategy and selector arguments must be provided`);
|
|
201
|
+
}
|
|
202
|
+
await this.uiautomator2.jwproxy.command('/touch/scroll', 'POST', {
|
|
203
|
+
origin: toOrigin(elementId || element),
|
|
204
|
+
params: { strategy, selector, maxSwipes },
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
exports.mobileScroll = mobileScroll;
|
|
208
|
+
// #region Internal Helpers
|
|
11
209
|
/**
|
|
12
210
|
*
|
|
13
211
|
* @param {import('@appium/types').Element|string} [element]
|
|
@@ -38,177 +236,8 @@ function toRect(left, top, width, height) {
|
|
|
38
236
|
? undefined
|
|
39
237
|
: { left, top, width, height };
|
|
40
238
|
}
|
|
239
|
+
// #endregion
|
|
41
240
|
/**
|
|
42
|
-
* @
|
|
43
|
-
* @satisfies {import('@appium/types').ExternalDriver}
|
|
44
|
-
*/
|
|
45
|
-
const GesturesMixin = {
|
|
46
|
-
/**
|
|
47
|
-
* Performs a simple click/tap gesture
|
|
48
|
-
*
|
|
49
|
-
* @throws {Error} if provided options are not valid
|
|
50
|
-
*/
|
|
51
|
-
async mobileClickGesture(opts = {}) {
|
|
52
|
-
const { elementId, x, y } = opts;
|
|
53
|
-
await this.uiautomator2.jwproxy.command('/appium/gestures/click', 'POST', {
|
|
54
|
-
origin: toOrigin(elementId),
|
|
55
|
-
offset: toPoint(x, y),
|
|
56
|
-
});
|
|
57
|
-
},
|
|
58
|
-
/**
|
|
59
|
-
* Performs a click that lasts for the given duration
|
|
60
|
-
*
|
|
61
|
-
* @throws {Error} if provided options are not valid
|
|
62
|
-
*/
|
|
63
|
-
async mobileLongClickGesture(opts = {}) {
|
|
64
|
-
const { elementId, x, y, duration } = opts;
|
|
65
|
-
await this.uiautomator2.jwproxy.command('/appium/gestures/long_click', 'POST', {
|
|
66
|
-
origin: toOrigin(elementId),
|
|
67
|
-
offset: toPoint(x, y),
|
|
68
|
-
duration,
|
|
69
|
-
});
|
|
70
|
-
},
|
|
71
|
-
/**
|
|
72
|
-
* Performs a click that lasts for the given duration
|
|
73
|
-
*
|
|
74
|
-
* @throws {Error} if provided options are not valid
|
|
75
|
-
*/
|
|
76
|
-
async mobileDoubleClickGesture(opts = {}) {
|
|
77
|
-
const { elementId, x, y } = opts;
|
|
78
|
-
await this.uiautomator2.jwproxy.command('/appium/gestures/double_click', 'POST', {
|
|
79
|
-
origin: toOrigin(elementId),
|
|
80
|
-
offset: toPoint(x, y),
|
|
81
|
-
});
|
|
82
|
-
},
|
|
83
|
-
/**
|
|
84
|
-
* Drags this object to the specified location.
|
|
85
|
-
*
|
|
86
|
-
* @throws {Error} if provided options are not valid
|
|
87
|
-
*/
|
|
88
|
-
async mobileDragGesture(opts) {
|
|
89
|
-
const { elementId, startX, startY, endX, endY, speed } = opts;
|
|
90
|
-
await this.uiautomator2.jwproxy.command('/appium/gestures/drag', 'POST', {
|
|
91
|
-
origin: toOrigin(elementId),
|
|
92
|
-
start: toPoint(startX, startY),
|
|
93
|
-
end: toPoint(endX, endY),
|
|
94
|
-
speed,
|
|
95
|
-
});
|
|
96
|
-
},
|
|
97
|
-
/**
|
|
98
|
-
* Drags to the specified location.
|
|
99
|
-
*
|
|
100
|
-
* @throws {Error} if provided options are not valid
|
|
101
|
-
* @returns True if the object can still scroll in the given direction.
|
|
102
|
-
*/
|
|
103
|
-
async mobileFlingGesture(opts) {
|
|
104
|
-
const { elementId, left, top, width, height, direction, speed } = opts;
|
|
105
|
-
return /** @type {boolean} */ (await this.uiautomator2.jwproxy.command('/appium/gestures/fling', 'POST', {
|
|
106
|
-
origin: toOrigin(elementId),
|
|
107
|
-
area: toRect(left, top, width, height),
|
|
108
|
-
direction,
|
|
109
|
-
speed,
|
|
110
|
-
}));
|
|
111
|
-
},
|
|
112
|
-
/**
|
|
113
|
-
* Performs a pinch close gesture.
|
|
114
|
-
*
|
|
115
|
-
* @throws {Error} if provided options are not valid
|
|
116
|
-
*/
|
|
117
|
-
async mobilePinchCloseGesture(opts) {
|
|
118
|
-
const { elementId, left, top, width, height, percent, speed } = opts;
|
|
119
|
-
await this.uiautomator2.jwproxy.command('/appium/gestures/pinch_close', 'POST', {
|
|
120
|
-
origin: toOrigin(elementId),
|
|
121
|
-
area: toRect(left, top, width, height),
|
|
122
|
-
percent,
|
|
123
|
-
speed,
|
|
124
|
-
});
|
|
125
|
-
},
|
|
126
|
-
/**
|
|
127
|
-
* Performs a pinch open gesture.
|
|
128
|
-
*
|
|
129
|
-
* @throws {Error} if provided options are not valid
|
|
130
|
-
*/
|
|
131
|
-
async mobilePinchOpenGesture(opts) {
|
|
132
|
-
const { elementId, left, top, width, height, percent, speed } = opts;
|
|
133
|
-
await this.uiautomator2.jwproxy.command('/appium/gestures/pinch_open', 'POST', {
|
|
134
|
-
origin: toOrigin(elementId),
|
|
135
|
-
area: toRect(left, top, width, height),
|
|
136
|
-
percent,
|
|
137
|
-
speed,
|
|
138
|
-
});
|
|
139
|
-
},
|
|
140
|
-
/**
|
|
141
|
-
* Performs a swipe gesture.
|
|
142
|
-
*
|
|
143
|
-
* @throws {Error} if provided options are not valid
|
|
144
|
-
*/
|
|
145
|
-
async mobileSwipeGesture(opts) {
|
|
146
|
-
const { elementId, left, top, width, height, direction, percent, speed } = opts;
|
|
147
|
-
await this.uiautomator2.jwproxy.command('/appium/gestures/swipe', 'POST', {
|
|
148
|
-
origin: toOrigin(elementId),
|
|
149
|
-
area: toRect(left, top, width, height),
|
|
150
|
-
direction,
|
|
151
|
-
percent,
|
|
152
|
-
speed,
|
|
153
|
-
});
|
|
154
|
-
},
|
|
155
|
-
/**
|
|
156
|
-
* Performs a scroll gesture.
|
|
157
|
-
*
|
|
158
|
-
* @throws {Error} if provided options are not valid
|
|
159
|
-
* @returns True if the object can still scroll in the given direction.
|
|
160
|
-
*/
|
|
161
|
-
async mobileScrollGesture(opts) {
|
|
162
|
-
const { elementId, left, top, width, height, direction, percent, speed } = opts;
|
|
163
|
-
return /** @type {boolean} */ (await this.uiautomator2.jwproxy.command('/appium/gestures/scroll', 'POST', {
|
|
164
|
-
origin: toOrigin(elementId),
|
|
165
|
-
area: toRect(left, top, width, height),
|
|
166
|
-
direction,
|
|
167
|
-
percent,
|
|
168
|
-
speed,
|
|
169
|
-
}));
|
|
170
|
-
},
|
|
171
|
-
/**
|
|
172
|
-
* Scrolls the given scrollable element `elementId` until `elementToId`
|
|
173
|
-
* becomes visible. This function returns immediately if the `elementToId`
|
|
174
|
-
* is already visible in the view port. Otherwise it would scroll
|
|
175
|
-
* to the very beginning of the scrollable control and tries to reach the destination element
|
|
176
|
-
* by scrolling its parent to the end step by step. The scroll direction (vertical or horizontal)
|
|
177
|
-
* is detected automatically.
|
|
178
|
-
*
|
|
179
|
-
* @throws {Error} if the scrolling operation cannot be performed
|
|
180
|
-
*/
|
|
181
|
-
async mobileScrollBackTo(opts) {
|
|
182
|
-
const { elementId, elementToId } = opts;
|
|
183
|
-
if (!elementId || !elementToId) {
|
|
184
|
-
throw new driver_1.errors.InvalidArgumentError(`Both elementId and elementToId arguments must be provided`);
|
|
185
|
-
}
|
|
186
|
-
await this.uiautomator2.jwproxy.command(`/appium/element/${support_1.util.unwrapElement(elementId)}/scroll_to/${support_1.util.unwrapElement(elementToId)}`, 'POST', {});
|
|
187
|
-
},
|
|
188
|
-
/**
|
|
189
|
-
* Scrolls the given scrollable element until the element identified
|
|
190
|
-
* by `strategy` and `selector` becomes visible. This function returns immediately if the
|
|
191
|
-
* destination element is already visible in the view port. Otherwise it would scroll
|
|
192
|
-
* to the very beginning of the scrollable control and tries to reach the destination element
|
|
193
|
-
* by scrolling its parent to the end step by step. The scroll direction (vertical or horizontal)
|
|
194
|
-
* is detected automatically.
|
|
195
|
-
*
|
|
196
|
-
* @throws {Error} if the scrolling operation cannot be performed
|
|
197
|
-
*/
|
|
198
|
-
async mobileScroll(opts) {
|
|
199
|
-
const { element, elementId, // `element` is deprecated, use `elementId` instead
|
|
200
|
-
strategy, selector, maxSwipes, } = opts;
|
|
201
|
-
if (!strategy || !selector) {
|
|
202
|
-
throw new driver_1.errors.InvalidArgumentError(`Both strategy and selector arguments must be provided`);
|
|
203
|
-
}
|
|
204
|
-
await this.uiautomator2.jwproxy.command('/touch/scroll', 'POST', {
|
|
205
|
-
origin: toOrigin(elementId || element),
|
|
206
|
-
params: { strategy, selector, maxSwipes },
|
|
207
|
-
});
|
|
208
|
-
},
|
|
209
|
-
};
|
|
210
|
-
(0, mixins_1.mixin)(GesturesMixin);
|
|
211
|
-
/**
|
|
212
|
-
* @typedef {import('../uiautomator2').UiAutomator2Server} UiAutomator2Server
|
|
241
|
+
* @typedef {import('../driver').AndroidUiautomator2Driver} AndroidUiautomator2Driver
|
|
213
242
|
*/
|
|
214
243
|
//# sourceMappingURL=gestures.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gestures.js","sourceRoot":"","sources":["../../../lib/commands/gestures.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gestures.js","sourceRoot":"","sources":["../../../lib/commands/gestures.js"],"names":[],"mappings":";;;;;;AAAA,4CAAoC;AACpC,oDAAuB;AACvB,0CAAqC;AAErC;;;;;;;GAOG;AACI,KAAK,UAAU,kBAAkB,CAAC,IAAI,GAAG,EAAE;IAChD,MAAM,EAAC,SAAS,EAAE,CAAC,EAAE,CAAC,EAAC,GAAG,IAAI,CAAC;IAC/B,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CACrC,wBAAwB,EACxB,MAAM,EACN;QACE,MAAM,EAAE,QAAQ,CAAC,SAAS,CAAC;QAC3B,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;KACtB,CACF,CAAC;AACJ,CAAC;AAVD,gDAUC;AAED;;;;;;;GAOG;AACI,KAAK,UAAU,sBAAsB,CAAC,IAAI,GAAG,EAAE;IACpD,MAAM,EAAC,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAC,GAAG,IAAI,CAAC;IACzC,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CACrC,6BAA6B,EAC7B,MAAM,EACN;QACE,MAAM,EAAE,QAAQ,CAAC,SAAS,CAAC;QAC3B,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;QACrB,QAAQ;KACT,CACF,CAAC;AACJ,CAAC;AAXD,wDAWC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,wBAAwB,CAAC,IAAI,GAAG,EAAE;IACtD,MAAM,EAAC,SAAS,EAAE,CAAC,EAAE,CAAC,EAAC,GAAG,IAAI,CAAC;IAC/B,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CACrC,+BAA+B,EAC/B,MAAM,EACN;QACE,MAAM,EAAE,QAAQ,CAAC,SAAS,CAAC;QAC3B,MAAM,EAAE,OAAO,CAAC,CAAC,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EAAE,QAAQ,CAAC,SAAS,IAAI,OAAO,CAAC;QACtC,MAAM,EAAE,EAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAC;KACxC,CACF,CAAC;AACJ,CAAC;AArBD,oCAqBC;AAED,2BAA2B;AAE3B;;;;GAIG;AACH,SAAS,QAAQ,CAAC,OAAO;IACvB,OAAO,OAAO,CAAC,CAAC,CAAC,cAAI,CAAC,WAAW,CAAC,cAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7E,CAAC;AAED;;;;;GAKG;AACH,SAAS,OAAO,CAAC,CAAC,EAAE,CAAC;IACnB,OAAO,gBAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,gBAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,EAAE,CAAC,EAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7D,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM;IACtC,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,gBAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC3D,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,EAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAC,CAAC;AACjC,CAAC;AAED,aAAa;AAEb;;GAEG"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @this {AndroidUiautomator2Driver}
|
|
3
|
+
* @param {string|number} keycode
|
|
4
|
+
* @param {number} [metastate]
|
|
5
|
+
* @param {number} [flags]
|
|
6
|
+
* @returns {Promise<void>}
|
|
7
|
+
*/
|
|
8
|
+
export function pressKeyCode(this: import("../driver").AndroidUiautomator2Driver, keycode: string | number, metastate?: number | undefined, flags?: number | undefined): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* @this {AndroidUiautomator2Driver}
|
|
11
|
+
* @param {string|number} keycode
|
|
12
|
+
* @param {number} metastate
|
|
13
|
+
* @param {number} [flags]
|
|
14
|
+
* @returns {Promise<void>}
|
|
15
|
+
*/
|
|
16
|
+
export function longPressKeyCode(this: import("../driver").AndroidUiautomator2Driver, keycode: string | number, metastate: number, flags?: number | undefined): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* @this {AndroidUiautomator2Driver}
|
|
19
|
+
* @param {import('./types').PressKeyOptions} opts
|
|
20
|
+
* @returns {Promise<void>}
|
|
21
|
+
*/
|
|
22
|
+
export function mobilePressKey(this: import("../driver").AndroidUiautomator2Driver, opts: import('./types').PressKeyOptions): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Types the given Unicode string.
|
|
25
|
+
* It is expected that the focus is already put
|
|
26
|
+
* to the destination input field before this method is called.
|
|
27
|
+
* @this {AndroidUiautomator2Driver}
|
|
28
|
+
* @param {import('./types').TypingOptions} opts
|
|
29
|
+
* @returns {Promise<boolean>} `true` if the input text has been successfully sent to adb
|
|
30
|
+
* @throws {Error} if `text` property has not been provided
|
|
31
|
+
*/
|
|
32
|
+
export function mobileType(this: import("../driver").AndroidUiautomator2Driver, opts: import('./types').TypingOptions): Promise<boolean>;
|
|
33
|
+
/**
|
|
34
|
+
* @this {AndroidUiautomator2Driver}
|
|
35
|
+
* @param {import('appium-android-driver').SendKeysOpts} params
|
|
36
|
+
* @returns {Promise<void>}
|
|
37
|
+
*/
|
|
38
|
+
export function doSendKeys(this: import("../driver").AndroidUiautomator2Driver, params: import('appium-android-driver').SendKeysOpts): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* @this {AndroidUiautomator2Driver}
|
|
41
|
+
* @param {string|number} keycode
|
|
42
|
+
* @param {number} [metastate]
|
|
43
|
+
* @returns {Promise<void>}
|
|
44
|
+
*/
|
|
45
|
+
export function keyevent(this: import("../driver").AndroidUiautomator2Driver, keycode: string | number, metastate?: number | undefined): Promise<void>;
|
|
46
|
+
export type AndroidUiautomator2Driver = import('../driver').AndroidUiautomator2Driver;
|
|
47
|
+
//# sourceMappingURL=keyboard.d.ts.map
|