appium-android-driver 9.15.0 → 10.0.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 +121 -0
- package/build/lib/commands/app-management.d.ts +39 -26
- package/build/lib/commands/app-management.d.ts.map +1 -1
- package/build/lib/commands/app-management.js +59 -42
- package/build/lib/commands/app-management.js.map +1 -1
- package/build/lib/commands/appearance.d.ts +10 -4
- package/build/lib/commands/appearance.d.ts.map +1 -1
- package/build/lib/commands/appearance.js +10 -7
- package/build/lib/commands/appearance.js.map +1 -1
- package/build/lib/commands/bluetooth.d.ts +2 -2
- package/build/lib/commands/bluetooth.d.ts.map +1 -1
- package/build/lib/commands/bluetooth.js +2 -3
- package/build/lib/commands/bluetooth.js.map +1 -1
- package/build/lib/commands/context/exports.d.ts +2 -2
- package/build/lib/commands/context/exports.d.ts.map +1 -1
- package/build/lib/commands/context/exports.js +3 -3
- package/build/lib/commands/context/exports.js.map +1 -1
- package/build/lib/commands/device/emulator-actions.d.ts +25 -18
- package/build/lib/commands/device/emulator-actions.d.ts.map +1 -1
- package/build/lib/commands/device/emulator-actions.js +38 -40
- package/build/lib/commands/device/emulator-actions.js.map +1 -1
- package/build/lib/commands/device/emulator-console.d.ts +9 -2
- package/build/lib/commands/device/emulator-console.d.ts.map +1 -1
- package/build/lib/commands/device/emulator-console.js +9 -3
- package/build/lib/commands/device/emulator-console.js.map +1 -1
- package/build/lib/commands/deviceidle.d.ts +3 -2
- package/build/lib/commands/deviceidle.d.ts.map +1 -1
- package/build/lib/commands/deviceidle.js +3 -3
- package/build/lib/commands/deviceidle.js.map +1 -1
- package/build/lib/commands/execute.d.ts +6 -15
- package/build/lib/commands/execute.d.ts.map +1 -1
- package/build/lib/commands/execute.js +36 -93
- package/build/lib/commands/execute.js.map +1 -1
- package/build/lib/commands/file-actions.d.ts +13 -24
- package/build/lib/commands/file-actions.d.ts.map +1 -1
- package/build/lib/commands/file-actions.js +13 -38
- package/build/lib/commands/file-actions.js.map +1 -1
- package/build/lib/commands/geolocation.d.ts +9 -4
- package/build/lib/commands/geolocation.d.ts.map +1 -1
- package/build/lib/commands/geolocation.js +14 -6
- package/build/lib/commands/geolocation.js.map +1 -1
- package/build/lib/commands/image-injection.d.ts +2 -2
- package/build/lib/commands/image-injection.d.ts.map +1 -1
- package/build/lib/commands/image-injection.js +2 -3
- package/build/lib/commands/image-injection.js.map +1 -1
- package/build/lib/commands/intent.d.ts +70 -8
- package/build/lib/commands/intent.d.ts.map +1 -1
- package/build/lib/commands/intent.js +118 -16
- package/build/lib/commands/intent.js.map +1 -1
- package/build/lib/commands/keyboard.d.ts +2 -2
- package/build/lib/commands/keyboard.d.ts.map +1 -1
- package/build/lib/commands/keyboard.js +2 -4
- package/build/lib/commands/keyboard.js.map +1 -1
- package/build/lib/commands/lock/exports.d.ts +12 -8
- package/build/lib/commands/lock/exports.d.ts.map +1 -1
- package/build/lib/commands/lock/exports.js +12 -13
- package/build/lib/commands/lock/exports.js.map +1 -1
- package/build/lib/commands/media-projection.d.ts +41 -4
- package/build/lib/commands/media-projection.d.ts.map +1 -1
- package/build/lib/commands/media-projection.js +52 -11
- package/build/lib/commands/media-projection.js.map +1 -1
- package/build/lib/commands/memory.d.ts +4 -2
- package/build/lib/commands/memory.d.ts.map +1 -1
- package/build/lib/commands/memory.js +4 -3
- package/build/lib/commands/memory.js.map +1 -1
- package/build/lib/commands/network.d.ts +10 -4
- package/build/lib/commands/network.d.ts.map +1 -1
- package/build/lib/commands/network.js +17 -14
- package/build/lib/commands/network.js.map +1 -1
- package/build/lib/commands/nfc.d.ts +2 -2
- package/build/lib/commands/nfc.d.ts.map +1 -1
- package/build/lib/commands/nfc.js +2 -3
- package/build/lib/commands/nfc.js.map +1 -1
- package/build/lib/commands/performance.d.ts +3 -2
- package/build/lib/commands/performance.d.ts.map +1 -1
- package/build/lib/commands/performance.js +3 -4
- package/build/lib/commands/performance.js.map +1 -1
- package/build/lib/commands/permissions.d.ts +23 -5
- package/build/lib/commands/permissions.d.ts.map +1 -1
- package/build/lib/commands/permissions.js +27 -8
- package/build/lib/commands/permissions.js.map +1 -1
- package/build/lib/commands/shell.d.ts +3 -9
- package/build/lib/commands/shell.d.ts.map +1 -1
- package/build/lib/commands/shell.js +3 -10
- package/build/lib/commands/shell.js.map +1 -1
- package/build/lib/commands/streamscreen.d.ts +56 -6
- package/build/lib/commands/streamscreen.d.ts.map +1 -1
- package/build/lib/commands/streamscreen.js +28 -4
- package/build/lib/commands/streamscreen.js.map +1 -1
- package/build/lib/commands/system-bars.d.ts +6 -2
- package/build/lib/commands/system-bars.d.ts.map +1 -1
- package/build/lib/commands/system-bars.js +7 -7
- package/build/lib/commands/system-bars.js.map +1 -1
- package/build/lib/commands/time.d.ts +2 -2
- package/build/lib/commands/time.d.ts.map +1 -1
- package/build/lib/commands/time.js +3 -3
- package/build/lib/commands/time.js.map +1 -1
- package/build/lib/commands/types.d.ts +0 -588
- package/build/lib/commands/types.d.ts.map +1 -1
- package/build/lib/driver.d.ts +364 -12
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +2 -8
- package/build/lib/driver.js.map +1 -1
- package/build/lib/execute-method-map.d.ts +361 -0
- package/build/lib/execute-method-map.d.ts.map +1 -0
- package/build/lib/execute-method-map.js +437 -0
- package/build/lib/execute-method-map.js.map +1 -0
- package/lib/commands/app-management.js +68 -42
- package/lib/commands/appearance.js +10 -8
- package/lib/commands/bluetooth.js +2 -3
- package/lib/commands/context/exports.js +3 -3
- package/lib/commands/device/emulator-actions.js +28 -30
- package/lib/commands/device/emulator-console.js +9 -4
- package/lib/commands/deviceidle.js +3 -4
- package/lib/commands/execute.js +42 -124
- package/lib/commands/file-actions.js +13 -38
- package/lib/commands/geolocation.js +14 -6
- package/lib/commands/image-injection.js +2 -3
- package/lib/commands/intent.js +174 -16
- package/lib/commands/keyboard.js +2 -4
- package/lib/commands/lock/exports.js +12 -13
- package/lib/commands/media-projection.js +62 -11
- package/lib/commands/memory.js +4 -4
- package/lib/commands/network.js +14 -10
- package/lib/commands/nfc.js +2 -3
- package/lib/commands/performance.js +3 -4
- package/lib/commands/permissions.js +33 -14
- package/lib/commands/{shell.js → shell.ts} +8 -11
- package/lib/commands/streamscreen.js +39 -15
- package/lib/commands/system-bars.js +7 -9
- package/lib/commands/time.js +3 -3
- package/lib/commands/types.ts +0 -646
- package/lib/driver.ts +4 -16
- package/lib/execute-method-map.ts +464 -0
- package/package.json +2 -2
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeMethodMap = void 0;
|
|
4
|
+
const INTENT_PARAMS = [
|
|
5
|
+
'user',
|
|
6
|
+
'intent',
|
|
7
|
+
'action',
|
|
8
|
+
'package',
|
|
9
|
+
'uri',
|
|
10
|
+
'mimeType',
|
|
11
|
+
'identifier',
|
|
12
|
+
'component',
|
|
13
|
+
'categories',
|
|
14
|
+
'extras',
|
|
15
|
+
'flags',
|
|
16
|
+
];
|
|
17
|
+
exports.executeMethodMap = {
|
|
18
|
+
'mobile: shell': {
|
|
19
|
+
command: 'mobileShell',
|
|
20
|
+
params: {
|
|
21
|
+
required: ['command'],
|
|
22
|
+
optional: ['args', 'timeout', 'includeStderr'],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
'mobile: execEmuConsoleCommand': {
|
|
26
|
+
command: 'mobileExecEmuConsoleCommand',
|
|
27
|
+
params: {
|
|
28
|
+
required: ['command'],
|
|
29
|
+
optional: ['execTimeout', 'connTimeout', 'initTimeout'],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
'mobile: startLogsBroadcast': {
|
|
33
|
+
command: 'mobileStartLogsBroadcast',
|
|
34
|
+
},
|
|
35
|
+
'mobile: stopLogsBroadcast': {
|
|
36
|
+
command: 'mobileStopLogsBroadcast',
|
|
37
|
+
},
|
|
38
|
+
'mobile: changePermissions': {
|
|
39
|
+
command: 'mobileChangePermissions',
|
|
40
|
+
params: {
|
|
41
|
+
required: ['permissions'],
|
|
42
|
+
optional: ['appPackage', 'action', 'target'],
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
'mobile: getPermissions': {
|
|
46
|
+
command: 'mobileGetPermissions',
|
|
47
|
+
params: {
|
|
48
|
+
optional: ['type', 'appPackage'],
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
'mobile: performEditorAction': {
|
|
52
|
+
command: 'mobilePerformEditorAction',
|
|
53
|
+
params: {
|
|
54
|
+
required: ['action'],
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
'mobile: getDeviceTime': {
|
|
58
|
+
command: 'mobileGetDeviceTime',
|
|
59
|
+
params: {
|
|
60
|
+
optional: ['format'],
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
'mobile: startScreenStreaming': {
|
|
64
|
+
command: 'mobileStartScreenStreaming',
|
|
65
|
+
params: {
|
|
66
|
+
optional: [
|
|
67
|
+
'width',
|
|
68
|
+
'height',
|
|
69
|
+
'bitRate',
|
|
70
|
+
'host',
|
|
71
|
+
'port',
|
|
72
|
+
'pathname',
|
|
73
|
+
'tcpPort',
|
|
74
|
+
'quality',
|
|
75
|
+
'considerRotation',
|
|
76
|
+
'logPipelineDetails',
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
'mobile: stopScreenStreaming': {
|
|
81
|
+
command: 'mobileStopScreenStreaming',
|
|
82
|
+
},
|
|
83
|
+
'mobile: getNotifications': {
|
|
84
|
+
command: 'mobileGetNotifications',
|
|
85
|
+
},
|
|
86
|
+
'mobile: listSms': {
|
|
87
|
+
command: 'mobileListSms',
|
|
88
|
+
},
|
|
89
|
+
'mobile: pushFile': {
|
|
90
|
+
command: 'pushFile',
|
|
91
|
+
params: {
|
|
92
|
+
required: ['remotePath', 'payload'],
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
'mobile: pullFolder': {
|
|
96
|
+
command: 'pullFolder',
|
|
97
|
+
params: {
|
|
98
|
+
required: ['remotePath'],
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
'mobile: pullFile': {
|
|
102
|
+
command: 'pullFile',
|
|
103
|
+
params: {
|
|
104
|
+
required: ['remotePath'],
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
'mobile: deleteFile': {
|
|
108
|
+
command: 'mobileDeleteFile',
|
|
109
|
+
params: {
|
|
110
|
+
required: ['remotePath'],
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
'mobile: isAppInstalled': {
|
|
114
|
+
command: 'mobileIsAppInstalled',
|
|
115
|
+
params: {
|
|
116
|
+
required: ['appId'],
|
|
117
|
+
optional: ['user'],
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
'mobile: queryAppState': {
|
|
121
|
+
command: 'queryAppState',
|
|
122
|
+
params: {
|
|
123
|
+
required: ['appId'],
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
'mobile: activateApp': {
|
|
127
|
+
command: 'activateApp',
|
|
128
|
+
params: {
|
|
129
|
+
required: ['appId'],
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
'mobile: removeApp': {
|
|
133
|
+
command: 'mobileRemoveApp',
|
|
134
|
+
params: {
|
|
135
|
+
required: ['appId'],
|
|
136
|
+
optional: ['timeout', 'keepData', 'skipInstallCheck'],
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
'mobile: terminateApp': {
|
|
140
|
+
command: 'mobileTerminateApp',
|
|
141
|
+
params: {
|
|
142
|
+
required: ['appId'],
|
|
143
|
+
optional: ['timeout'],
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
'mobile: installApp': {
|
|
147
|
+
command: 'mobileInstallApp',
|
|
148
|
+
params: {
|
|
149
|
+
required: ['appPath'],
|
|
150
|
+
optional: [
|
|
151
|
+
'checkVersion',
|
|
152
|
+
'timeout',
|
|
153
|
+
'allowTestPackages',
|
|
154
|
+
'useSdcard',
|
|
155
|
+
'grantPermissions',
|
|
156
|
+
'replace',
|
|
157
|
+
'noIncremental',
|
|
158
|
+
],
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
'mobile: clearApp': {
|
|
162
|
+
command: 'mobileClearApp',
|
|
163
|
+
params: {
|
|
164
|
+
required: ['appId'],
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
'mobile: startService': {
|
|
168
|
+
command: 'mobileStartService',
|
|
169
|
+
params: {
|
|
170
|
+
optional: [
|
|
171
|
+
'foreground',
|
|
172
|
+
...INTENT_PARAMS,
|
|
173
|
+
],
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
'mobile: stopService': {
|
|
177
|
+
command: 'mobileStopService',
|
|
178
|
+
params: {
|
|
179
|
+
optional: [
|
|
180
|
+
...INTENT_PARAMS,
|
|
181
|
+
],
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
'mobile: startActivity': {
|
|
185
|
+
command: 'mobileStartActivity',
|
|
186
|
+
params: {
|
|
187
|
+
optional: [
|
|
188
|
+
'wait',
|
|
189
|
+
'stop',
|
|
190
|
+
'windowingMode',
|
|
191
|
+
'activityType',
|
|
192
|
+
'display',
|
|
193
|
+
...INTENT_PARAMS,
|
|
194
|
+
],
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
'mobile: broadcast': {
|
|
198
|
+
command: 'mobileBroadcast',
|
|
199
|
+
params: {
|
|
200
|
+
optional: [
|
|
201
|
+
'receiverPermission',
|
|
202
|
+
'allowBackgroundActivityStarts',
|
|
203
|
+
...INTENT_PARAMS,
|
|
204
|
+
],
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
'mobile: getContexts': {
|
|
208
|
+
command: 'mobileGetContexts',
|
|
209
|
+
params: {
|
|
210
|
+
optional: [
|
|
211
|
+
'waitForWebviewMs',
|
|
212
|
+
],
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
'mobile: lock': {
|
|
216
|
+
command: 'lock',
|
|
217
|
+
params: {
|
|
218
|
+
optional: [
|
|
219
|
+
'seconds',
|
|
220
|
+
],
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
'mobile: unlock': {
|
|
224
|
+
command: 'mobileUnlock',
|
|
225
|
+
params: {
|
|
226
|
+
optional: [
|
|
227
|
+
'key',
|
|
228
|
+
'type',
|
|
229
|
+
'strategy',
|
|
230
|
+
'timeoutMs',
|
|
231
|
+
],
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
'mobile: isLocked': {
|
|
235
|
+
command: 'isLocked',
|
|
236
|
+
},
|
|
237
|
+
'mobile: refreshGpsCache': {
|
|
238
|
+
command: 'mobileRefreshGpsCache',
|
|
239
|
+
params: {
|
|
240
|
+
optional: [
|
|
241
|
+
'timeoutMs',
|
|
242
|
+
],
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
'mobile: startMediaProjectionRecording': {
|
|
246
|
+
command: 'mobileStartMediaProjectionRecording',
|
|
247
|
+
params: {
|
|
248
|
+
optional: [
|
|
249
|
+
'resolution',
|
|
250
|
+
'priority',
|
|
251
|
+
'maxDurationSec',
|
|
252
|
+
'filename',
|
|
253
|
+
],
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
'mobile: isMediaProjectionRecordingRunning': {
|
|
257
|
+
command: 'mobileIsMediaProjectionRecordingRunning',
|
|
258
|
+
},
|
|
259
|
+
'mobile: stopMediaProjectionRecording': {
|
|
260
|
+
command: 'mobileStopMediaProjectionRecording',
|
|
261
|
+
params: {
|
|
262
|
+
optional: [
|
|
263
|
+
'remotePath',
|
|
264
|
+
'user',
|
|
265
|
+
'pass',
|
|
266
|
+
'method',
|
|
267
|
+
'headers',
|
|
268
|
+
'fileFieldName',
|
|
269
|
+
'formFields',
|
|
270
|
+
'uploadTimeout',
|
|
271
|
+
],
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
'mobile: getConnectivity': {
|
|
275
|
+
command: 'mobileGetConnectivity',
|
|
276
|
+
params: {
|
|
277
|
+
optional: ['services'],
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
'mobile: setConnectivity': {
|
|
281
|
+
command: 'mobileSetConnectivity',
|
|
282
|
+
params: {
|
|
283
|
+
optional: ['wifi', 'data', 'airplaneMode'],
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
'mobile: hideKeyboard': {
|
|
287
|
+
command: 'hideKeyboard',
|
|
288
|
+
},
|
|
289
|
+
'mobile: isKeyboardShown': {
|
|
290
|
+
command: 'isKeyboardShown',
|
|
291
|
+
},
|
|
292
|
+
'mobile: deviceidle': {
|
|
293
|
+
command: 'mobileDeviceidle',
|
|
294
|
+
params: {
|
|
295
|
+
required: ['action'],
|
|
296
|
+
optional: ['packages'],
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
'mobile: bluetooth': {
|
|
300
|
+
command: 'mobileBluetooth',
|
|
301
|
+
params: {
|
|
302
|
+
required: ['action'],
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
'mobile: nfc': {
|
|
306
|
+
command: 'mobileNfc',
|
|
307
|
+
params: {
|
|
308
|
+
required: ['action'],
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
'mobile: setUiMode': {
|
|
312
|
+
command: 'mobileSetUiMode',
|
|
313
|
+
params: {
|
|
314
|
+
required: ['mode', 'value'],
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
'mobile: getUiMode': {
|
|
318
|
+
command: 'mobileGetUiMode',
|
|
319
|
+
params: {
|
|
320
|
+
required: ['mode'],
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
'mobile: injectEmulatorCameraImage': {
|
|
324
|
+
command: 'mobileInjectEmulatorCameraImage',
|
|
325
|
+
params: {
|
|
326
|
+
required: ['payload'],
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
'mobile: sendTrimMemory': {
|
|
330
|
+
command: 'mobileSendTrimMemory',
|
|
331
|
+
params: {
|
|
332
|
+
required: ['pkg', 'level'],
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
'mobile: getPerformanceData': {
|
|
336
|
+
command: 'mobileGetPerformanceData',
|
|
337
|
+
params: {
|
|
338
|
+
required: ['packageName', 'dataType'],
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
'mobile: getPerformanceDataTypes': {
|
|
342
|
+
command: 'getPerformanceDataTypes',
|
|
343
|
+
},
|
|
344
|
+
'mobile: toggleGps': {
|
|
345
|
+
command: 'toggleLocationServices',
|
|
346
|
+
},
|
|
347
|
+
'mobile: isGpsEnabled': {
|
|
348
|
+
command: 'isLocationServicesEnabled',
|
|
349
|
+
},
|
|
350
|
+
'mobile: getDisplayDensity': {
|
|
351
|
+
command: 'getDisplayDensity',
|
|
352
|
+
},
|
|
353
|
+
'mobile: getSystemBars': {
|
|
354
|
+
command: 'getSystemBars',
|
|
355
|
+
},
|
|
356
|
+
'mobile: statusBar': {
|
|
357
|
+
command: 'mobilePerformStatusBarCommand',
|
|
358
|
+
params: {
|
|
359
|
+
required: ['command'],
|
|
360
|
+
optional: ['component'],
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
'mobile: fingerprint': {
|
|
364
|
+
command: 'mobileFingerprint',
|
|
365
|
+
params: {
|
|
366
|
+
required: ['fingerprintId'],
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
'mobile: sendSms': {
|
|
370
|
+
command: 'mobileSendSms',
|
|
371
|
+
params: {
|
|
372
|
+
required: ['phoneNumber', 'message'],
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
'mobile: gsmCall': {
|
|
376
|
+
command: 'mobileGsmCall',
|
|
377
|
+
params: {
|
|
378
|
+
required: ['phoneNumber', 'action'],
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
'mobile: gsmSignal': {
|
|
382
|
+
command: 'mobileGsmSignal',
|
|
383
|
+
params: {
|
|
384
|
+
required: ['strength'],
|
|
385
|
+
}
|
|
386
|
+
},
|
|
387
|
+
'mobile: gsmVoice': {
|
|
388
|
+
command: 'mobileGsmVoice',
|
|
389
|
+
params: {
|
|
390
|
+
required: ['state'],
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
'mobile: powerAc': {
|
|
394
|
+
command: 'mobilePowerAc',
|
|
395
|
+
params: {
|
|
396
|
+
required: ['state'],
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
'mobile: powerCapacity': {
|
|
400
|
+
command: 'mobilePowerCapacity',
|
|
401
|
+
params: {
|
|
402
|
+
required: ['percent'],
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
'mobile: networkSpeed': {
|
|
406
|
+
command: 'mobileNetworkSpeed',
|
|
407
|
+
params: {
|
|
408
|
+
required: ['speed'],
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
'mobile: sensorSet': {
|
|
412
|
+
command: 'sensorSet',
|
|
413
|
+
params: {
|
|
414
|
+
required: ['sensorType', 'value'],
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
'mobile: getCurrentActivity': {
|
|
418
|
+
command: 'getCurrentActivity',
|
|
419
|
+
},
|
|
420
|
+
'mobile: getCurrentPackage': {
|
|
421
|
+
command: 'getCurrentPackage',
|
|
422
|
+
},
|
|
423
|
+
'mobile: setGeolocation': {
|
|
424
|
+
command: 'mobileSetGeolocation',
|
|
425
|
+
params: {
|
|
426
|
+
required: ['latitude', 'longitude'],
|
|
427
|
+
optional: ['altitude'],
|
|
428
|
+
}
|
|
429
|
+
},
|
|
430
|
+
'mobile: getGeolocation': {
|
|
431
|
+
command: 'mobileGetGeolocation',
|
|
432
|
+
},
|
|
433
|
+
'mobile: resetGeolocation': {
|
|
434
|
+
command: 'mobileResetGeolocation',
|
|
435
|
+
},
|
|
436
|
+
};
|
|
437
|
+
//# sourceMappingURL=execute-method-map.js.map
|
|
@@ -0,0 +1 @@
|
|
|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B;KAC9B;IACD,2BAA2B,EAAE;QAC3B,OAAO,EAAE,mBAAmB;KAC7B;IAED,wBAAwB,EAAE;QACxB,OAAO,EAAE,sBAAsB;QAC/B,MAAM,EAAE;YACN,QAAQ,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC;YACnC,QAAQ,EAAE,CAAC,UAAU,CAAC;SACvB;KACF;IACD,wBAAwB,EAAE;QACxB,OAAO,EAAE,sBAAsB;KAChC;IACD,0BAA0B,EAAE;QAC1B,OAAO,EAAE,wBAAwB;KAClC;CACuC,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {util} from '@appium/support';
|
|
2
2
|
import {waitForCondition, longSleep} from 'asyncbox';
|
|
3
3
|
import _ from 'lodash';
|
|
4
|
-
import {requireArgs} from '../utils';
|
|
5
4
|
import {EOL} from 'node:os';
|
|
6
5
|
import B from 'bluebird';
|
|
7
6
|
|
|
@@ -33,11 +32,12 @@ export async function isAppInstalled(appId, opts = {}) {
|
|
|
33
32
|
|
|
34
33
|
/**
|
|
35
34
|
* @this {AndroidDriver}
|
|
36
|
-
* @param {
|
|
35
|
+
* @param {string} appId Application package identifier
|
|
36
|
+
* @param {string | number} [user] The user ID for which the package is installed.
|
|
37
|
+
* The `current` user id is used by default.
|
|
37
38
|
* @returns {Promise<boolean>}
|
|
38
39
|
*/
|
|
39
|
-
export async function mobileIsAppInstalled(
|
|
40
|
-
const {appId, user} = requireArgs('appId', opts);
|
|
40
|
+
export async function mobileIsAppInstalled(appId, user) {
|
|
41
41
|
const _opts = {};
|
|
42
42
|
if (util.hasValue(user)) {
|
|
43
43
|
_opts.user = `${user}`;
|
|
@@ -47,7 +47,7 @@ export async function mobileIsAppInstalled(opts) {
|
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* @this {AndroidDriver}
|
|
50
|
-
* @param {string} appId
|
|
50
|
+
* @param {string} appId Application package identifier
|
|
51
51
|
* @returns {Promise<import('./types').AppState>}
|
|
52
52
|
*/
|
|
53
53
|
export async function queryAppState(appId) {
|
|
@@ -69,33 +69,13 @@ export async function queryAppState(appId) {
|
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
71
|
* @this {AndroidDriver}
|
|
72
|
-
* @param {
|
|
73
|
-
* @returns {Promise<import('./types').AppState>}
|
|
74
|
-
*/
|
|
75
|
-
export async function mobileQueryAppState(opts) {
|
|
76
|
-
const {appId} = requireArgs('appId', opts);
|
|
77
|
-
return await this.queryAppState(appId);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* @this {AndroidDriver}
|
|
82
|
-
* @param {string} appId
|
|
72
|
+
* @param {string} appId Application package identifier
|
|
83
73
|
* @returns {Promise<void>}
|
|
84
74
|
*/
|
|
85
75
|
export async function activateApp(appId) {
|
|
86
76
|
return await this.adb.activateApp(appId);
|
|
87
77
|
}
|
|
88
78
|
|
|
89
|
-
/**
|
|
90
|
-
* @this {AndroidDriver}
|
|
91
|
-
* @param {import('./types').ActivateAppOpts} opts
|
|
92
|
-
* @returns {Promise<void>}
|
|
93
|
-
*/
|
|
94
|
-
export async function mobileActivateApp(opts) {
|
|
95
|
-
const {appId} = requireArgs('appId', opts);
|
|
96
|
-
return await this.adb.activateApp(appId);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
79
|
/**
|
|
100
80
|
* @this {AndroidDriver}
|
|
101
81
|
* @param {string} appId
|
|
@@ -108,18 +88,27 @@ export async function removeApp(appId, opts = {}) {
|
|
|
108
88
|
|
|
109
89
|
/**
|
|
110
90
|
* @this {import('../driver').AndroidDriver}
|
|
111
|
-
* @param {
|
|
91
|
+
* @param {string} appId Application package identifier
|
|
92
|
+
* @param {number} [timeout] The count of milliseconds to wait until the
|
|
93
|
+
* app is uninstalled.
|
|
94
|
+
* @param {boolean} [keepData] Set to true in order to keep the
|
|
95
|
+
* application data and cache folders after uninstall.
|
|
96
|
+
* @param {boolean} [skipInstallCheck] Whether to check if the app is installed prior to
|
|
97
|
+
* uninstalling it. By default this is checked.
|
|
112
98
|
* @returns {Promise<boolean>}
|
|
113
99
|
*/
|
|
114
|
-
export async function mobileRemoveApp(
|
|
115
|
-
|
|
116
|
-
|
|
100
|
+
export async function mobileRemoveApp(appId, timeout, keepData, skipInstallCheck) {
|
|
101
|
+
return await this.removeApp(appId, {
|
|
102
|
+
timeout,
|
|
103
|
+
keepData,
|
|
104
|
+
skipInstallCheck,
|
|
105
|
+
});
|
|
117
106
|
}
|
|
118
107
|
|
|
119
108
|
/**
|
|
120
109
|
* @this {AndroidDriver}
|
|
121
110
|
* @param {string} appId
|
|
122
|
-
* @param {
|
|
111
|
+
* @param {import('./types').TerminateAppOpts} [options={}]
|
|
123
112
|
* @returns {Promise<boolean>}
|
|
124
113
|
*/
|
|
125
114
|
export async function terminateApp(appId, options = {}) {
|
|
@@ -180,12 +169,15 @@ export async function terminateApp(appId, options = {}) {
|
|
|
180
169
|
|
|
181
170
|
/**
|
|
182
171
|
* @this {AndroidDriver}
|
|
183
|
-
* @param {
|
|
172
|
+
* @param {string} appId Application package identifier
|
|
173
|
+
* @param {number|string} [timeout] The count of milliseconds to wait until the app is terminated.
|
|
174
|
+
* 500ms by default.
|
|
184
175
|
* @returns {Promise<boolean>}
|
|
185
176
|
*/
|
|
186
|
-
export async function mobileTerminateApp(
|
|
187
|
-
|
|
188
|
-
|
|
177
|
+
export async function mobileTerminateApp(appId, timeout) {
|
|
178
|
+
return await this.terminateApp(appId, {
|
|
179
|
+
timeout,
|
|
180
|
+
});
|
|
189
181
|
}
|
|
190
182
|
|
|
191
183
|
/**
|
|
@@ -201,14 +193,49 @@ export async function installApp(appPath, opts) {
|
|
|
201
193
|
|
|
202
194
|
/**
|
|
203
195
|
* @this {AndroidDriver}
|
|
204
|
-
* @param {
|
|
196
|
+
* @param {string} appPath
|
|
197
|
+
* @param {boolean} [checkVersion]
|
|
198
|
+
* @param {number} [timeout] The count of milliseconds to wait until the app is installed.
|
|
199
|
+
* 20000ms by default.
|
|
200
|
+
* @param {boolean} [allowTestPackages] Set to true in order to allow test packages installation.
|
|
201
|
+
* `false` by default.
|
|
202
|
+
* @param {boolean} [useSdcard] Set to true to install the app on sdcard instead of the device memory.
|
|
203
|
+
* `false` by default.
|
|
204
|
+
* @param {boolean} [grantPermissions] Set to true in order to grant all the
|
|
205
|
+
* permissions requested in the application's manifest automatically after the installation is completed
|
|
206
|
+
* under Android 6+. `false` by default.
|
|
207
|
+
* @param {boolean} [replace] Set it to false if you don't want the application to be upgraded/reinstalled
|
|
208
|
+
* if it is already present on the device. `true` by default.
|
|
209
|
+
* @param {boolean} [noIncremental] Forcefully disables incremental installs if set to `true`.
|
|
210
|
+
* Read https://developer.android.com/preview/features#incremental for more details.
|
|
211
|
+
* `false` by default.
|
|
205
212
|
* @returns {Promise<void>}
|
|
206
213
|
*/
|
|
207
|
-
export async function mobileInstallApp(
|
|
208
|
-
|
|
214
|
+
export async function mobileInstallApp(
|
|
215
|
+
appPath,
|
|
216
|
+
checkVersion,
|
|
217
|
+
timeout,
|
|
218
|
+
allowTestPackages,
|
|
219
|
+
useSdcard,
|
|
220
|
+
grantPermissions,
|
|
221
|
+
replace,
|
|
222
|
+
noIncremental,
|
|
223
|
+
) {
|
|
224
|
+
const opts = {
|
|
225
|
+
timeout,
|
|
226
|
+
allowTestPackages,
|
|
227
|
+
useSdcard,
|
|
228
|
+
grantPermissions,
|
|
229
|
+
replace,
|
|
230
|
+
noIncremental,
|
|
231
|
+
};
|
|
209
232
|
if (checkVersion) {
|
|
210
233
|
const localPath = await this.helpers.configureApp(appPath, APP_EXTENSIONS);
|
|
211
|
-
await this.adb.installOrUpgrade(localPath, null, Object.assign({},
|
|
234
|
+
await this.adb.installOrUpgrade(localPath, null, Object.assign({}, {
|
|
235
|
+
appPath,
|
|
236
|
+
checkVersion,
|
|
237
|
+
...opts,
|
|
238
|
+
}, {enforceCurrentBuild: false}));
|
|
212
239
|
return;
|
|
213
240
|
}
|
|
214
241
|
|
|
@@ -217,11 +244,10 @@ export async function mobileInstallApp(opts) {
|
|
|
217
244
|
|
|
218
245
|
/**
|
|
219
246
|
* @this {AndroidDriver}
|
|
220
|
-
* @param {
|
|
247
|
+
* @param {string} appId Application package identifier
|
|
221
248
|
* @returns {Promise<void>}
|
|
222
249
|
*/
|
|
223
|
-
export async function mobileClearApp(
|
|
224
|
-
const {appId} = requireArgs('appId', opts);
|
|
250
|
+
export async function mobileClearApp(appId) {
|
|
225
251
|
await this.adb.clear(appId);
|
|
226
252
|
}
|
|
227
253
|
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import {requireArgs} from '../utils';
|
|
2
|
-
|
|
3
1
|
const RESPONSE_PATTERN = /:\s+(\w+)/;
|
|
4
2
|
|
|
5
3
|
/**
|
|
@@ -7,11 +5,15 @@ const RESPONSE_PATTERN = /:\s+(\w+)/;
|
|
|
7
5
|
*
|
|
8
6
|
* @since Android 10
|
|
9
7
|
* @this {import('../driver').AndroidDriver}
|
|
10
|
-
* @
|
|
8
|
+
* @param {string} mode The UI mode to set the value for.
|
|
9
|
+
* Supported values are: 'night' and 'car'
|
|
10
|
+
* @param {string} value The actual mode value to set.
|
|
11
|
+
* Supported value for different UI modes are:
|
|
12
|
+
* - night: yes|no|auto|custom_schedule|custom_bedtime
|
|
13
|
+
* - car: yes|no
|
|
11
14
|
* @returns {Promise<void>}
|
|
12
15
|
*/
|
|
13
|
-
export async function mobileSetUiMode(
|
|
14
|
-
const {mode, value} = requireArgs(['mode', 'value'], opts);
|
|
16
|
+
export async function mobileSetUiMode(mode, value) {
|
|
15
17
|
await this.adb.shell(['cmd', 'uimode', mode, value]);
|
|
16
18
|
}
|
|
17
19
|
|
|
@@ -20,12 +22,12 @@ export async function mobileSetUiMode(opts) {
|
|
|
20
22
|
*
|
|
21
23
|
* @since Android 10
|
|
22
24
|
* @this {import('../driver').AndroidDriver}
|
|
23
|
-
* @
|
|
25
|
+
* @param {string} mode The UI mode to set the value for.
|
|
26
|
+
* Supported values are: 'night' and 'car'
|
|
24
27
|
* @returns {Promise<string>} The actual state for the queried UI mode,
|
|
25
28
|
* for example 'yes' or 'no'
|
|
26
29
|
*/
|
|
27
|
-
export async function mobileGetUiMode(
|
|
28
|
-
const {mode} = requireArgs(['mode'], opts);
|
|
30
|
+
export async function mobileGetUiMode(mode) {
|
|
29
31
|
const response = await this.adb.shell(['cmd', 'uimode', mode]);
|
|
30
32
|
// response looks like 'Night mode: no'
|
|
31
33
|
const match = RESPONSE_PATTERN.exec(response);
|
|
@@ -11,13 +11,12 @@ const SUPPORTED_ACTIONS = /** @type {const} */ ({
|
|
|
11
11
|
* Performs the requested action on the default bluetooth adapter
|
|
12
12
|
*
|
|
13
13
|
* @this {AndroidDriver}
|
|
14
|
-
* @param {
|
|
14
|
+
* @param {'enable' | 'disable' | 'unpairAll'} action
|
|
15
15
|
* @returns {Promise<void>}
|
|
16
16
|
* @throws {Error} if the device under test has no default bluetooth adapter
|
|
17
17
|
* or there was a failure while performing the action.
|
|
18
18
|
*/
|
|
19
|
-
export async function mobileBluetooth(
|
|
20
|
-
const {action} = opts;
|
|
19
|
+
export async function mobileBluetooth(action) {
|
|
21
20
|
switch (action) {
|
|
22
21
|
case SUPPORTED_ACTIONS.ENABLE:
|
|
23
22
|
await this.settingsApp.setBluetoothState(true);
|