appium-uiautomator2-driver 6.7.6 → 6.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/build/lib/commands/actions.d.ts +26 -29
- package/build/lib/commands/actions.d.ts.map +1 -1
- package/build/lib/commands/actions.js +19 -27
- package/build/lib/commands/actions.js.map +1 -1
- package/build/lib/commands/alert.d.ts +14 -22
- package/build/lib/commands/alert.d.ts.map +1 -1
- package/build/lib/commands/alert.js +8 -19
- package/build/lib/commands/alert.js.map +1 -1
- package/build/lib/commands/app-management.d.ts +7 -10
- package/build/lib/commands/app-management.d.ts.map +1 -1
- package/build/lib/commands/app-management.js +4 -14
- package/build/lib/commands/app-management.js.map +1 -1
- package/build/lib/commands/battery.d.ts +4 -5
- package/build/lib/commands/battery.d.ts.map +1 -1
- package/build/lib/commands/battery.js +4 -9
- package/build/lib/commands/battery.js.map +1 -1
- package/build/lib/commands/clipboard.d.ts +9 -13
- package/build/lib/commands/clipboard.d.ts.map +1 -1
- package/build/lib/commands/clipboard.js +7 -14
- package/build/lib/commands/clipboard.js.map +1 -1
- package/build/lib/commands/element.d.ts +29 -0
- package/build/lib/commands/element.d.ts.map +1 -1
- package/build/lib/commands/element.js +29 -0
- package/build/lib/commands/element.js.map +1 -1
- package/build/lib/commands/find.d.ts +13 -9
- package/build/lib/commands/find.d.ts.map +1 -1
- package/build/lib/commands/find.js +4 -16
- package/build/lib/commands/find.js.map +1 -1
- package/build/lib/commands/gestures.d.ts +63 -0
- package/build/lib/commands/gestures.d.ts.map +1 -1
- package/build/lib/commands/gestures.js +63 -0
- package/build/lib/commands/gestures.js.map +1 -1
- package/build/lib/commands/keyboard.d.ts +30 -41
- package/build/lib/commands/keyboard.d.ts.map +1 -1
- package/build/lib/commands/keyboard.js +22 -37
- package/build/lib/commands/keyboard.js.map +1 -1
- package/build/lib/commands/misc.d.ts +4 -0
- package/build/lib/commands/misc.d.ts.map +1 -1
- package/build/lib/commands/misc.js +4 -0
- package/build/lib/commands/misc.js.map +1 -1
- package/build/lib/commands/navigation.d.ts +11 -16
- package/build/lib/commands/navigation.d.ts.map +1 -1
- package/build/lib/commands/navigation.js +9 -17
- package/build/lib/commands/navigation.js.map +1 -1
- package/build/lib/commands/viewport.d.ts +23 -22
- package/build/lib/commands/viewport.d.ts.map +1 -1
- package/build/lib/commands/viewport.js +17 -24
- package/build/lib/commands/viewport.js.map +1 -1
- package/build/lib/doctor/optional-checks.d.ts +4 -4
- package/build/lib/doctor/optional-checks.d.ts.map +1 -1
- package/build/lib/doctor/optional-checks.js.map +1 -1
- package/build/lib/doctor/required-checks.d.ts +5 -21
- package/build/lib/doctor/required-checks.d.ts.map +1 -1
- package/build/lib/doctor/required-checks.js.map +1 -1
- package/build/lib/index.d.ts +4 -0
- package/build/lib/index.d.ts.map +1 -0
- package/build/{index.js → lib/index.js} +1 -1
- package/build/lib/index.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/lib/commands/actions.ts +95 -0
- package/lib/commands/alert.ts +46 -0
- package/lib/commands/app-management.ts +25 -0
- package/lib/commands/battery.ts +19 -0
- package/lib/commands/clipboard.ts +29 -0
- package/lib/commands/element.ts +29 -0
- package/lib/commands/find.ts +48 -0
- package/lib/commands/gestures.ts +63 -0
- package/lib/commands/keyboard.ts +102 -0
- package/lib/commands/misc.ts +4 -0
- package/lib/commands/navigation.ts +32 -0
- package/lib/commands/viewport.ts +78 -0
- package/lib/doctor/optional-checks.ts +7 -0
- package/lib/doctor/required-checks.ts +8 -0
- package/{index.js → lib/index.ts} +2 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +3 -7
- package/build/index.d.ts +0 -4
- package/build/index.d.ts.map +0 -1
- package/build/index.js.map +0 -1
- package/lib/commands/actions.js +0 -107
- package/lib/commands/alert.js +0 -63
- package/lib/commands/app-management.js +0 -32
- package/lib/commands/battery.js +0 -23
- package/lib/commands/clipboard.js +0 -37
- package/lib/commands/find.js +0 -47
- package/lib/commands/keyboard.js +0 -108
- package/lib/commands/navigation.js +0 -33
- package/lib/commands/viewport.js +0 -100
- package/lib/doctor/optional-checks.js +0 -5
- package/lib/doctor/required-checks.js +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../../../lib/commands/element.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAC,OAAO,IAAI,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;AAClF,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,WAAW,CAAC;AAGzD
|
|
1
|
+
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../../../lib/commands/element.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAC,OAAO,IAAI,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;AAClF,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,WAAW,CAAC;AAGzD;;;GAGG;AACH,wBAAsB,MAAM,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,aAAa,CAAC,CAEpF;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,yBAAyB,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEzH;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,yBAAyB,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAE3G;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,yBAAyB,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAA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AS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE7F;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,yBAAyB,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CActG;AAED;;;;GAIG;AACH,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,yBAAyB,EAC/B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,IAAI,CAAC,CAKf"}
|
|
@@ -24,60 +24,79 @@ const bluebird_1 = __importDefault(require("bluebird"));
|
|
|
24
24
|
const lodash_1 = __importDefault(require("lodash"));
|
|
25
25
|
/**
|
|
26
26
|
* Gets the currently active element.
|
|
27
|
+
* @returns The currently active element.
|
|
27
28
|
*/
|
|
28
29
|
async function active() {
|
|
29
30
|
return (await this.uiautomator2.jwproxy.command('/element/active', 'GET'));
|
|
30
31
|
}
|
|
31
32
|
/**
|
|
32
33
|
* Gets an element attribute value.
|
|
34
|
+
* @param attribute - Name of the attribute to retrieve.
|
|
35
|
+
* @param elementId - ID of the element.
|
|
36
|
+
* @returns The attribute value as a string.
|
|
33
37
|
*/
|
|
34
38
|
async function getAttribute(attribute, elementId) {
|
|
35
39
|
return String(await this.uiautomator2.jwproxy.command(`/element/${elementId}/attribute/${attribute}`, 'GET', {}));
|
|
36
40
|
}
|
|
37
41
|
/**
|
|
38
42
|
* Returns whether the element is displayed.
|
|
43
|
+
* @param elementId - ID of the element.
|
|
44
|
+
* @returns True if the element is displayed, false otherwise.
|
|
39
45
|
*/
|
|
40
46
|
async function elementDisplayed(elementId) {
|
|
41
47
|
return toBool(await this.getAttribute('displayed', elementId));
|
|
42
48
|
}
|
|
43
49
|
/**
|
|
44
50
|
* Returns whether the element is enabled.
|
|
51
|
+
* @param elementId - ID of the element.
|
|
52
|
+
* @returns True if the element is enabled, false otherwise.
|
|
45
53
|
*/
|
|
46
54
|
async function elementEnabled(elementId) {
|
|
47
55
|
return toBool(await this.getAttribute('enabled', elementId));
|
|
48
56
|
}
|
|
49
57
|
/**
|
|
50
58
|
* Returns whether the element is selected.
|
|
59
|
+
* @param elementId - ID of the element.
|
|
60
|
+
* @returns True if the element is selected, false otherwise.
|
|
51
61
|
*/
|
|
52
62
|
async function elementSelected(elementId) {
|
|
53
63
|
return toBool(await this.getAttribute('selected', elementId));
|
|
54
64
|
}
|
|
55
65
|
/**
|
|
56
66
|
* Gets the element tag name.
|
|
67
|
+
* @param elementId - ID of the element.
|
|
68
|
+
* @returns The element tag name.
|
|
57
69
|
*/
|
|
58
70
|
async function getName(elementId) {
|
|
59
71
|
return (await this.uiautomator2.jwproxy.command(`/element/${elementId}/name`, 'GET', {}));
|
|
60
72
|
}
|
|
61
73
|
/**
|
|
62
74
|
* Gets the element location.
|
|
75
|
+
* @param elementId - ID of the element.
|
|
76
|
+
* @returns The element position coordinates (x, y).
|
|
63
77
|
*/
|
|
64
78
|
async function getLocation(elementId) {
|
|
65
79
|
return (await this.uiautomator2.jwproxy.command(`/element/${elementId}/location`, 'GET', {}));
|
|
66
80
|
}
|
|
67
81
|
/**
|
|
68
82
|
* Gets the element size.
|
|
83
|
+
* @param elementId - ID of the element.
|
|
84
|
+
* @returns The element size (width, height).
|
|
69
85
|
*/
|
|
70
86
|
async function getSize(elementId) {
|
|
71
87
|
return (await this.uiautomator2.jwproxy.command(`/element/${elementId}/size`, 'GET', {}));
|
|
72
88
|
}
|
|
73
89
|
/**
|
|
74
90
|
* Sets the value of an element using the upstream driver API.
|
|
91
|
+
* @param params - Options containing the element ID and value to set.
|
|
75
92
|
*/
|
|
76
93
|
async function doSetElementValue(params) {
|
|
77
94
|
await this.uiautomator2.jwproxy.command(`/element/${params.elementId}/value`, 'POST', params);
|
|
78
95
|
}
|
|
79
96
|
/**
|
|
80
97
|
* Sends text to an element without replacement.
|
|
98
|
+
* @param keys - Text to send, either as a string or array of strings (which will be joined).
|
|
99
|
+
* @param elementId - ID of the element.
|
|
81
100
|
*/
|
|
82
101
|
async function setValueImmediate(keys, elementId) {
|
|
83
102
|
await this.uiautomator2.jwproxy.command(`/element/${elementId}/value`, 'POST', {
|
|
@@ -88,30 +107,38 @@ async function setValueImmediate(keys, elementId) {
|
|
|
88
107
|
}
|
|
89
108
|
/**
|
|
90
109
|
* Gets the element text.
|
|
110
|
+
* @param elementId - ID of the element.
|
|
111
|
+
* @returns The element text content.
|
|
91
112
|
*/
|
|
92
113
|
async function getText(elementId) {
|
|
93
114
|
return String(await this.uiautomator2.jwproxy.command(`/element/${elementId}/text`, 'GET', {}));
|
|
94
115
|
}
|
|
95
116
|
/**
|
|
96
117
|
* Clicks the given element.
|
|
118
|
+
* @param element - ID of the element to click.
|
|
97
119
|
*/
|
|
98
120
|
async function click(element) {
|
|
99
121
|
await this.uiautomator2.jwproxy.command(`/element/${element}/click`, 'POST', { element });
|
|
100
122
|
}
|
|
101
123
|
/**
|
|
102
124
|
* Takes a screenshot of the element.
|
|
125
|
+
* @param element - ID of the element.
|
|
126
|
+
* @returns Base64-encoded PNG screenshot of the element.
|
|
103
127
|
*/
|
|
104
128
|
async function getElementScreenshot(element) {
|
|
105
129
|
return String(await this.uiautomator2.jwproxy.command(`/element/${element}/screenshot`, 'GET', {}));
|
|
106
130
|
}
|
|
107
131
|
/**
|
|
108
132
|
* Clears the element text.
|
|
133
|
+
* @param elementId - ID of the element to clear.
|
|
109
134
|
*/
|
|
110
135
|
async function clear(elementId) {
|
|
111
136
|
await this.uiautomator2.jwproxy.command(`/element/${elementId}/clear`, 'POST', { elementId });
|
|
112
137
|
}
|
|
113
138
|
/**
|
|
114
139
|
* Gets the element rectangle.
|
|
140
|
+
* @param elementId - ID of the element.
|
|
141
|
+
* @returns The element rectangle (x, y, width, height).
|
|
115
142
|
*/
|
|
116
143
|
async function getElementRect(elementId) {
|
|
117
144
|
if (!this.isWebContext()) {
|
|
@@ -129,6 +156,8 @@ async function getElementRect(elementId) {
|
|
|
129
156
|
}
|
|
130
157
|
/**
|
|
131
158
|
* Replaces the element text.
|
|
159
|
+
* @param elementId - ID of the element.
|
|
160
|
+
* @param text - Text to replace the current element value with.
|
|
132
161
|
*/
|
|
133
162
|
async function mobileReplaceElementValue(elementId, text) {
|
|
134
163
|
await this.uiautomator2.jwproxy.command(`/element/${elementId}/value`, 'POST', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element.js","sourceRoot":"","sources":["../../../lib/commands/element.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"element.js","sourceRoot":"","sources":["../../../lib/commands/element.ts"],"names":[],"mappings":";;;;;AAYA,wBAEC;AAQD,oCAEC;AAOD,4CAEC;AAOD,wCAEC;AAOD,0CAEC;AAOD,0BAEC;AAOD,kCAEC;AAOD,0BAEC;AAMD,8CAEC;AAOD,8CAUC;AAOD,0BAEC;AAMD,sBAEC;AAOD,oDAEC;AAMD,sBAEC;AAOD,wCAcC;AAOD,8DASC;AA9KD,0CAAwC;AACxC,wDAAyB;AACzB,oDAAuB;AAMvB;;;GAGG;AACI,KAAK,UAAU,MAAM;IAC1B,OAAO,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAkB,CAAC;AAC9F,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,YAAY,CAAkC,SAAiB,EAAE,SAAiB;IACtG,OAAO,MAAM,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,SAAS,cAAc,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;AACpH,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,gBAAgB,CAAkC,SAAiB;IACvF,OAAO,MAAM,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;AACjE,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,cAAc,CAAkC,SAA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I,CAAC,YAA4B,CAAC;IACvD,IAAI,YAAY,CAAC,OAAO,CAAC,kBAAkB,KAAK,kBAAS,CAAC,OAAO,EAAE,CAAC;QAClE,MAAM,CAAC,EAAC,CAAC,EAAE,CAAC,EAAC,EAAE,EAAC,KAAK,EAAE,MAAM,EAAC,CAAC,GAAG,CAAC,MAAM,kBAAC,CAAC,GAAG,CAAC;YAC7C,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,SAAS,WAAW,EAAE,KAAK,CAAC;YACrE,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,SAAS,OAAO,EAAE,KAAK,CAAC;SAClE,CAAC,CAAqB,CAAC;QACxB,OAAO,EAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAC,CAAC;IAC/B,CAAC;IACD,OAAO,CAAC,MAAM,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,SAAS,OAAO,EAAE,KAAK,CAAC,CAAS,CAAC;AAC3F,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,yBAAyB,CAE7C,SAAiB,EACjB,IAAY;IAEZ,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,SAAS,QAAQ,EAAE,MAAM,EAAE;QAC7E,IAAI;QACJ,OAAO,EAAE,IAAI;KACd,CAAC,CAAC;AACL,CAAC;AAED,SAAS,MAAM,CAAC,KAAU;IACxB,OAAO,gBAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AACtE,CAAC"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
+
import type { Element as AppiumElement } from '@appium/types';
|
|
2
|
+
import type { FindElementOpts } from 'appium-android-driver';
|
|
3
|
+
import type { AndroidUiautomator2Driver } from '../driver';
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* @
|
|
6
|
-
* @param {import('appium-android-driver').FindElementOpts} params
|
|
7
|
-
* @returns {Promise<Element | Element[]>}
|
|
5
|
+
* Overrides helpers.doFindElementOrEls functionality of appium-android-driver.
|
|
6
|
+
* Handles special xpath selectors and CSS selector conversion.
|
|
7
|
+
* @param params - Element finding options including strategy, selector, context, and multiple flag.
|
|
8
|
+
* @returns A single element if `params.multiple` is false, or an array of elements if true.
|
|
8
9
|
*/
|
|
9
|
-
export function doFindElementOrEls(this:
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
export declare function doFindElementOrEls(this: AndroidUiautomator2Driver, params: FindElementOpts & {
|
|
11
|
+
multiple: true;
|
|
12
|
+
}): Promise<AppiumElement[]>;
|
|
13
|
+
export declare function doFindElementOrEls(this: AndroidUiautomator2Driver, params: FindElementOpts & {
|
|
14
|
+
multiple: false;
|
|
15
|
+
}): Promise<AppiumElement>;
|
|
12
16
|
//# sourceMappingURL=find.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../lib/commands/find.
|
|
1
|
+
{"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../lib/commands/find.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,eAAe,CAAC;AAC5D,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,WAAW,CAAC;AASzD;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,yBAAyB,EAC/B,MAAM,EAAE,eAAe,GAAG;IAAC,QAAQ,EAAE,IAAI,CAAA;CAAC,GACzC,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;AAC5B,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,yBAAyB,EAC/B,MAAM,EAAE,eAAe,GAAG;IAAC,QAAQ,EAAE,KAAK,CAAA;CAAC,GAC1C,OAAO,CAAC,aAAa,CAAC,CAAC"}
|
|
@@ -7,19 +7,11 @@ const css_converter_1 = require("../css-converter");
|
|
|
7
7
|
const MAGIC_FIRST_VIS_CHILD_SEL = /\/\*\[@firstVisible ?= ?('|")true\1\]/;
|
|
8
8
|
const MAGIC_SCROLLABLE_SEL = /\/\/\*\[@scrollable ?= ?('|")true\1\]/;
|
|
9
9
|
const MAGIC_SCROLLABLE_BY = 'new UiSelector().scrollable(true)';
|
|
10
|
-
/**
|
|
11
|
-
* @privateRemarks Overriding helpers.doFindElementOrEls functionality of appium-android-driver,
|
|
12
|
-
* this.element initialized in find.js of appium-android-drive.
|
|
13
|
-
*
|
|
14
|
-
* @this {AndroidUiautomator2Driver}
|
|
15
|
-
* @param {import('appium-android-driver').FindElementOpts} params
|
|
16
|
-
* @returns {Promise<Element | Element[]>}
|
|
17
|
-
*/
|
|
18
10
|
async function doFindElementOrEls(params) {
|
|
19
|
-
const uiautomator2 =
|
|
11
|
+
const uiautomator2 = this.uiautomator2;
|
|
20
12
|
if (params.strategy === 'xpath' && MAGIC_FIRST_VIS_CHILD_SEL.test(params.selector)) {
|
|
21
|
-
|
|
22
|
-
return
|
|
13
|
+
const elementId = params.context;
|
|
14
|
+
return (await uiautomator2.jwproxy.command(`/appium/element/${elementId}/first_visible`, 'GET', {}));
|
|
23
15
|
}
|
|
24
16
|
if (params.strategy === 'xpath' && MAGIC_SCROLLABLE_SEL.test(params.selector)) {
|
|
25
17
|
params.strategy = '-android uiautomator';
|
|
@@ -29,10 +21,6 @@ async function doFindElementOrEls(params) {
|
|
|
29
21
|
params.strategy = '-android uiautomator';
|
|
30
22
|
params.selector = new css_converter_1.CssConverter(params.selector, this.opts.appPackage).toUiAutomatorSelector();
|
|
31
23
|
}
|
|
32
|
-
return
|
|
24
|
+
return (await uiautomator2.jwproxy.command(`/element${params.multiple ? 's' : ''}`, 'POST', params));
|
|
33
25
|
}
|
|
34
|
-
/**
|
|
35
|
-
* @typedef {import('@appium/types').Element} Element
|
|
36
|
-
* @typedef {import('../driver').AndroidUiautomator2Driver} AndroidUiautomator2Driver
|
|
37
|
-
*/
|
|
38
26
|
//# sourceMappingURL=find.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find.js","sourceRoot":"","sources":["../../../lib/commands/find.
|
|
1
|
+
{"version":3,"file":"find.js","sourceRoot":"","sources":["../../../lib/commands/find.ts"],"names":[],"mappings":";;AA0BA,gDAoBC;AA9CD,oDAA8C;AAK9C,4EAA4E;AAC5E,sCAAsC;AACtC,MAAM,yBAAyB,GAAG,uCAAuC,CAAC;AAE1E,MAAM,oBAAoB,GAAG,uCAAuC,CAAC;AACrE,MAAM,mBAAmB,GAAG,mCAAmC,CAAC;AAgBzD,KAAK,UAAU,kBAAkB,CAEtC,MAAuB;IAEvB,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;IACvC,IAAI,MAAM,CAAC,QAAQ,KAAK,OAAO,IAAI,yBAAyB,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;QACnF,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC;QACjC,OAAO,CAAC,MAAM,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,mBAAmB,SAAS,gBAAgB,EAAE,KAAK,EAAE,EAAE,CAAC,CAAkB,CAAC;IACxH,CAAC;IACD,IAAI,MAAM,CAAC,QAAQ,KAAK,OAAO,IAAI,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC9E,MAAM,CAAC,QAAQ,GAAG,sBAAsB,CAAC;QACzC,MAAM,CAAC,QAAQ,GAAG,mBAAmB,CAAC;IACxC,CAAC;IACD,IAAI,MAAM,CAAC,QAAQ,KAAK,cAAc,EAAE,CAAC;QACvC,MAAM,CAAC,QAAQ,GAAG,sBAAsB,CAAC;QACzC,MAAM,CAAC,QAAQ,GAAG,IAAI,4BAAY,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,qBAAqB,EAAE,CAAC;IACpG,CAAC;IACD,OAAO,CAAC,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,CAEhF,CAAC;AACtB,CAAC"}
|
|
@@ -2,46 +2,109 @@ import type { Element as AppiumElement } from '@appium/types';
|
|
|
2
2
|
import type { AndroidUiautomator2Driver } from '../driver';
|
|
3
3
|
/**
|
|
4
4
|
* Performs a simple click/tap gesture.
|
|
5
|
+
* @param elementId - Optional element to use as the origin for the click. If not provided, uses screen coordinates.
|
|
6
|
+
* @param x - Optional X offset from the element origin or screen.
|
|
7
|
+
* @param y - Optional Y offset from the element origin or screen.
|
|
5
8
|
*/
|
|
6
9
|
export declare function mobileClickGesture(this: AndroidUiautomator2Driver, elementId?: AppiumElement | string, x?: number, y?: number): Promise<void>;
|
|
7
10
|
/**
|
|
8
11
|
* Performs a long click with an optional duration.
|
|
12
|
+
* @param elementId - Optional element to use as the origin for the long click.
|
|
13
|
+
* @param x - Optional X offset from the element origin or screen.
|
|
14
|
+
* @param y - Optional Y offset from the element origin or screen.
|
|
15
|
+
* @param duration - Optional duration of the long press in milliseconds.
|
|
9
16
|
*/
|
|
10
17
|
export declare function mobileLongClickGesture(this: AndroidUiautomator2Driver, elementId?: AppiumElement | string, x?: number, y?: number, duration?: number): Promise<void>;
|
|
11
18
|
/**
|
|
12
19
|
* Performs a double-click gesture.
|
|
20
|
+
* @param elementId - Optional element to use as the origin for the double click.
|
|
21
|
+
* @param x - Optional X offset from the element origin or screen.
|
|
22
|
+
* @param y - Optional Y offset from the element origin or screen.
|
|
13
23
|
*/
|
|
14
24
|
export declare function mobileDoubleClickGesture(this: AndroidUiautomator2Driver, elementId?: AppiumElement | string, x?: number, y?: number): Promise<void>;
|
|
15
25
|
/**
|
|
16
26
|
* Drags from a start point to an end point.
|
|
27
|
+
* @param elementId - Optional element to use as the origin for the drag.
|
|
28
|
+
* @param startX - X coordinate of the drag start point.
|
|
29
|
+
* @param startY - Y coordinate of the drag start point.
|
|
30
|
+
* @param endX - X coordinate of the drag end point.
|
|
31
|
+
* @param endY - Y coordinate of the drag end point.
|
|
32
|
+
* @param speed - Optional speed of the drag gesture.
|
|
17
33
|
*/
|
|
18
34
|
export declare function mobileDragGesture(this: AndroidUiautomator2Driver, elementId?: AppiumElement | string, startX?: number, startY?: number, endX?: number, endY?: number, speed?: number): Promise<void>;
|
|
19
35
|
/**
|
|
20
36
|
* Performs a fling gesture and reports if further scrolling is possible.
|
|
37
|
+
* @param direction - Direction of the fling ('up', 'down', 'left', 'right').
|
|
38
|
+
* @param elementId - Optional element to use as the origin for the fling.
|
|
39
|
+
* @param left - Optional left coordinate of the fling area.
|
|
40
|
+
* @param top - Optional top coordinate of the fling area.
|
|
41
|
+
* @param width - Optional width of the fling area.
|
|
42
|
+
* @param height - Optional height of the fling area.
|
|
43
|
+
* @param speed - Optional speed of the fling gesture.
|
|
44
|
+
* @returns True if further scrolling is possible, false otherwise.
|
|
21
45
|
*/
|
|
22
46
|
export declare function mobileFlingGesture(this: AndroidUiautomator2Driver, direction: string, elementId?: AppiumElement | string, left?: number, top?: number, width?: number, height?: number, speed?: number): Promise<boolean>;
|
|
23
47
|
/**
|
|
24
48
|
* Performs a pinch-close gesture.
|
|
49
|
+
* @param percent - Percentage of the pinch (0-100).
|
|
50
|
+
* @param elementId - Optional element to use as the origin for the pinch.
|
|
51
|
+
* @param left - Optional left coordinate of the pinch area.
|
|
52
|
+
* @param top - Optional top coordinate of the pinch area.
|
|
53
|
+
* @param width - Optional width of the pinch area.
|
|
54
|
+
* @param height - Optional height of the pinch area.
|
|
55
|
+
* @param speed - Optional speed of the pinch gesture.
|
|
25
56
|
*/
|
|
26
57
|
export declare function mobilePinchCloseGesture(this: AndroidUiautomator2Driver, percent: number, elementId?: AppiumElement | string, left?: number, top?: number, width?: number, height?: number, speed?: number): Promise<void>;
|
|
27
58
|
/**
|
|
28
59
|
* Performs a pinch-open gesture.
|
|
60
|
+
* @param percent - Percentage of the pinch (0-100).
|
|
61
|
+
* @param elementId - Optional element to use as the origin for the pinch.
|
|
62
|
+
* @param left - Optional left coordinate of the pinch area.
|
|
63
|
+
* @param top - Optional top coordinate of the pinch area.
|
|
64
|
+
* @param width - Optional width of the pinch area.
|
|
65
|
+
* @param height - Optional height of the pinch area.
|
|
66
|
+
* @param speed - Optional speed of the pinch gesture.
|
|
29
67
|
*/
|
|
30
68
|
export declare function mobilePinchOpenGesture(this: AndroidUiautomator2Driver, percent: number, elementId?: AppiumElement | string, left?: number, top?: number, width?: number, height?: number, speed?: number): Promise<void>;
|
|
31
69
|
/**
|
|
32
70
|
* Performs a swipe gesture for the given direction and percent.
|
|
71
|
+
* @param direction - Direction of the swipe ('up', 'down', 'left', 'right').
|
|
72
|
+
* @param percent - Percentage of the swipe distance (0-100).
|
|
73
|
+
* @param elementId - Optional element to use as the origin for the swipe.
|
|
74
|
+
* @param left - Optional left coordinate of the swipe area.
|
|
75
|
+
* @param top - Optional top coordinate of the swipe area.
|
|
76
|
+
* @param width - Optional width of the swipe area.
|
|
77
|
+
* @param height - Optional height of the swipe area.
|
|
78
|
+
* @param speed - Optional speed of the swipe gesture.
|
|
33
79
|
*/
|
|
34
80
|
export declare function mobileSwipeGesture(this: AndroidUiautomator2Driver, direction: string, percent: number, elementId?: AppiumElement | string, left?: number, top?: number, width?: number, height?: number, speed?: number): Promise<void>;
|
|
35
81
|
/**
|
|
36
82
|
* Performs a scroll gesture and reports if further scrolling is possible.
|
|
83
|
+
* @param direction - Direction of the scroll ('up', 'down', 'left', 'right').
|
|
84
|
+
* @param percent - Percentage of the scroll distance (0-100).
|
|
85
|
+
* @param elementId - Optional element to use as the origin for the scroll.
|
|
86
|
+
* @param left - Optional left coordinate of the scroll area.
|
|
87
|
+
* @param top - Optional top coordinate of the scroll area.
|
|
88
|
+
* @param width - Optional width of the scroll area.
|
|
89
|
+
* @param height - Optional height of the scroll area.
|
|
90
|
+
* @param speed - Optional speed of the scroll gesture.
|
|
91
|
+
* @returns True if further scrolling is possible, false otherwise.
|
|
37
92
|
*/
|
|
38
93
|
export declare function mobileScrollGesture(this: AndroidUiautomator2Driver, direction: string, percent: number, elementId?: AppiumElement | string, left?: number, top?: number, width?: number, height?: number, speed?: number): Promise<boolean>;
|
|
39
94
|
/**
|
|
40
95
|
* Scrolls a scrollable element until a target element becomes visible.
|
|
96
|
+
* @param elementId - ID of the scrollable element.
|
|
97
|
+
* @param elementToId - ID of the target element to scroll to.
|
|
98
|
+
* @throws {errors.InvalidArgumentError} If either elementId or elementToId is not provided.
|
|
41
99
|
*/
|
|
42
100
|
export declare function mobileScrollBackTo(this: AndroidUiautomator2Driver, elementId?: string, elementToId?: string): Promise<void>;
|
|
43
101
|
/**
|
|
44
102
|
* Scrolls until an element located by the given strategy is visible.
|
|
103
|
+
* @param strategy - Locator strategy to use (e.g., 'id', 'xpath', 'class name').
|
|
104
|
+
* @param selector - Selector string for the element to find.
|
|
105
|
+
* @param elementId - Optional element to use as the origin for scrolling.
|
|
106
|
+
* @param maxSwipes - Optional maximum number of swipes to perform.
|
|
107
|
+
* @throws {errors.InvalidArgumentError} If either strategy or selector is not provided.
|
|
45
108
|
*/
|
|
46
109
|
export declare function mobileScroll(this: AndroidUiautomator2Driver, strategy: string, selector: string, elementId?: AppiumElement | string, maxSwipes?: number): Promise<void>;
|
|
47
110
|
//# sourceMappingURL=gestures.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gestures.d.ts","sourceRoot":"","sources":["../../../lib/commands/gestures.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,IAAI,aAAa,EAAW,MAAM,eAAe,CAAC;AAEtE,OAAO,KAAK,EAAC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AAC,CAQf;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,yBAAyB,EAC/B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,aAAa,GAAG,MAAM,EAClC,IAAI,CAAC,EAAE,MAAM,EACb,GAAG,CAAC,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,OAAO,CAAC,CAQlB;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,yBAAyB,EAC/B,SAAS,CAAC,EAAE,MAAM,EAClB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CASf;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,yBAAyB,EAC/B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,aAAa,GAAG,MAAM,EAClC,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CAQf"}
|
|
@@ -19,6 +19,9 @@ const support_1 = require("appium/support");
|
|
|
19
19
|
const lodash_1 = __importDefault(require("lodash"));
|
|
20
20
|
/**
|
|
21
21
|
* Performs a simple click/tap gesture.
|
|
22
|
+
* @param elementId - Optional element to use as the origin for the click. If not provided, uses screen coordinates.
|
|
23
|
+
* @param x - Optional X offset from the element origin or screen.
|
|
24
|
+
* @param y - Optional Y offset from the element origin or screen.
|
|
22
25
|
*/
|
|
23
26
|
async function mobileClickGesture(elementId, x, y) {
|
|
24
27
|
await this.uiautomator2.jwproxy.command('/appium/gestures/click', 'POST', {
|
|
@@ -28,6 +31,10 @@ async function mobileClickGesture(elementId, x, y) {
|
|
|
28
31
|
}
|
|
29
32
|
/**
|
|
30
33
|
* Performs a long click with an optional duration.
|
|
34
|
+
* @param elementId - Optional element to use as the origin for the long click.
|
|
35
|
+
* @param x - Optional X offset from the element origin or screen.
|
|
36
|
+
* @param y - Optional Y offset from the element origin or screen.
|
|
37
|
+
* @param duration - Optional duration of the long press in milliseconds.
|
|
31
38
|
*/
|
|
32
39
|
async function mobileLongClickGesture(elementId, x, y, duration) {
|
|
33
40
|
await this.uiautomator2.jwproxy.command('/appium/gestures/long_click', 'POST', {
|
|
@@ -38,6 +45,9 @@ async function mobileLongClickGesture(elementId, x, y, duration) {
|
|
|
38
45
|
}
|
|
39
46
|
/**
|
|
40
47
|
* Performs a double-click gesture.
|
|
48
|
+
* @param elementId - Optional element to use as the origin for the double click.
|
|
49
|
+
* @param x - Optional X offset from the element origin or screen.
|
|
50
|
+
* @param y - Optional Y offset from the element origin or screen.
|
|
41
51
|
*/
|
|
42
52
|
async function mobileDoubleClickGesture(elementId, x, y) {
|
|
43
53
|
await this.uiautomator2.jwproxy.command('/appium/gestures/double_click', 'POST', {
|
|
@@ -47,6 +57,12 @@ async function mobileDoubleClickGesture(elementId, x, y) {
|
|
|
47
57
|
}
|
|
48
58
|
/**
|
|
49
59
|
* Drags from a start point to an end point.
|
|
60
|
+
* @param elementId - Optional element to use as the origin for the drag.
|
|
61
|
+
* @param startX - X coordinate of the drag start point.
|
|
62
|
+
* @param startY - Y coordinate of the drag start point.
|
|
63
|
+
* @param endX - X coordinate of the drag end point.
|
|
64
|
+
* @param endY - Y coordinate of the drag end point.
|
|
65
|
+
* @param speed - Optional speed of the drag gesture.
|
|
50
66
|
*/
|
|
51
67
|
async function mobileDragGesture(elementId, startX, startY, endX, endY, speed) {
|
|
52
68
|
await this.uiautomator2.jwproxy.command('/appium/gestures/drag', 'POST', {
|
|
@@ -58,6 +74,14 @@ async function mobileDragGesture(elementId, startX, startY, endX, endY, speed) {
|
|
|
58
74
|
}
|
|
59
75
|
/**
|
|
60
76
|
* Performs a fling gesture and reports if further scrolling is possible.
|
|
77
|
+
* @param direction - Direction of the fling ('up', 'down', 'left', 'right').
|
|
78
|
+
* @param elementId - Optional element to use as the origin for the fling.
|
|
79
|
+
* @param left - Optional left coordinate of the fling area.
|
|
80
|
+
* @param top - Optional top coordinate of the fling area.
|
|
81
|
+
* @param width - Optional width of the fling area.
|
|
82
|
+
* @param height - Optional height of the fling area.
|
|
83
|
+
* @param speed - Optional speed of the fling gesture.
|
|
84
|
+
* @returns True if further scrolling is possible, false otherwise.
|
|
61
85
|
*/
|
|
62
86
|
async function mobileFlingGesture(direction, elementId, left, top, width, height, speed) {
|
|
63
87
|
return (await this.uiautomator2.jwproxy.command('/appium/gestures/fling', 'POST', {
|
|
@@ -69,6 +93,13 @@ async function mobileFlingGesture(direction, elementId, left, top, width, height
|
|
|
69
93
|
}
|
|
70
94
|
/**
|
|
71
95
|
* Performs a pinch-close gesture.
|
|
96
|
+
* @param percent - Percentage of the pinch (0-100).
|
|
97
|
+
* @param elementId - Optional element to use as the origin for the pinch.
|
|
98
|
+
* @param left - Optional left coordinate of the pinch area.
|
|
99
|
+
* @param top - Optional top coordinate of the pinch area.
|
|
100
|
+
* @param width - Optional width of the pinch area.
|
|
101
|
+
* @param height - Optional height of the pinch area.
|
|
102
|
+
* @param speed - Optional speed of the pinch gesture.
|
|
72
103
|
*/
|
|
73
104
|
async function mobilePinchCloseGesture(percent, elementId, left, top, width, height, speed) {
|
|
74
105
|
await this.uiautomator2.jwproxy.command('/appium/gestures/pinch_close', 'POST', {
|
|
@@ -80,6 +111,13 @@ async function mobilePinchCloseGesture(percent, elementId, left, top, width, hei
|
|
|
80
111
|
}
|
|
81
112
|
/**
|
|
82
113
|
* Performs a pinch-open gesture.
|
|
114
|
+
* @param percent - Percentage of the pinch (0-100).
|
|
115
|
+
* @param elementId - Optional element to use as the origin for the pinch.
|
|
116
|
+
* @param left - Optional left coordinate of the pinch area.
|
|
117
|
+
* @param top - Optional top coordinate of the pinch area.
|
|
118
|
+
* @param width - Optional width of the pinch area.
|
|
119
|
+
* @param height - Optional height of the pinch area.
|
|
120
|
+
* @param speed - Optional speed of the pinch gesture.
|
|
83
121
|
*/
|
|
84
122
|
async function mobilePinchOpenGesture(percent, elementId, left, top, width, height, speed) {
|
|
85
123
|
await this.uiautomator2.jwproxy.command('/appium/gestures/pinch_open', 'POST', {
|
|
@@ -91,6 +129,14 @@ async function mobilePinchOpenGesture(percent, elementId, left, top, width, heig
|
|
|
91
129
|
}
|
|
92
130
|
/**
|
|
93
131
|
* Performs a swipe gesture for the given direction and percent.
|
|
132
|
+
* @param direction - Direction of the swipe ('up', 'down', 'left', 'right').
|
|
133
|
+
* @param percent - Percentage of the swipe distance (0-100).
|
|
134
|
+
* @param elementId - Optional element to use as the origin for the swipe.
|
|
135
|
+
* @param left - Optional left coordinate of the swipe area.
|
|
136
|
+
* @param top - Optional top coordinate of the swipe area.
|
|
137
|
+
* @param width - Optional width of the swipe area.
|
|
138
|
+
* @param height - Optional height of the swipe area.
|
|
139
|
+
* @param speed - Optional speed of the swipe gesture.
|
|
94
140
|
*/
|
|
95
141
|
async function mobileSwipeGesture(direction, percent, elementId, left, top, width, height, speed) {
|
|
96
142
|
await this.uiautomator2.jwproxy.command('/appium/gestures/swipe', 'POST', {
|
|
@@ -103,6 +149,15 @@ async function mobileSwipeGesture(direction, percent, elementId, left, top, widt
|
|
|
103
149
|
}
|
|
104
150
|
/**
|
|
105
151
|
* Performs a scroll gesture and reports if further scrolling is possible.
|
|
152
|
+
* @param direction - Direction of the scroll ('up', 'down', 'left', 'right').
|
|
153
|
+
* @param percent - Percentage of the scroll distance (0-100).
|
|
154
|
+
* @param elementId - Optional element to use as the origin for the scroll.
|
|
155
|
+
* @param left - Optional left coordinate of the scroll area.
|
|
156
|
+
* @param top - Optional top coordinate of the scroll area.
|
|
157
|
+
* @param width - Optional width of the scroll area.
|
|
158
|
+
* @param height - Optional height of the scroll area.
|
|
159
|
+
* @param speed - Optional speed of the scroll gesture.
|
|
160
|
+
* @returns True if further scrolling is possible, false otherwise.
|
|
106
161
|
*/
|
|
107
162
|
async function mobileScrollGesture(direction, percent, elementId, left, top, width, height, speed) {
|
|
108
163
|
return (await this.uiautomator2.jwproxy.command('/appium/gestures/scroll', 'POST', {
|
|
@@ -115,6 +170,9 @@ async function mobileScrollGesture(direction, percent, elementId, left, top, wid
|
|
|
115
170
|
}
|
|
116
171
|
/**
|
|
117
172
|
* Scrolls a scrollable element until a target element becomes visible.
|
|
173
|
+
* @param elementId - ID of the scrollable element.
|
|
174
|
+
* @param elementToId - ID of the target element to scroll to.
|
|
175
|
+
* @throws {errors.InvalidArgumentError} If either elementId or elementToId is not provided.
|
|
118
176
|
*/
|
|
119
177
|
async function mobileScrollBackTo(elementId, elementToId) {
|
|
120
178
|
if (!elementId || !elementToId) {
|
|
@@ -124,6 +182,11 @@ async function mobileScrollBackTo(elementId, elementToId) {
|
|
|
124
182
|
}
|
|
125
183
|
/**
|
|
126
184
|
* Scrolls until an element located by the given strategy is visible.
|
|
185
|
+
* @param strategy - Locator strategy to use (e.g., 'id', 'xpath', 'class name').
|
|
186
|
+
* @param selector - Selector string for the element to find.
|
|
187
|
+
* @param elementId - Optional element to use as the origin for scrolling.
|
|
188
|
+
* @param maxSwipes - Optional maximum number of swipes to perform.
|
|
189
|
+
* @throws {errors.InvalidArgumentError} If either strategy or selector is not provided.
|
|
127
190
|
*/
|
|
128
191
|
async function mobileScroll(strategy, selector, elementId, maxSwipes) {
|
|
129
192
|
if (!strategy || !selector) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gestures.js","sourceRoot":"","sources":["../../../lib/commands/gestures.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"gestures.js","sourceRoot":"","sources":["../../../lib/commands/gestures.ts"],"names":[],"mappings":";;;;;AAaA,gDAUC;AASD,wDAYC;AAQD,4DAUC;AAWD,8CAeC;AAaD,gDAgBC;AAYD,0DAgBC;AAYD,wDAgBC;AAaD,gDAkBC;AAcD,kDAkBC;AAQD,gDAaC;AAUD,oCAcC;AAzRD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E,KAAK,EAAE,MAAM,EAAkB,CAAC;AACnD,CAAC"}
|
|
@@ -1,54 +1,43 @@
|
|
|
1
|
+
import type { AndroidUiautomator2Driver } from '../driver';
|
|
2
|
+
import type { SendKeysOpts } from 'appium-android-driver';
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @param
|
|
4
|
-
* @param
|
|
5
|
-
* @param
|
|
6
|
-
* @returns {Promise<void>}
|
|
4
|
+
* Presses a key code with optional metastate and flags.
|
|
5
|
+
* @param keycode - Android key code to press.
|
|
6
|
+
* @param metastate - Optional meta state modifier keys.
|
|
7
|
+
* @param flags - Optional flags for the key event.
|
|
7
8
|
*/
|
|
8
|
-
export function pressKeyCode(this:
|
|
9
|
+
export declare function pressKeyCode(this: AndroidUiautomator2Driver, keycode: string | number, metastate?: number, flags?: number): Promise<void>;
|
|
9
10
|
/**
|
|
10
|
-
*
|
|
11
|
-
* @param
|
|
12
|
-
* @param
|
|
13
|
-
* @param
|
|
14
|
-
* @returns {Promise<void>}
|
|
11
|
+
* Long presses a key code with optional metastate and flags.
|
|
12
|
+
* @param keycode - Android key code to long press.
|
|
13
|
+
* @param metastate - Meta state modifier keys.
|
|
14
|
+
* @param flags - Optional flags for the key event.
|
|
15
15
|
*/
|
|
16
|
-
export function longPressKeyCode(this:
|
|
16
|
+
export declare function longPressKeyCode(this: AndroidUiautomator2Driver, keycode: string | number, metastate: number, flags?: number): Promise<void>;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
* @param
|
|
20
|
-
*
|
|
21
|
-
* @param
|
|
22
|
-
*
|
|
23
|
-
* @param {string} [flags] Flags for the particular key event. See
|
|
24
|
-
* https://developer.android.com/reference/android/view/KeyEvent for more details.
|
|
25
|
-
* @param {boolean} [isLongPress=false] Whether to emulate long key press
|
|
26
|
-
* @returns {Promise<void>}
|
|
18
|
+
* Presses a key code with optional metastate, flags, and long press support.
|
|
19
|
+
* @param keycode - Android key code to press.
|
|
20
|
+
* @param metastate - Optional meta state modifier keys.
|
|
21
|
+
* @param flags - Optional flags for the key event.
|
|
22
|
+
* @param isLongPress - Whether to perform a long press. Defaults to false.
|
|
27
23
|
*/
|
|
28
|
-
export function mobilePressKey(this:
|
|
24
|
+
export declare function mobilePressKey(this: AndroidUiautomator2Driver, keycode: number, metastate?: number, flags?: string, isLongPress?: boolean): Promise<void>;
|
|
29
25
|
/**
|
|
30
|
-
* Types the given Unicode string.
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* @this {AndroidUiautomator2Driver}
|
|
35
|
-
* @param {string | number | boolean} text The text to type. Can be a string, number or boolean.
|
|
36
|
-
* @returns {Promise<boolean>} `true` if the input text has been successfully sent to adb
|
|
37
|
-
* @throws {Error} if `text` property has not been provided
|
|
26
|
+
* Types the given Unicode string. The focus should already be on the destination input field.
|
|
27
|
+
* @param text - Text to type. Can be a string, number, or boolean.
|
|
28
|
+
* @returns True if the input text has been successfully sent to adb.
|
|
29
|
+
* @throws {errors.InvalidArgumentError} If the text argument is not provided.
|
|
38
30
|
*/
|
|
39
|
-
export function mobileType(this:
|
|
31
|
+
export declare function mobileType(this: AndroidUiautomator2Driver, text: string | number | boolean): Promise<boolean>;
|
|
40
32
|
/**
|
|
41
|
-
*
|
|
42
|
-
* @param
|
|
43
|
-
* @returns {Promise<void>}
|
|
33
|
+
* Sends keys to the current element.
|
|
34
|
+
* @param params - Options containing the text to send and optional replace flag.
|
|
44
35
|
*/
|
|
45
|
-
export function doSendKeys(this:
|
|
36
|
+
export declare function doSendKeys(this: AndroidUiautomator2Driver, params: SendKeysOpts): Promise<void>;
|
|
46
37
|
/**
|
|
47
|
-
*
|
|
48
|
-
* @param
|
|
49
|
-
* @param
|
|
50
|
-
* @returns {Promise<void>}
|
|
38
|
+
* Sends a key event to the device.
|
|
39
|
+
* @param keycode - Android key code to send.
|
|
40
|
+
* @param metastate - Optional meta state (ignored in this implementation).
|
|
51
41
|
*/
|
|
52
|
-
export function keyevent(this:
|
|
53
|
-
export type AndroidUiautomator2Driver = import("../driver").AndroidUiautomator2Driver;
|
|
42
|
+
export declare function keyevent(this: AndroidUiautomator2Driver, keycode: string | number, metastate?: number): Promise<void>;
|
|
54
43
|
//# sourceMappingURL=keyboard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../../lib/commands/keyboard.
|
|
1
|
+
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../../lib/commands/keyboard.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,WAAW,CAAC;AACzD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAExD;;;;;GAKG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,yBAAyB,EAC/B,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,SAAS,CAAC,EAAE,MAAM,EAClB,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CAMf;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,yBAAyB,EAC/B,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,SAAS,EAAE,MAAM,EACjB,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CAMf;AAED;;;;;;GAMG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,yBAAyB,EAC/B,OAAO,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,MAAM,EAClB,KAAK,CAAC,EAAE,MAAM,EACd,WAAW,GAAE,OAAe,GAC3B,OAAO,CAAC,IAAI,CAAC,CAMf;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,yBAAyB,EAC/B,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAC9B,OAAO,CAAC,OAAO,CAAC,CAKlB;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAA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