appium-android-driver 15.0.0-beta.2 → 15.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 +38 -8
- package/build/lib/commands/app-management.d.ts +26 -0
- package/build/lib/commands/app-management.d.ts.map +1 -1
- package/build/lib/commands/app-management.js +4 -3
- package/build/lib/commands/app-management.js.map +1 -1
- package/build/lib/commands/appearance.d.ts +7 -0
- package/build/lib/commands/appearance.d.ts.map +1 -1
- package/build/lib/commands/appearance.js.map +1 -1
- package/build/lib/commands/bluetooth.d.ts +6 -0
- package/build/lib/commands/bluetooth.d.ts.map +1 -1
- package/build/lib/commands/bluetooth.js +1 -1
- package/build/lib/commands/bluetooth.js.map +1 -1
- package/build/lib/commands/context/exports.d.ts +25 -0
- package/build/lib/commands/context/exports.d.ts.map +1 -1
- package/build/lib/commands/context/exports.js +10 -6
- package/build/lib/commands/context/exports.js.map +1 -1
- package/build/lib/commands/device/common.d.ts +9 -0
- package/build/lib/commands/device/common.d.ts.map +1 -1
- package/build/lib/commands/device/common.js +1 -1
- package/build/lib/commands/device/common.js.map +1 -1
- package/build/lib/commands/device/emulator-actions.d.ts +22 -0
- package/build/lib/commands/device/emulator-actions.d.ts.map +1 -1
- package/build/lib/commands/device/emulator-actions.js.map +1 -1
- package/build/lib/commands/device/emulator-console.d.ts +6 -0
- package/build/lib/commands/device/emulator-console.d.ts.map +1 -1
- package/build/lib/commands/device/emulator-console.js.map +1 -1
- package/build/lib/commands/device/utils.js +3 -3
- package/build/lib/commands/device/utils.js.map +1 -1
- package/build/lib/commands/deviceidle.d.ts +6 -0
- package/build/lib/commands/deviceidle.d.ts.map +1 -1
- package/build/lib/commands/deviceidle.js +1 -1
- package/build/lib/commands/deviceidle.js.map +1 -1
- package/build/lib/commands/element.d.ts +20 -0
- package/build/lib/commands/element.d.ts.map +1 -1
- package/build/lib/commands/element.js +0 -1
- package/build/lib/commands/element.js.map +1 -1
- package/build/lib/commands/execute.d.ts +6 -0
- package/build/lib/commands/execute.d.ts.map +1 -1
- package/build/lib/commands/execute.js.map +1 -1
- package/build/lib/commands/file-actions.d.ts +9 -0
- package/build/lib/commands/file-actions.d.ts.map +1 -1
- package/build/lib/commands/file-actions.js.map +1 -1
- package/build/lib/commands/find.d.ts +8 -0
- package/build/lib/commands/find.d.ts.map +1 -1
- package/build/lib/commands/find.js.map +1 -1
- package/build/lib/commands/geolocation.d.ts +13 -0
- package/build/lib/commands/geolocation.d.ts.map +1 -1
- package/build/lib/commands/geolocation.js +2 -2
- package/build/lib/commands/geolocation.js.map +1 -1
- package/build/lib/commands/gestures.d.ts +6 -0
- package/build/lib/commands/gestures.d.ts.map +1 -1
- package/build/lib/commands/gestures.js.map +1 -1
- package/build/lib/commands/image-injection.d.ts +6 -0
- package/build/lib/commands/image-injection.d.ts.map +1 -1
- package/build/lib/commands/image-injection.js.map +1 -1
- package/build/lib/commands/ime.d.ts +11 -0
- package/build/lib/commands/ime.d.ts.map +1 -1
- package/build/lib/commands/ime.js.map +1 -1
- package/build/lib/commands/intent.d.ts +10 -0
- package/build/lib/commands/intent.d.ts.map +1 -1
- package/build/lib/commands/intent.js +4 -4
- package/build/lib/commands/intent.js.map +1 -1
- package/build/lib/commands/keyboard.d.ts +12 -0
- package/build/lib/commands/keyboard.d.ts.map +1 -1
- package/build/lib/commands/keyboard.js.map +1 -1
- package/build/lib/commands/legacy.d.ts +8 -0
- package/build/lib/commands/legacy.d.ts.map +1 -1
- package/build/lib/commands/legacy.js.map +1 -1
- package/build/lib/commands/lock/exports.d.ts +9 -0
- package/build/lib/commands/lock/exports.d.ts.map +1 -1
- package/build/lib/commands/lock/exports.js.map +1 -1
- package/build/lib/commands/lock/helpers.js +1 -1
- package/build/lib/commands/lock/helpers.js.map +1 -1
- package/build/lib/commands/log.d.ts +8 -13
- package/build/lib/commands/log.d.ts.map +1 -1
- package/build/lib/commands/log.js +4 -32
- package/build/lib/commands/log.js.map +1 -1
- package/build/lib/commands/media-projection.d.ts +8 -0
- package/build/lib/commands/media-projection.d.ts.map +1 -1
- package/build/lib/commands/media-projection.js.map +1 -1
- package/build/lib/commands/memory.d.ts +6 -0
- package/build/lib/commands/memory.d.ts.map +1 -1
- package/build/lib/commands/memory.js.map +1 -1
- package/build/lib/commands/misc.d.ts +12 -0
- package/build/lib/commands/misc.d.ts.map +1 -1
- package/build/lib/commands/misc.js.map +1 -1
- package/build/lib/commands/network.d.ts +15 -0
- package/build/lib/commands/network.d.ts.map +1 -1
- package/build/lib/commands/network.js +2 -2
- package/build/lib/commands/network.js.map +1 -1
- package/build/lib/commands/nfc.d.ts +6 -0
- package/build/lib/commands/nfc.d.ts.map +1 -1
- package/build/lib/commands/nfc.js +1 -1
- package/build/lib/commands/nfc.js.map +1 -1
- package/build/lib/commands/performance.d.ts +8 -0
- package/build/lib/commands/performance.d.ts.map +1 -1
- package/build/lib/commands/performance.js.map +1 -1
- package/build/lib/commands/permissions.d.ts +7 -0
- package/build/lib/commands/permissions.d.ts.map +1 -1
- package/build/lib/commands/permissions.js +3 -3
- package/build/lib/commands/permissions.js.map +1 -1
- package/build/lib/commands/recordscreen.d.ts +7 -0
- package/build/lib/commands/recordscreen.d.ts.map +1 -1
- package/build/lib/commands/recordscreen.js.map +1 -1
- package/build/lib/commands/resources.d.ts +7 -0
- package/build/lib/commands/resources.d.ts.map +1 -1
- package/build/lib/commands/resources.js +1 -1
- package/build/lib/commands/resources.js.map +1 -1
- package/build/lib/commands/shell.d.ts +9 -0
- package/build/lib/commands/shell.d.ts.map +1 -1
- package/build/lib/commands/shell.js.map +1 -1
- package/build/lib/commands/streamscreen.d.ts +7 -0
- package/build/lib/commands/streamscreen.d.ts.map +1 -1
- package/build/lib/commands/streamscreen.js.map +1 -1
- package/build/lib/commands/system-bars.d.ts +7 -0
- package/build/lib/commands/system-bars.d.ts.map +1 -1
- package/build/lib/commands/system-bars.js +2 -2
- package/build/lib/commands/system-bars.js.map +1 -1
- package/build/lib/commands/time.d.ts +7 -0
- package/build/lib/commands/time.d.ts.map +1 -1
- package/build/lib/commands/time.js.map +1 -1
- package/build/lib/constraints.d.ts +16 -3
- package/build/lib/constraints.d.ts.map +1 -1
- package/build/lib/constraints.js +16 -3
- package/build/lib/constraints.js.map +1 -1
- package/build/lib/driver.d.ts +36 -201
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +253 -168
- package/build/lib/driver.js.map +1 -1
- package/build/lib/utils.js +1 -1
- package/build/lib/utils.js.map +1 -1
- package/lib/commands/app-management.ts +33 -3
- package/lib/commands/appearance.ts +8 -0
- package/lib/commands/bluetooth.ts +8 -1
- package/lib/commands/context/exports.ts +46 -6
- package/lib/commands/device/common.ts +11 -1
- package/lib/commands/device/emulator-actions.ts +23 -0
- package/lib/commands/device/emulator-console.ts +9 -0
- package/lib/commands/device/utils.ts +3 -3
- package/lib/commands/deviceidle.ts +8 -1
- package/lib/commands/element.ts +21 -0
- package/lib/commands/execute.ts +7 -0
- package/lib/commands/file-actions.ts +10 -0
- package/lib/commands/find.ts +9 -0
- package/lib/commands/geolocation.ts +22 -2
- package/lib/commands/gestures.ts +7 -0
- package/lib/commands/image-injection.ts +9 -0
- package/lib/commands/ime.ts +12 -0
- package/lib/commands/intent.ts +25 -4
- package/lib/commands/keyboard.ts +15 -0
- package/lib/commands/legacy.ts +9 -0
- package/lib/commands/lock/exports.ts +10 -0
- package/lib/commands/lock/helpers.ts +1 -1
- package/lib/commands/log.ts +20 -35
- package/lib/commands/media-projection.ts +15 -0
- package/lib/commands/memory.ts +7 -0
- package/lib/commands/misc.ts +15 -0
- package/lib/commands/network.ts +18 -2
- package/lib/commands/nfc.ts +8 -1
- package/lib/commands/performance.ts +13 -0
- package/lib/commands/permissions.ts +15 -3
- package/lib/commands/recordscreen.ts +8 -0
- package/lib/commands/resources.ts +9 -1
- package/lib/commands/shell.ts +12 -0
- package/lib/commands/streamscreen.ts +12 -0
- package/lib/commands/system-bars.ts +12 -2
- package/lib/commands/time.ts +8 -0
- package/lib/constraints.ts +16 -3
- package/lib/driver.ts +289 -212
- package/lib/utils.ts +1 -1
- package/package.json +1 -1
package/lib/driver.ts
CHANGED
|
@@ -13,6 +13,7 @@ import {BaseDriver} from 'appium/driver.js';
|
|
|
13
13
|
import {SettingsApp} from 'io.appium.settings';
|
|
14
14
|
import {LRUCache} from 'lru-cache';
|
|
15
15
|
|
|
16
|
+
// oxlint-disable import/no-duplicates -- see the bare imports below
|
|
16
17
|
import {
|
|
17
18
|
getThirdPartyPackages,
|
|
18
19
|
uninstallOtherPackages,
|
|
@@ -145,8 +146,6 @@ import {
|
|
|
145
146
|
supportedLogTypes,
|
|
146
147
|
mobileStartLogsBroadcast,
|
|
147
148
|
mobileStopLogsBroadcast,
|
|
148
|
-
getLogTypes,
|
|
149
|
-
getLog,
|
|
150
149
|
assignBiDiLogListener,
|
|
151
150
|
} from './commands/log.js';
|
|
152
151
|
import {
|
|
@@ -191,6 +190,43 @@ import type {AndroidDriverConstraints} from './constraints.js';
|
|
|
191
190
|
import {executeMethodMap} from './execute-method-map.js';
|
|
192
191
|
import {newMethodMap} from './method-map.js';
|
|
193
192
|
import {parseArray, removeAllSessionWebSocketHandlers} from './utils.js';
|
|
193
|
+
// Bare imports make sure `declare module` augmentations in the command modules
|
|
194
|
+
// reach the emitted `driver.d.ts` import graph of downstream drivers.
|
|
195
|
+
import './commands/app-management.js';
|
|
196
|
+
import './commands/appearance.js';
|
|
197
|
+
import './commands/bluetooth.js';
|
|
198
|
+
import './commands/context/exports.js';
|
|
199
|
+
import './commands/device/common.js';
|
|
200
|
+
import './commands/device/emulator-actions.js';
|
|
201
|
+
import './commands/device/emulator-console.js';
|
|
202
|
+
import './commands/deviceidle.js';
|
|
203
|
+
import './commands/element.js';
|
|
204
|
+
import './commands/execute.js';
|
|
205
|
+
import './commands/file-actions.js';
|
|
206
|
+
import './commands/find.js';
|
|
207
|
+
import './commands/geolocation.js';
|
|
208
|
+
import './commands/gestures.js';
|
|
209
|
+
import './commands/image-injection.js';
|
|
210
|
+
import './commands/ime.js';
|
|
211
|
+
import './commands/intent.js';
|
|
212
|
+
import './commands/keyboard.js';
|
|
213
|
+
import './commands/legacy.js';
|
|
214
|
+
import './commands/lock/exports.js';
|
|
215
|
+
import './commands/log.js';
|
|
216
|
+
import './commands/media-projection.js';
|
|
217
|
+
import './commands/memory.js';
|
|
218
|
+
import './commands/misc.js';
|
|
219
|
+
import './commands/network.js';
|
|
220
|
+
import './commands/nfc.js';
|
|
221
|
+
import './commands/performance.js';
|
|
222
|
+
import './commands/permissions.js';
|
|
223
|
+
import './commands/recordscreen.js';
|
|
224
|
+
import './commands/resources.js';
|
|
225
|
+
import './commands/shell.js';
|
|
226
|
+
import './commands/streamscreen.js';
|
|
227
|
+
import './commands/system-bars.js';
|
|
228
|
+
import './commands/time.js';
|
|
229
|
+
// oxlint-enable import/no-duplicates
|
|
194
230
|
|
|
195
231
|
export type AndroidDriverCaps = DriverCaps<AndroidDriverConstraints>;
|
|
196
232
|
export type W3CAndroidDriverCaps = W3CDriverCaps<AndroidDriverConstraints>;
|
|
@@ -231,217 +267,7 @@ class AndroidDriver<C extends AndroidDriverConstraints = AndroidDriverConstraint
|
|
|
231
267
|
});
|
|
232
268
|
opts: DriverOpts<C>;
|
|
233
269
|
|
|
234
|
-
getContexts = getContexts;
|
|
235
|
-
getCurrentContext = getCurrentContext;
|
|
236
|
-
defaultContextName = defaultContextName;
|
|
237
|
-
assignContexts = assignContexts;
|
|
238
|
-
switchContext = switchContext;
|
|
239
|
-
defaultWebviewName = defaultWebviewName;
|
|
240
|
-
isChromedriverContext = isChromedriverContext;
|
|
241
|
-
startChromedriverProxy = startChromedriverProxy;
|
|
242
|
-
stopChromedriverProxies = stopChromedriverProxies;
|
|
243
|
-
suspendChromedriverProxy = suspendChromedriverProxy;
|
|
244
|
-
startChromeSession = startChromeSession;
|
|
245
|
-
onChromedriverStop = onChromedriverStop;
|
|
246
|
-
isWebContext = isWebContext;
|
|
247
|
-
mobileGetContexts = mobileGetContexts;
|
|
248
|
-
mobileGetChromeCapabilities = mobileGetChromeCapabilities;
|
|
249
|
-
setContext = setContext as any as (this: AndroidDriver, name?: string) => Promise<void>;
|
|
250
|
-
setWindow = setWindow;
|
|
251
|
-
getWindowHandle = getWindowHandle;
|
|
252
|
-
getWindowHandles = getWindowHandles;
|
|
253
|
-
notifyBiDiContextChange = notifyBiDiContextChange;
|
|
254
|
-
|
|
255
|
-
getDeviceInfoFromCaps = getDeviceInfoFromCaps;
|
|
256
|
-
createADB = createADB;
|
|
257
|
-
getLaunchInfo = getLaunchInfo;
|
|
258
|
-
initDevice = initDevice;
|
|
259
|
-
|
|
260
|
-
fingerprint = fingerprint;
|
|
261
|
-
mobileFingerprint = mobileFingerprint;
|
|
262
|
-
sendSMS = sendSMS;
|
|
263
|
-
mobileSendSms = mobileSendSms;
|
|
264
|
-
gsmCall = gsmCall;
|
|
265
|
-
mobileGsmCall = mobileGsmCall;
|
|
266
|
-
gsmSignal = gsmSignal;
|
|
267
|
-
mobileGsmSignal = mobileGsmSignal;
|
|
268
|
-
gsmVoice = gsmVoice;
|
|
269
|
-
mobileGsmVoice = mobileGsmVoice;
|
|
270
|
-
powerAC = powerAC;
|
|
271
|
-
mobilePowerAc = mobilePowerAc;
|
|
272
|
-
powerCapacity = powerCapacity;
|
|
273
|
-
mobilePowerCapacity = mobilePowerCapacity;
|
|
274
|
-
networkSpeed = networkSpeed;
|
|
275
|
-
mobileNetworkSpeed = mobileNetworkSpeed;
|
|
276
|
-
sensorSet = sensorSet;
|
|
277
|
-
|
|
278
|
-
mobileExecEmuConsoleCommand = mobileExecEmuConsoleCommand;
|
|
279
|
-
|
|
280
|
-
getThirdPartyPackages = getThirdPartyPackages;
|
|
281
|
-
uninstallOtherPackages = uninstallOtherPackages;
|
|
282
|
-
installOtherApks = installOtherApks;
|
|
283
|
-
installAUT = installAUT;
|
|
284
|
-
resetAUT = resetAUT;
|
|
285
|
-
background = background;
|
|
286
|
-
getCurrentActivity = getCurrentActivity;
|
|
287
|
-
getCurrentPackage = getCurrentPackage;
|
|
288
|
-
mobileClearApp = mobileClearApp;
|
|
289
|
-
mobileInstallApp = mobileInstallApp;
|
|
290
|
-
installApp = installApp;
|
|
291
|
-
mobileIsAppInstalled = mobileIsAppInstalled;
|
|
292
|
-
mobileRemoveApp = mobileRemoveApp;
|
|
293
|
-
mobileTerminateApp = mobileTerminateApp;
|
|
294
|
-
mobileListApps = mobileListApps;
|
|
295
|
-
terminateApp = terminateApp;
|
|
296
|
-
removeApp = removeApp;
|
|
297
|
-
activateApp = activateApp;
|
|
298
|
-
queryAppState = queryAppState;
|
|
299
|
-
isAppInstalled = isAppInstalled;
|
|
300
|
-
mobileBackgroundApp = mobileBackgroundApp;
|
|
301
|
-
|
|
302
|
-
mobileGetUiMode = mobileGetUiMode;
|
|
303
|
-
mobileSetUiMode = mobileSetUiMode;
|
|
304
|
-
|
|
305
|
-
mobileDeviceidle = mobileDeviceidle;
|
|
306
|
-
|
|
307
|
-
mobileBluetooth = mobileBluetooth;
|
|
308
|
-
|
|
309
|
-
getAttribute = getAttribute;
|
|
310
|
-
getName = getName;
|
|
311
|
-
elementDisplayed = elementDisplayed;
|
|
312
|
-
elementEnabled = elementEnabled;
|
|
313
|
-
elementSelected = elementSelected;
|
|
314
|
-
setElementValue = setElementValue;
|
|
315
|
-
doSetElementValue = doSetElementValue;
|
|
316
|
-
replaceValue = replaceValue;
|
|
317
|
-
setValueImmediate = setValueImmediate;
|
|
318
|
-
setValue = setValue;
|
|
319
|
-
click = click;
|
|
320
|
-
getLocationInView = getLocationInView;
|
|
321
|
-
getText = getText;
|
|
322
|
-
getLocation = getLocation;
|
|
323
|
-
getSize = getSize;
|
|
324
|
-
|
|
325
|
-
execute = execute;
|
|
326
|
-
|
|
327
|
-
pullFile = pullFile;
|
|
328
|
-
pullFolder = pullFolder;
|
|
329
|
-
pushFile = pushFile;
|
|
330
|
-
mobileDeleteFile = mobileDeleteFile;
|
|
331
|
-
|
|
332
|
-
findElOrEls = findElOrEls;
|
|
333
|
-
doFindElementOrEls = doFindElementOrEls;
|
|
334
|
-
|
|
335
|
-
setGeoLocation = setGeoLocation;
|
|
336
|
-
getGeoLocation = getGeoLocation;
|
|
337
|
-
mobileRefreshGpsCache = mobileRefreshGpsCache;
|
|
338
|
-
toggleLocationServices = toggleLocationServices;
|
|
339
|
-
isLocationServicesEnabled = isLocationServicesEnabled;
|
|
340
|
-
mobileGetGeolocation = mobileGetGeolocation;
|
|
341
|
-
mobileSetGeolocation = mobileSetGeolocation;
|
|
342
|
-
mobileResetGeolocation = mobileResetGeolocation;
|
|
343
|
-
|
|
344
|
-
performActions = performActions;
|
|
345
|
-
|
|
346
|
-
isIMEActivated = isIMEActivated;
|
|
347
|
-
availableIMEEngines = availableIMEEngines;
|
|
348
|
-
getActiveIMEEngine = getActiveIMEEngine;
|
|
349
|
-
activateIMEEngine = activateIMEEngine;
|
|
350
|
-
deactivateIMEEngine = deactivateIMEEngine;
|
|
351
|
-
setStylusHandwriting = setStylusHandwriting;
|
|
352
|
-
|
|
353
|
-
startActivity = startActivity as unknown as (
|
|
354
|
-
appPackage: string,
|
|
355
|
-
appActivity: string,
|
|
356
|
-
appWaitPackage?: string,
|
|
357
|
-
appWaitActivity?: string,
|
|
358
|
-
intentAction?: string,
|
|
359
|
-
intentCategory?: string,
|
|
360
|
-
intentFlags?: string,
|
|
361
|
-
optionalIntentArguments?: string,
|
|
362
|
-
dontStopAppOnReset?: boolean,
|
|
363
|
-
) => Promise<void>;
|
|
364
|
-
mobileStartActivity = mobileStartActivity;
|
|
365
|
-
mobileBroadcast = mobileBroadcast;
|
|
366
|
-
mobileStartService = mobileStartService;
|
|
367
|
-
mobileStopService = mobileStopService;
|
|
368
|
-
|
|
369
|
-
hideKeyboard = hideKeyboard;
|
|
370
|
-
isKeyboardShown = isKeyboardShown;
|
|
371
|
-
keys = keys;
|
|
372
|
-
doSendKeys = doSendKeys;
|
|
373
|
-
pressKeyCode = pressKeyCode;
|
|
374
|
-
longPressKeyCode = longPressKeyCode;
|
|
375
|
-
mobilePerformEditorAction = mobilePerformEditorAction;
|
|
376
|
-
|
|
377
|
-
lock = lock;
|
|
378
|
-
unlock = unlock;
|
|
379
|
-
mobileUnlock = mobileUnlock;
|
|
380
|
-
isLocked = isLocked;
|
|
381
|
-
|
|
382
270
|
supportedLogTypes = supportedLogTypes;
|
|
383
|
-
mobileStartLogsBroadcast = mobileStartLogsBroadcast;
|
|
384
|
-
mobileStopLogsBroadcast = mobileStopLogsBroadcast;
|
|
385
|
-
getLogTypes = getLogTypes;
|
|
386
|
-
getLog = getLog;
|
|
387
|
-
assignBiDiLogListener = assignBiDiLogListener;
|
|
388
|
-
|
|
389
|
-
mobileIsMediaProjectionRecordingRunning = mobileIsMediaProjectionRecordingRunning;
|
|
390
|
-
mobileStartMediaProjectionRecording = mobileStartMediaProjectionRecording;
|
|
391
|
-
mobileStopMediaProjectionRecording = mobileStopMediaProjectionRecording;
|
|
392
|
-
|
|
393
|
-
mobileSendTrimMemory = mobileSendTrimMemory;
|
|
394
|
-
|
|
395
|
-
mobileInjectEmulatorCameraImage = mobileInjectEmulatorCameraImage;
|
|
396
|
-
|
|
397
|
-
getWindowRect = getWindowRect;
|
|
398
|
-
getWindowSize = getWindowSize;
|
|
399
|
-
getDisplayDensity = getDisplayDensity;
|
|
400
|
-
mobileGetNotifications = mobileGetNotifications;
|
|
401
|
-
mobileListSms = mobileListSms;
|
|
402
|
-
openNotifications = openNotifications;
|
|
403
|
-
setUrl = setUrl;
|
|
404
|
-
|
|
405
|
-
getNetworkConnection = getNetworkConnection;
|
|
406
|
-
isWifiOn = isWifiOn;
|
|
407
|
-
mobileGetConnectivity = mobileGetConnectivity;
|
|
408
|
-
mobileSetConnectivity = mobileSetConnectivity;
|
|
409
|
-
setNetworkConnection = setNetworkConnection;
|
|
410
|
-
setWifiState = setWifiState;
|
|
411
|
-
setDataState = setDataState;
|
|
412
|
-
toggleData = toggleData;
|
|
413
|
-
toggleFlightMode = toggleFlightMode;
|
|
414
|
-
toggleWiFi = toggleWiFi;
|
|
415
|
-
|
|
416
|
-
getPerformanceData = getPerformanceData;
|
|
417
|
-
getPerformanceDataTypes = getPerformanceDataTypes;
|
|
418
|
-
mobileGetPerformanceData = mobileGetPerformanceData;
|
|
419
|
-
|
|
420
|
-
mobileChangePermissions = mobileChangePermissions;
|
|
421
|
-
mobileGetPermissions = mobileGetPermissions;
|
|
422
|
-
|
|
423
|
-
startRecordingScreen = startRecordingScreen;
|
|
424
|
-
stopRecordingScreen = stopRecordingScreen;
|
|
425
|
-
|
|
426
|
-
getStrings = getStrings;
|
|
427
|
-
ensureDeviceLocale = ensureDeviceLocale;
|
|
428
|
-
|
|
429
|
-
mobileShell = mobileShell;
|
|
430
|
-
|
|
431
|
-
mobileNfc = mobileNfc;
|
|
432
|
-
|
|
433
|
-
mobileStartScreenStreaming = mobileStartScreenStreaming;
|
|
434
|
-
mobileStopScreenStreaming = mobileStopScreenStreaming;
|
|
435
|
-
|
|
436
|
-
getSystemBars = getSystemBars;
|
|
437
|
-
mobilePerformStatusBarCommand = mobilePerformStatusBarCommand;
|
|
438
|
-
|
|
439
|
-
getDeviceTime = getDeviceTime;
|
|
440
|
-
mobileGetDeviceTime = mobileGetDeviceTime;
|
|
441
|
-
|
|
442
|
-
reset = reset;
|
|
443
|
-
closeApp = closeApp;
|
|
444
|
-
launchApp = launchApp;
|
|
445
271
|
|
|
446
272
|
constructor(opts: InitialOpts = {} as InitialOpts, shouldValidateCaps = true) {
|
|
447
273
|
super(opts, shouldValidateCaps);
|
|
@@ -506,6 +332,22 @@ class AndroidDriver<C extends AndroidDriverConstraints = AndroidDriverConstraint
|
|
|
506
332
|
return true;
|
|
507
333
|
}
|
|
508
334
|
|
|
335
|
+
override async getLogTypes(): Promise<string[]> {
|
|
336
|
+
const nativeLogTypes = await super.getLogTypes();
|
|
337
|
+
if (this.isWebContext() && this.chromedriver) {
|
|
338
|
+
const webLogTypes = (await this.chromedriver.jwproxy.command('/log/types', 'GET')) as string[];
|
|
339
|
+
return [...nativeLogTypes, ...webLogTypes];
|
|
340
|
+
}
|
|
341
|
+
return nativeLogTypes;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
override async getLog(logType: string): Promise<any> {
|
|
345
|
+
if (this.isWebContext() && this.chromedriver && !Object.keys(this.supportedLogTypes).includes(logType)) {
|
|
346
|
+
return await this.chromedriver.jwproxy.command('/log', 'POST', {type: logType});
|
|
347
|
+
}
|
|
348
|
+
return await super.getLog(logType);
|
|
349
|
+
}
|
|
350
|
+
|
|
509
351
|
override async deleteSession(sessionId?: string | null) {
|
|
510
352
|
await removeAllSessionWebSocketHandlers.bind(this)();
|
|
511
353
|
|
|
@@ -524,4 +366,239 @@ class AndroidDriver<C extends AndroidDriverConstraints = AndroidDriverConstraint
|
|
|
524
366
|
}
|
|
525
367
|
}
|
|
526
368
|
|
|
369
|
+
Object.assign(AndroidDriver.prototype, {
|
|
370
|
+
// app-management
|
|
371
|
+
getThirdPartyPackages,
|
|
372
|
+
uninstallOtherPackages,
|
|
373
|
+
installOtherApks,
|
|
374
|
+
installAUT,
|
|
375
|
+
resetAUT,
|
|
376
|
+
background,
|
|
377
|
+
getCurrentActivity,
|
|
378
|
+
getCurrentPackage,
|
|
379
|
+
mobileClearApp,
|
|
380
|
+
mobileInstallApp,
|
|
381
|
+
installApp,
|
|
382
|
+
mobileIsAppInstalled,
|
|
383
|
+
mobileRemoveApp,
|
|
384
|
+
mobileTerminateApp,
|
|
385
|
+
mobileListApps,
|
|
386
|
+
terminateApp,
|
|
387
|
+
removeApp,
|
|
388
|
+
activateApp,
|
|
389
|
+
queryAppState,
|
|
390
|
+
isAppInstalled,
|
|
391
|
+
mobileBackgroundApp,
|
|
392
|
+
|
|
393
|
+
// appearance
|
|
394
|
+
mobileGetUiMode,
|
|
395
|
+
mobileSetUiMode,
|
|
396
|
+
|
|
397
|
+
// bluetooth
|
|
398
|
+
mobileBluetooth,
|
|
399
|
+
|
|
400
|
+
// context/exports
|
|
401
|
+
getContexts,
|
|
402
|
+
getCurrentContext,
|
|
403
|
+
defaultContextName,
|
|
404
|
+
assignContexts,
|
|
405
|
+
switchContext,
|
|
406
|
+
defaultWebviewName,
|
|
407
|
+
isChromedriverContext,
|
|
408
|
+
startChromedriverProxy,
|
|
409
|
+
stopChromedriverProxies,
|
|
410
|
+
suspendChromedriverProxy,
|
|
411
|
+
startChromeSession,
|
|
412
|
+
onChromedriverStop,
|
|
413
|
+
isWebContext,
|
|
414
|
+
mobileGetContexts,
|
|
415
|
+
mobileGetChromeCapabilities,
|
|
416
|
+
setContext,
|
|
417
|
+
setWindow,
|
|
418
|
+
getWindowHandle,
|
|
419
|
+
getWindowHandles,
|
|
420
|
+
notifyBiDiContextChange,
|
|
421
|
+
|
|
422
|
+
// device/common
|
|
423
|
+
getDeviceInfoFromCaps,
|
|
424
|
+
createADB,
|
|
425
|
+
getLaunchInfo,
|
|
426
|
+
initDevice,
|
|
427
|
+
|
|
428
|
+
// device/emulator-actions
|
|
429
|
+
fingerprint,
|
|
430
|
+
mobileFingerprint,
|
|
431
|
+
sendSMS,
|
|
432
|
+
mobileSendSms,
|
|
433
|
+
gsmCall,
|
|
434
|
+
mobileGsmCall,
|
|
435
|
+
gsmSignal,
|
|
436
|
+
mobileGsmSignal,
|
|
437
|
+
gsmVoice,
|
|
438
|
+
mobileGsmVoice,
|
|
439
|
+
powerAC,
|
|
440
|
+
mobilePowerAc,
|
|
441
|
+
powerCapacity,
|
|
442
|
+
mobilePowerCapacity,
|
|
443
|
+
networkSpeed,
|
|
444
|
+
mobileNetworkSpeed,
|
|
445
|
+
sensorSet,
|
|
446
|
+
|
|
447
|
+
// device/emulator-console
|
|
448
|
+
mobileExecEmuConsoleCommand,
|
|
449
|
+
|
|
450
|
+
// deviceidle
|
|
451
|
+
mobileDeviceidle,
|
|
452
|
+
|
|
453
|
+
// element
|
|
454
|
+
getAttribute,
|
|
455
|
+
getName,
|
|
456
|
+
elementDisplayed,
|
|
457
|
+
elementEnabled,
|
|
458
|
+
elementSelected,
|
|
459
|
+
setElementValue,
|
|
460
|
+
doSetElementValue,
|
|
461
|
+
replaceValue,
|
|
462
|
+
setValueImmediate,
|
|
463
|
+
setValue,
|
|
464
|
+
click,
|
|
465
|
+
getLocationInView,
|
|
466
|
+
getText,
|
|
467
|
+
getLocation,
|
|
468
|
+
getSize,
|
|
469
|
+
|
|
470
|
+
// execute
|
|
471
|
+
execute,
|
|
472
|
+
|
|
473
|
+
// file-actions
|
|
474
|
+
pullFile,
|
|
475
|
+
pullFolder,
|
|
476
|
+
pushFile,
|
|
477
|
+
mobileDeleteFile,
|
|
478
|
+
|
|
479
|
+
// find
|
|
480
|
+
findElOrEls,
|
|
481
|
+
doFindElementOrEls,
|
|
482
|
+
|
|
483
|
+
// geolocation
|
|
484
|
+
setGeoLocation,
|
|
485
|
+
getGeoLocation,
|
|
486
|
+
mobileRefreshGpsCache,
|
|
487
|
+
toggleLocationServices,
|
|
488
|
+
isLocationServicesEnabled,
|
|
489
|
+
mobileGetGeolocation,
|
|
490
|
+
mobileSetGeolocation,
|
|
491
|
+
mobileResetGeolocation,
|
|
492
|
+
|
|
493
|
+
// gestures
|
|
494
|
+
performActions,
|
|
495
|
+
|
|
496
|
+
// image-injection
|
|
497
|
+
mobileInjectEmulatorCameraImage,
|
|
498
|
+
|
|
499
|
+
// ime
|
|
500
|
+
isIMEActivated,
|
|
501
|
+
availableIMEEngines,
|
|
502
|
+
getActiveIMEEngine,
|
|
503
|
+
activateIMEEngine,
|
|
504
|
+
deactivateIMEEngine,
|
|
505
|
+
setStylusHandwriting,
|
|
506
|
+
|
|
507
|
+
// intent
|
|
508
|
+
startActivity,
|
|
509
|
+
mobileStartActivity,
|
|
510
|
+
mobileBroadcast,
|
|
511
|
+
mobileStartService,
|
|
512
|
+
mobileStopService,
|
|
513
|
+
|
|
514
|
+
// keyboard
|
|
515
|
+
hideKeyboard,
|
|
516
|
+
isKeyboardShown,
|
|
517
|
+
keys,
|
|
518
|
+
doSendKeys,
|
|
519
|
+
pressKeyCode,
|
|
520
|
+
longPressKeyCode,
|
|
521
|
+
mobilePerformEditorAction,
|
|
522
|
+
|
|
523
|
+
// legacy
|
|
524
|
+
reset,
|
|
525
|
+
closeApp,
|
|
526
|
+
launchApp,
|
|
527
|
+
|
|
528
|
+
// lock/exports
|
|
529
|
+
lock,
|
|
530
|
+
unlock,
|
|
531
|
+
mobileUnlock,
|
|
532
|
+
isLocked,
|
|
533
|
+
|
|
534
|
+
// log
|
|
535
|
+
mobileStartLogsBroadcast,
|
|
536
|
+
mobileStopLogsBroadcast,
|
|
537
|
+
assignBiDiLogListener,
|
|
538
|
+
|
|
539
|
+
// media-projection
|
|
540
|
+
mobileIsMediaProjectionRecordingRunning,
|
|
541
|
+
mobileStartMediaProjectionRecording,
|
|
542
|
+
mobileStopMediaProjectionRecording,
|
|
543
|
+
|
|
544
|
+
// memory
|
|
545
|
+
mobileSendTrimMemory,
|
|
546
|
+
|
|
547
|
+
// misc
|
|
548
|
+
getWindowRect,
|
|
549
|
+
getWindowSize,
|
|
550
|
+
getDisplayDensity,
|
|
551
|
+
mobileGetNotifications,
|
|
552
|
+
mobileListSms,
|
|
553
|
+
openNotifications,
|
|
554
|
+
setUrl,
|
|
555
|
+
|
|
556
|
+
// network
|
|
557
|
+
getNetworkConnection,
|
|
558
|
+
isWifiOn,
|
|
559
|
+
mobileGetConnectivity,
|
|
560
|
+
mobileSetConnectivity,
|
|
561
|
+
setNetworkConnection,
|
|
562
|
+
setWifiState,
|
|
563
|
+
setDataState,
|
|
564
|
+
toggleData,
|
|
565
|
+
toggleFlightMode,
|
|
566
|
+
toggleWiFi,
|
|
567
|
+
|
|
568
|
+
// nfc
|
|
569
|
+
mobileNfc,
|
|
570
|
+
|
|
571
|
+
// performance
|
|
572
|
+
getPerformanceData,
|
|
573
|
+
getPerformanceDataTypes,
|
|
574
|
+
mobileGetPerformanceData,
|
|
575
|
+
|
|
576
|
+
// permissions
|
|
577
|
+
mobileChangePermissions,
|
|
578
|
+
mobileGetPermissions,
|
|
579
|
+
|
|
580
|
+
// recordscreen
|
|
581
|
+
startRecordingScreen,
|
|
582
|
+
stopRecordingScreen,
|
|
583
|
+
|
|
584
|
+
// resources
|
|
585
|
+
getStrings,
|
|
586
|
+
ensureDeviceLocale,
|
|
587
|
+
|
|
588
|
+
// shell
|
|
589
|
+
mobileShell,
|
|
590
|
+
|
|
591
|
+
// streamscreen
|
|
592
|
+
mobileStartScreenStreaming,
|
|
593
|
+
mobileStopScreenStreaming,
|
|
594
|
+
|
|
595
|
+
// system-bars
|
|
596
|
+
getSystemBars,
|
|
597
|
+
mobilePerformStatusBarCommand,
|
|
598
|
+
|
|
599
|
+
// time
|
|
600
|
+
getDeviceTime,
|
|
601
|
+
mobileGetDeviceTime,
|
|
602
|
+
});
|
|
603
|
+
|
|
527
604
|
export {AndroidDriver};
|
package/lib/utils.ts
CHANGED
|
@@ -53,7 +53,7 @@ export function parseArray(cap: string | string[]): string[] {
|
|
|
53
53
|
return [cap];
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
throw new Error(`must provide a string or JSON Array; received ${cap}`);
|
|
56
|
+
throw new Error(`must provide a string or JSON Array; received ${String(cap)}`);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/**
|