appium-android-driver 7.8.3 → 8.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 +25 -0
- package/build/lib/commands/app-management.d.ts +129 -5
- package/build/lib/commands/app-management.d.ts.map +1 -1
- package/build/lib/commands/app-management.js +433 -128
- package/build/lib/commands/app-management.js.map +1 -1
- package/build/lib/commands/appearance.d.ts +17 -4
- package/build/lib/commands/appearance.d.ts.map +1 -1
- package/build/lib/commands/appearance.js +32 -33
- package/build/lib/commands/appearance.js.map +1 -1
- package/build/lib/commands/context/cache.d.ts +19 -0
- package/build/lib/commands/context/cache.d.ts.map +1 -0
- package/build/lib/commands/context/cache.js +32 -0
- package/build/lib/commands/context/cache.js.map +1 -0
- package/build/lib/commands/context/exports.d.ts +141 -0
- package/build/lib/commands/context/exports.d.ts.map +1 -0
- package/build/lib/commands/context/exports.js +351 -0
- package/build/lib/commands/context/exports.js.map +1 -0
- package/build/lib/commands/context/helpers.d.ts +98 -0
- package/build/lib/commands/context/helpers.d.ts.map +1 -0
- package/build/lib/commands/context/helpers.js +715 -0
- package/build/lib/commands/context/helpers.js.map +1 -0
- package/build/lib/commands/device/common.d.ts +23 -0
- package/build/lib/commands/device/common.d.ts.map +1 -0
- package/build/lib/commands/device/common.js +230 -0
- package/build/lib/commands/device/common.js.map +1 -0
- package/build/lib/commands/device/emulator-actions.d.ts +114 -0
- package/build/lib/commands/device/emulator-actions.d.ts.map +1 -0
- package/build/lib/commands/device/emulator-actions.js +197 -0
- package/build/lib/commands/device/emulator-actions.js.map +1 -0
- package/build/lib/commands/device/emulator-console.d.ts +7 -0
- package/build/lib/commands/device/emulator-console.d.ts.map +1 -0
- package/build/lib/commands/device/emulator-console.js +24 -0
- package/build/lib/commands/device/emulator-console.js.map +1 -0
- package/build/lib/commands/device/utils.d.ts +50 -0
- package/build/lib/commands/device/utils.d.ts.map +1 -0
- package/build/lib/commands/device/utils.js +238 -0
- package/build/lib/commands/device/utils.js.map +1 -0
- package/build/lib/commands/deviceidle.d.ts +8 -5
- package/build/lib/commands/deviceidle.d.ts.map +1 -1
- package/build/lib/commands/deviceidle.js +31 -37
- package/build/lib/commands/deviceidle.js.map +1 -1
- package/build/lib/commands/element.d.ts +99 -5
- package/build/lib/commands/element.d.ts.map +1 -1
- package/build/lib/commands/element.js +152 -116
- package/build/lib/commands/element.js.map +1 -1
- package/build/lib/commands/execute.d.ts +12 -4
- package/build/lib/commands/execute.d.ts.map +1 -1
- package/build/lib/commands/execute.js +83 -78
- package/build/lib/commands/execute.js.map +1 -1
- package/build/lib/commands/file-actions.d.ts +42 -5
- package/build/lib/commands/file-actions.d.ts.map +1 -1
- package/build/lib/commands/file-actions.js +230 -194
- package/build/lib/commands/file-actions.js.map +1 -1
- package/build/lib/commands/find.d.ts +5 -4
- package/build/lib/commands/find.d.ts.map +1 -1
- package/build/lib/commands/find.js +7 -10
- package/build/lib/commands/find.js.map +1 -1
- package/build/lib/commands/geolocation.d.ts +45 -0
- package/build/lib/commands/geolocation.d.ts.map +1 -0
- package/build/lib/commands/geolocation.js +182 -0
- package/build/lib/commands/geolocation.js.map +1 -0
- package/build/lib/commands/ime.d.ts +25 -5
- package/build/lib/commands/ime.d.ts.map +1 -1
- package/build/lib/commands/ime.js +59 -42
- package/build/lib/commands/ime.js.map +1 -1
- package/build/lib/commands/intent.d.ts +56 -5
- package/build/lib/commands/intent.d.ts.map +1 -1
- package/build/lib/commands/intent.js +135 -83
- package/build/lib/commands/intent.js.map +1 -1
- package/build/lib/commands/keyboard.d.ts +58 -4
- package/build/lib/commands/keyboard.d.ts.map +1 -1
- package/build/lib/commands/keyboard.js +119 -17
- package/build/lib/commands/keyboard.js.map +1 -1
- package/build/lib/commands/lock/exports.d.ts +301 -0
- package/build/lib/commands/lock/exports.d.ts.map +1 -0
- package/build/lib/commands/lock/exports.js +121 -0
- package/build/lib/commands/lock/exports.js.map +1 -0
- package/build/lib/commands/lock/helpers.d.ts +349 -0
- package/build/lib/commands/lock/helpers.d.ts.map +1 -0
- package/build/lib/commands/lock/helpers.js +375 -0
- package/build/lib/commands/lock/helpers.js.map +1 -0
- package/build/lib/commands/log.d.ts +59 -5
- package/build/lib/commands/log.d.ts.map +1 -1
- package/build/lib/commands/log.js +150 -140
- package/build/lib/commands/log.js.map +1 -1
- package/build/lib/commands/media-projection.d.ts +16 -5
- package/build/lib/commands/media-projection.d.ts.map +1 -1
- package/build/lib/commands/media-projection.js +69 -58
- package/build/lib/commands/media-projection.js.map +1 -1
- package/build/lib/commands/memory.d.ts +9 -5
- package/build/lib/commands/memory.d.ts.map +1 -1
- package/build/lib/commands/memory.js +19 -24
- package/build/lib/commands/memory.js.map +1 -1
- package/build/lib/commands/misc.d.ts +42 -0
- package/build/lib/commands/misc.d.ts.map +1 -0
- package/build/lib/commands/misc.js +100 -0
- package/build/lib/commands/misc.js.map +1 -0
- package/build/lib/commands/network.d.ts +61 -5
- package/build/lib/commands/network.d.ts.map +1 -1
- package/build/lib/commands/network.js +196 -189
- package/build/lib/commands/network.js.map +1 -1
- package/build/lib/commands/performance.d.ts +67 -27
- package/build/lib/commands/performance.d.ts.map +1 -1
- package/build/lib/commands/performance.js +105 -80
- package/build/lib/commands/performance.js.map +1 -1
- package/build/lib/commands/permissions.d.ts +12 -6
- package/build/lib/commands/permissions.d.ts.map +1 -1
- package/build/lib/commands/permissions.js +65 -62
- package/build/lib/commands/permissions.js.map +1 -1
- package/build/lib/commands/recordscreen.d.ts +44 -5
- package/build/lib/commands/recordscreen.d.ts.map +1 -1
- package/build/lib/commands/recordscreen.js +131 -126
- package/build/lib/commands/recordscreen.js.map +1 -1
- package/build/lib/commands/resources.d.ts +16 -0
- package/build/lib/commands/resources.d.ts.map +1 -0
- package/build/lib/commands/resources.js +91 -0
- package/build/lib/commands/resources.js.map +1 -0
- package/build/lib/commands/shell.d.ts +8 -5
- package/build/lib/commands/shell.d.ts.map +1 -1
- package/build/lib/commands/shell.js +29 -33
- package/build/lib/commands/shell.js.map +1 -1
- package/build/lib/commands/streamscreen.d.ts +34 -6
- package/build/lib/commands/streamscreen.d.ts.map +1 -1
- package/build/lib/commands/streamscreen.js +166 -162
- package/build/lib/commands/streamscreen.js.map +1 -1
- package/build/lib/commands/system-bars.d.ts +18 -13
- package/build/lib/commands/system-bars.d.ts.map +1 -1
- package/build/lib/commands/system-bars.js +68 -64
- package/build/lib/commands/system-bars.js.map +1 -1
- package/build/lib/commands/time.d.ts +14 -0
- package/build/lib/commands/time.d.ts.map +1 -0
- package/build/lib/commands/time.js +39 -0
- package/build/lib/commands/time.js.map +1 -0
- package/build/lib/commands/touch.d.ts +99 -6
- package/build/lib/commands/touch.d.ts.map +1 -1
- package/build/lib/commands/touch.js +399 -280
- package/build/lib/commands/touch.js.map +1 -1
- package/build/lib/commands/types.d.ts +110 -2
- package/build/lib/commands/types.d.ts.map +1 -1
- package/build/lib/doctor/checks.d.ts.map +1 -1
- package/build/lib/doctor/checks.js +4 -4
- package/build/lib/doctor/checks.js.map +1 -1
- package/build/lib/driver.d.ts +224 -27
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +232 -7
- package/build/lib/driver.js.map +1 -1
- package/build/lib/index.d.ts +1 -4
- package/build/lib/index.d.ts.map +1 -1
- package/build/lib/index.js +1 -13
- package/build/lib/index.js.map +1 -1
- package/build/lib/logger.js.map +1 -1
- package/build/lib/method-map.d.ts +0 -23
- package/build/lib/method-map.d.ts.map +1 -1
- package/build/lib/method-map.js +0 -11
- package/build/lib/method-map.js.map +1 -1
- package/build/lib/utils.d.ts +12 -0
- package/build/lib/utils.d.ts.map +1 -1
- package/build/lib/utils.js +38 -2
- package/build/lib/utils.js.map +1 -1
- package/lib/commands/app-management.js +470 -145
- package/lib/commands/appearance.js +29 -36
- package/lib/commands/context/cache.js +29 -0
- package/lib/commands/context/exports.js +379 -0
- package/lib/commands/context/helpers.js +802 -0
- package/lib/commands/device/common.js +264 -0
- package/lib/commands/device/emulator-actions.js +194 -0
- package/lib/commands/device/emulator-console.js +24 -0
- package/lib/commands/device/utils.js +285 -0
- package/lib/commands/deviceidle.js +31 -44
- package/lib/commands/element.js +149 -142
- package/lib/commands/execute.js +86 -87
- package/lib/commands/file-actions.js +249 -222
- package/lib/commands/find.ts +13 -19
- package/lib/commands/geolocation.js +179 -0
- package/lib/commands/ime.js +53 -45
- package/lib/commands/intent.js +149 -91
- package/lib/commands/keyboard.js +114 -17
- package/lib/commands/lock/exports.js +139 -0
- package/lib/commands/lock/helpers.js +379 -0
- package/lib/commands/log.js +170 -166
- package/lib/commands/media-projection.js +75 -70
- package/lib/commands/memory.js +17 -29
- package/lib/commands/misc.js +94 -0
- package/lib/commands/network.js +209 -223
- package/lib/commands/performance.js +88 -73
- package/lib/commands/permissions.js +83 -84
- package/lib/commands/recordscreen.js +171 -170
- package/lib/commands/resources.js +96 -0
- package/lib/commands/shell.js +28 -42
- package/lib/commands/streamscreen.js +207 -206
- package/lib/commands/system-bars.js +76 -77
- package/lib/commands/time.js +36 -0
- package/lib/commands/touch.js +442 -346
- package/lib/commands/types.ts +123 -2
- package/lib/doctor/checks.js +24 -16
- package/lib/driver.ts +454 -12
- package/lib/index.ts +1 -13
- package/lib/logger.js +1 -1
- package/lib/method-map.js +0 -11
- package/lib/utils.js +40 -3
- package/package.json +1 -1
- package/build/lib/commands/actions.d.ts +0 -8
- package/build/lib/commands/actions.d.ts.map +0 -1
- package/build/lib/commands/actions.js +0 -207
- package/build/lib/commands/actions.js.map +0 -1
- package/build/lib/commands/alert.d.ts +0 -8
- package/build/lib/commands/alert.d.ts.map +0 -1
- package/build/lib/commands/alert.js +0 -29
- package/build/lib/commands/alert.js.map +0 -1
- package/build/lib/commands/context.d.ts +0 -10
- package/build/lib/commands/context.d.ts.map +0 -1
- package/build/lib/commands/context.js +0 -431
- package/build/lib/commands/context.js.map +0 -1
- package/build/lib/commands/emu-console.d.ts +0 -7
- package/build/lib/commands/emu-console.d.ts.map +0 -1
- package/build/lib/commands/emu-console.js +0 -27
- package/build/lib/commands/emu-console.js.map +0 -1
- package/build/lib/commands/general.d.ts +0 -9
- package/build/lib/commands/general.d.ts.map +0 -1
- package/build/lib/commands/general.js +0 -293
- package/build/lib/commands/general.js.map +0 -1
- package/build/lib/commands/index.d.ts +0 -28
- package/build/lib/commands/index.d.ts.map +0 -1
- package/build/lib/commands/index.js +0 -57
- package/build/lib/commands/index.js.map +0 -1
- package/build/lib/commands/mixins.d.ts +0 -747
- package/build/lib/commands/mixins.d.ts.map +0 -1
- package/build/lib/commands/mixins.js +0 -19
- package/build/lib/commands/mixins.js.map +0 -1
- package/build/lib/helpers/android.d.ts +0 -163
- package/build/lib/helpers/android.d.ts.map +0 -1
- package/build/lib/helpers/android.js +0 -818
- package/build/lib/helpers/android.js.map +0 -1
- package/build/lib/helpers/index.d.ts +0 -7
- package/build/lib/helpers/index.d.ts.map +0 -1
- package/build/lib/helpers/index.js +0 -29
- package/build/lib/helpers/index.js.map +0 -1
- package/build/lib/helpers/types.d.ts +0 -122
- package/build/lib/helpers/types.d.ts.map +0 -1
- package/build/lib/helpers/types.js +0 -3
- package/build/lib/helpers/types.js.map +0 -1
- package/build/lib/helpers/unlock.d.ts +0 -32
- package/build/lib/helpers/unlock.d.ts.map +0 -1
- package/build/lib/helpers/unlock.js +0 -273
- package/build/lib/helpers/unlock.js.map +0 -1
- package/build/lib/helpers/webview.d.ts +0 -74
- package/build/lib/helpers/webview.d.ts.map +0 -1
- package/build/lib/helpers/webview.js +0 -448
- package/build/lib/helpers/webview.js.map +0 -1
- package/lib/commands/actions.js +0 -244
- package/lib/commands/alert.js +0 -34
- package/lib/commands/context.js +0 -507
- package/lib/commands/emu-console.js +0 -31
- package/lib/commands/general.js +0 -343
- package/lib/commands/index.ts +0 -54
- package/lib/commands/mixins.ts +0 -976
- package/lib/helpers/android.ts +0 -1153
- package/lib/helpers/index.ts +0 -6
- package/lib/helpers/types.ts +0 -136
- package/lib/helpers/unlock.ts +0 -329
- package/lib/helpers/webview.ts +0 -610
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.unlockWithOptions = exports.mobileUnlock = exports.unlock = exports.isLocked = exports.lock = exports.mobileLock = void 0;
|
|
7
|
+
const bluebird_1 = __importDefault(require("bluebird"));
|
|
8
|
+
const helpers_1 = require("./helpers");
|
|
9
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
10
|
+
/**
|
|
11
|
+
* @this {AndroidDriver}
|
|
12
|
+
* @param {import('../types').LockOpts} opts
|
|
13
|
+
* @returns {Promise<void>}
|
|
14
|
+
*/
|
|
15
|
+
async function mobileLock(opts = {}) {
|
|
16
|
+
const { seconds } = opts;
|
|
17
|
+
return await this.lock(seconds);
|
|
18
|
+
}
|
|
19
|
+
exports.mobileLock = mobileLock;
|
|
20
|
+
/**
|
|
21
|
+
* @this {AndroidDriver}
|
|
22
|
+
* @param {number} [seconds]
|
|
23
|
+
* @returns {Promise<void>}
|
|
24
|
+
*/
|
|
25
|
+
async function lock(seconds) {
|
|
26
|
+
await this.adb.lock();
|
|
27
|
+
if (Number.isNaN(seconds)) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const floatSeconds = parseFloat(String(seconds));
|
|
31
|
+
if (floatSeconds <= 0) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
await bluebird_1.default.delay(1000 * floatSeconds);
|
|
35
|
+
await this.unlock();
|
|
36
|
+
}
|
|
37
|
+
exports.lock = lock;
|
|
38
|
+
/**
|
|
39
|
+
* @this {AndroidDriver}
|
|
40
|
+
* @returns {Promise<boolean>}
|
|
41
|
+
*/
|
|
42
|
+
async function isLocked() {
|
|
43
|
+
return await this.adb.isScreenLocked();
|
|
44
|
+
}
|
|
45
|
+
exports.isLocked = isLocked;
|
|
46
|
+
/**
|
|
47
|
+
* @this {AndroidDriver}
|
|
48
|
+
* @returns {Promise<void>}
|
|
49
|
+
*/
|
|
50
|
+
async function unlock() {
|
|
51
|
+
await unlockWithOptions.bind(this)();
|
|
52
|
+
}
|
|
53
|
+
exports.unlock = unlock;
|
|
54
|
+
/**
|
|
55
|
+
* @this {AndroidDriver}
|
|
56
|
+
* @param {import('../types').UnlockOptions} [opts={}]
|
|
57
|
+
* @returns {Promise<void>}
|
|
58
|
+
*/
|
|
59
|
+
async function mobileUnlock(opts = {}) {
|
|
60
|
+
const { key, type, strategy, timeoutMs } = opts;
|
|
61
|
+
if (!key && !type) {
|
|
62
|
+
await this.unlock();
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
await unlockWithOptions.bind(this)({
|
|
66
|
+
unlockKey: key,
|
|
67
|
+
unlockType: type,
|
|
68
|
+
unlockStrategy: strategy,
|
|
69
|
+
unlockSuccessTimeout: timeoutMs,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.mobileUnlock = mobileUnlock;
|
|
74
|
+
// #region Internal Helpers
|
|
75
|
+
/**
|
|
76
|
+
* @this {AndroidDriver}
|
|
77
|
+
* @param {AndroidDriverCaps?} [caps=null]
|
|
78
|
+
* @returns {Promise<void>}
|
|
79
|
+
*/
|
|
80
|
+
async function unlockWithOptions(caps = null) {
|
|
81
|
+
if (!(await this.adb.isScreenLocked())) {
|
|
82
|
+
this.log.info('Screen already unlocked, doing nothing');
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const capabilities = caps ?? this.opts;
|
|
86
|
+
this.log.debug('Screen is locked, trying to unlock');
|
|
87
|
+
if (!capabilities.unlockType && !capabilities.unlockKey) {
|
|
88
|
+
this.log.info(`Neither 'unlockType' nor 'unlockKey' capability is provided. ` +
|
|
89
|
+
`Assuming the device is locked with a simple lock screen.`);
|
|
90
|
+
await this.adb.dismissKeyguard();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const { unlockType, unlockKey, unlockStrategy, unlockSuccessTimeout } = (0, helpers_1.validateUnlockCapabilities)(capabilities);
|
|
94
|
+
if (unlockKey &&
|
|
95
|
+
unlockType !== helpers_1.FINGERPRINT_UNLOCK &&
|
|
96
|
+
(lodash_1.default.isNil(unlockStrategy) || lodash_1.default.toLower(unlockStrategy) === 'locksettings') &&
|
|
97
|
+
(await this.adb.isLockManagementSupported())) {
|
|
98
|
+
await helpers_1.fastUnlock.bind(this)({
|
|
99
|
+
credential: unlockKey,
|
|
100
|
+
credentialType: (0, helpers_1.toCredentialType)(/** @type {import('../types').UnlockType} */ (unlockType)),
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
const unlockMethod = {
|
|
105
|
+
[helpers_1.PIN_UNLOCK]: helpers_1.pinUnlock,
|
|
106
|
+
[helpers_1.PIN_UNLOCK_KEY_EVENT]: helpers_1.pinUnlockWithKeyEvent,
|
|
107
|
+
[helpers_1.PASSWORD_UNLOCK]: helpers_1.passwordUnlock,
|
|
108
|
+
[helpers_1.PATTERN_UNLOCK]: helpers_1.patternUnlock,
|
|
109
|
+
[helpers_1.FINGERPRINT_UNLOCK]: helpers_1.fingerprintUnlock,
|
|
110
|
+
}[unlockType];
|
|
111
|
+
await unlockMethod.bind(this)(capabilities);
|
|
112
|
+
}
|
|
113
|
+
await helpers_1.verifyUnlock.bind(this)(unlockSuccessTimeout);
|
|
114
|
+
}
|
|
115
|
+
exports.unlockWithOptions = unlockWithOptions;
|
|
116
|
+
// #endregion
|
|
117
|
+
/**
|
|
118
|
+
* @typedef {import('@appium/types').Capabilities<import('../../constraints').AndroidDriverConstraints>} AndroidDriverCaps
|
|
119
|
+
* @typedef {import('../../driver').AndroidDriver} AndroidDriver
|
|
120
|
+
*/
|
|
121
|
+
//# sourceMappingURL=exports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exports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AC,4CAA4C,CAAC,CAAC,UAAU,CAAC,CAAC;SAC5F,CAAC,CAAC;KACJ;SAAM;QACL,MAAM,YAAY,GAAG;YACnB,CAAC,oBAAU,CAAC,EAAE,mBAAS;YACvB,CAAC,8BAAoB,CAAC,EAAE,+BAAqB;YAC7C,CAAC,yBAAe,CAAC,EAAE,wBAAc;YACjC,CAAC,wBAAc,CAAC,EAAE,uBAAa;YAC/B,CAAC,4BAAkB,CAAC,EAAE,2BAAiB;SACxC,CAAC,UAAU,CAAC,CAAC;QACd,MAAM,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC;KAC7C;IACD,MAAM,sBAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,oBAAoB,CAAC,CAAC;AACtD,CAAC;AAxCD,8CAwCC;AAED,aAAa;AAEb;;;GAGG"}
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {import('../types').UnlockType} unlockType
|
|
4
|
+
* @returns {string}
|
|
5
|
+
*/
|
|
6
|
+
export function toCredentialType(unlockType: import('../types').UnlockType): string;
|
|
7
|
+
/**
|
|
8
|
+
* @template {AndroidDriverCaps} T
|
|
9
|
+
* @param {T} caps
|
|
10
|
+
* @returns {T}
|
|
11
|
+
*/
|
|
12
|
+
export function validateUnlockCapabilities<T extends import("@appium/types").ConstraintsToCaps<{
|
|
13
|
+
readonly platformName: {
|
|
14
|
+
readonly isString: true;
|
|
15
|
+
readonly inclusionCaseInsensitive: readonly ["Android"];
|
|
16
|
+
readonly presence: true;
|
|
17
|
+
};
|
|
18
|
+
readonly deviceName: {
|
|
19
|
+
readonly isString: true;
|
|
20
|
+
};
|
|
21
|
+
readonly appActivity: {
|
|
22
|
+
readonly isString: true;
|
|
23
|
+
};
|
|
24
|
+
readonly appPackage: {
|
|
25
|
+
readonly isString: true;
|
|
26
|
+
};
|
|
27
|
+
readonly appWaitActivity: {
|
|
28
|
+
readonly isString: true;
|
|
29
|
+
};
|
|
30
|
+
readonly appWaitPackage: {
|
|
31
|
+
readonly isString: true;
|
|
32
|
+
};
|
|
33
|
+
readonly appWaitDuration: {
|
|
34
|
+
readonly isNumber: true;
|
|
35
|
+
};
|
|
36
|
+
readonly deviceReadyTimeout: {
|
|
37
|
+
readonly isNumber: true;
|
|
38
|
+
};
|
|
39
|
+
readonly androidDeviceReadyTimeout: {
|
|
40
|
+
readonly isNumber: true;
|
|
41
|
+
};
|
|
42
|
+
readonly androidDeviceSocket: {
|
|
43
|
+
readonly isString: true;
|
|
44
|
+
};
|
|
45
|
+
readonly androidInstallTimeout: {
|
|
46
|
+
readonly isNumber: true;
|
|
47
|
+
};
|
|
48
|
+
readonly adbPort: {
|
|
49
|
+
readonly isNumber: true;
|
|
50
|
+
};
|
|
51
|
+
readonly remoteAdbHost: {
|
|
52
|
+
readonly isString: true;
|
|
53
|
+
};
|
|
54
|
+
readonly adbExecTimeout: {
|
|
55
|
+
readonly isNumber: true;
|
|
56
|
+
};
|
|
57
|
+
readonly avd: {
|
|
58
|
+
readonly isString: true;
|
|
59
|
+
};
|
|
60
|
+
readonly avdLaunchTimeout: {
|
|
61
|
+
readonly isNumber: true;
|
|
62
|
+
};
|
|
63
|
+
readonly avdReadyTimeout: {
|
|
64
|
+
readonly isNumber: true;
|
|
65
|
+
};
|
|
66
|
+
readonly avdArgs: {};
|
|
67
|
+
readonly avdEnv: {
|
|
68
|
+
readonly isObject: true;
|
|
69
|
+
};
|
|
70
|
+
readonly useKeystore: {
|
|
71
|
+
readonly isBoolean: true;
|
|
72
|
+
};
|
|
73
|
+
readonly keystorePath: {
|
|
74
|
+
readonly isString: true;
|
|
75
|
+
};
|
|
76
|
+
readonly keystorePassword: {
|
|
77
|
+
readonly isString: true;
|
|
78
|
+
};
|
|
79
|
+
readonly keyAlias: {
|
|
80
|
+
readonly isString: true;
|
|
81
|
+
};
|
|
82
|
+
readonly keyPassword: {
|
|
83
|
+
readonly isString: true;
|
|
84
|
+
};
|
|
85
|
+
readonly webviewDevtoolsPort: {
|
|
86
|
+
readonly isNumber: true;
|
|
87
|
+
};
|
|
88
|
+
readonly ensureWebviewsHavePages: {
|
|
89
|
+
readonly isBoolean: true;
|
|
90
|
+
};
|
|
91
|
+
readonly enableWebviewDetailsCollection: {
|
|
92
|
+
readonly isBoolean: true;
|
|
93
|
+
};
|
|
94
|
+
readonly chromedriverPort: {
|
|
95
|
+
readonly isNumber: true;
|
|
96
|
+
};
|
|
97
|
+
readonly chromedriverPorts: {
|
|
98
|
+
readonly isArray: true;
|
|
99
|
+
};
|
|
100
|
+
readonly chromedriverArgs: {
|
|
101
|
+
readonly isObject: true;
|
|
102
|
+
};
|
|
103
|
+
readonly chromedriverExecutable: {
|
|
104
|
+
readonly isString: true;
|
|
105
|
+
};
|
|
106
|
+
readonly chromedriverExecutableDir: {
|
|
107
|
+
readonly isString: true;
|
|
108
|
+
};
|
|
109
|
+
readonly chromedriverChromeMappingFile: {
|
|
110
|
+
readonly isString: true;
|
|
111
|
+
};
|
|
112
|
+
readonly chromedriverUseSystemExecutable: {
|
|
113
|
+
readonly isBoolean: true;
|
|
114
|
+
};
|
|
115
|
+
readonly chromedriverDisableBuildCheck: {
|
|
116
|
+
readonly isBoolean: true;
|
|
117
|
+
};
|
|
118
|
+
readonly chromeLoggingPrefs: {
|
|
119
|
+
readonly isObject: true;
|
|
120
|
+
};
|
|
121
|
+
readonly autoWebviewTimeout: {
|
|
122
|
+
readonly isNumber: true;
|
|
123
|
+
};
|
|
124
|
+
readonly autoWebviewName: {
|
|
125
|
+
readonly isString: true;
|
|
126
|
+
};
|
|
127
|
+
readonly intentAction: {
|
|
128
|
+
readonly isString: true;
|
|
129
|
+
};
|
|
130
|
+
readonly intentCategory: {
|
|
131
|
+
readonly isString: true;
|
|
132
|
+
};
|
|
133
|
+
readonly intentFlags: {
|
|
134
|
+
readonly isString: true;
|
|
135
|
+
};
|
|
136
|
+
readonly optionalIntentArguments: {
|
|
137
|
+
readonly isString: true;
|
|
138
|
+
};
|
|
139
|
+
readonly dontStopAppOnReset: {
|
|
140
|
+
readonly isBoolean: true;
|
|
141
|
+
};
|
|
142
|
+
readonly unicodeKeyboard: {
|
|
143
|
+
readonly isBoolean: true;
|
|
144
|
+
};
|
|
145
|
+
readonly hideKeyboard: {
|
|
146
|
+
readonly isBoolean: true;
|
|
147
|
+
};
|
|
148
|
+
readonly noSign: {
|
|
149
|
+
readonly isBoolean: true;
|
|
150
|
+
};
|
|
151
|
+
readonly recreateChromeDriverSessions: {
|
|
152
|
+
readonly isBoolean: false;
|
|
153
|
+
};
|
|
154
|
+
readonly autoLaunch: {
|
|
155
|
+
readonly isBoolean: true;
|
|
156
|
+
};
|
|
157
|
+
readonly nativeWebScreenshot: {
|
|
158
|
+
readonly isBoolean: true;
|
|
159
|
+
};
|
|
160
|
+
readonly clearSystemFiles: {
|
|
161
|
+
readonly isBoolean: true;
|
|
162
|
+
};
|
|
163
|
+
readonly extractChromeAndroidPackageFromContextName: {
|
|
164
|
+
readonly isBoolean: true;
|
|
165
|
+
};
|
|
166
|
+
readonly autoGrantPermissions: {
|
|
167
|
+
readonly isBoolean: true;
|
|
168
|
+
};
|
|
169
|
+
readonly networkSpeed: {
|
|
170
|
+
readonly isString: true;
|
|
171
|
+
};
|
|
172
|
+
readonly gpsEnabled: {
|
|
173
|
+
readonly isBoolean: true;
|
|
174
|
+
};
|
|
175
|
+
readonly isHeadless: {
|
|
176
|
+
readonly isBoolean: true;
|
|
177
|
+
};
|
|
178
|
+
readonly showChromedriverLog: {
|
|
179
|
+
readonly isBoolean: true;
|
|
180
|
+
};
|
|
181
|
+
readonly skipUnlock: {
|
|
182
|
+
readonly isBoolean: true;
|
|
183
|
+
};
|
|
184
|
+
readonly clearDeviceLogsOnStart: {
|
|
185
|
+
readonly isBoolean: true;
|
|
186
|
+
};
|
|
187
|
+
readonly unlockType: {
|
|
188
|
+
readonly isString: true;
|
|
189
|
+
};
|
|
190
|
+
readonly unlockKey: {
|
|
191
|
+
readonly isString: true;
|
|
192
|
+
};
|
|
193
|
+
readonly unlockStrategy: {
|
|
194
|
+
readonly isString: true;
|
|
195
|
+
readonly inclusionCaseInsensitive: readonly ["locksettings", "uiautomator"];
|
|
196
|
+
};
|
|
197
|
+
readonly otherApps: {
|
|
198
|
+
readonly isString: true;
|
|
199
|
+
};
|
|
200
|
+
readonly uninstallOtherPackages: {
|
|
201
|
+
readonly isString: true;
|
|
202
|
+
};
|
|
203
|
+
readonly allowTestPackages: {
|
|
204
|
+
readonly isBoolean: true;
|
|
205
|
+
};
|
|
206
|
+
readonly pageLoadStrategy: {
|
|
207
|
+
readonly isString: true;
|
|
208
|
+
};
|
|
209
|
+
readonly localeScript: {
|
|
210
|
+
readonly isString: true;
|
|
211
|
+
};
|
|
212
|
+
readonly skipDeviceInitialization: {
|
|
213
|
+
readonly isBoolean: true;
|
|
214
|
+
};
|
|
215
|
+
readonly remoteAppsCacheLimit: {
|
|
216
|
+
readonly isNumber: true;
|
|
217
|
+
};
|
|
218
|
+
readonly buildToolsVersion: {
|
|
219
|
+
readonly isString: true;
|
|
220
|
+
};
|
|
221
|
+
readonly skipLogcatCapture: {
|
|
222
|
+
readonly isBoolean: true;
|
|
223
|
+
};
|
|
224
|
+
readonly chromeOptions: {
|
|
225
|
+
readonly isObject: true;
|
|
226
|
+
};
|
|
227
|
+
readonly enablePerformanceLogging: {
|
|
228
|
+
readonly isBoolean: true;
|
|
229
|
+
};
|
|
230
|
+
readonly userProfile: {
|
|
231
|
+
readonly isNumber: true;
|
|
232
|
+
};
|
|
233
|
+
readonly browserName: {
|
|
234
|
+
readonly isString: true;
|
|
235
|
+
};
|
|
236
|
+
readonly enforceAppInstall: {
|
|
237
|
+
readonly isBoolean: true;
|
|
238
|
+
};
|
|
239
|
+
readonly suppressKillServer: {
|
|
240
|
+
readonly isBoolean: true;
|
|
241
|
+
};
|
|
242
|
+
readonly allowOfflineDevices: {
|
|
243
|
+
readonly isBoolean: true;
|
|
244
|
+
};
|
|
245
|
+
readonly ignoreHiddenApiPolicyError: {
|
|
246
|
+
readonly isBoolean: true;
|
|
247
|
+
};
|
|
248
|
+
readonly unlockSuccessTimeout: {
|
|
249
|
+
readonly isNumber: true;
|
|
250
|
+
};
|
|
251
|
+
readonly mockLocationApp: {
|
|
252
|
+
readonly isString: true;
|
|
253
|
+
};
|
|
254
|
+
readonly logcatFormat: {
|
|
255
|
+
readonly isString: true;
|
|
256
|
+
};
|
|
257
|
+
readonly logcatFilterSpecs: {
|
|
258
|
+
readonly isArray: true;
|
|
259
|
+
};
|
|
260
|
+
readonly allowDelayAdb: {
|
|
261
|
+
readonly isBoolean: true;
|
|
262
|
+
};
|
|
263
|
+
readonly ignoreUnimportantViews: {
|
|
264
|
+
readonly isBoolean: true;
|
|
265
|
+
};
|
|
266
|
+
readonly disableWindowAnimation: {
|
|
267
|
+
readonly isBoolean: true;
|
|
268
|
+
};
|
|
269
|
+
readonly appWaitForLaunch: {
|
|
270
|
+
readonly isBoolean: true;
|
|
271
|
+
};
|
|
272
|
+
}>>(caps: T): T;
|
|
273
|
+
/**
|
|
274
|
+
* @this {AndroidDriver}
|
|
275
|
+
* @param {import('../types').FastUnlockOptions} opts
|
|
276
|
+
*/
|
|
277
|
+
export function fastUnlock(this: import("../../driver").AndroidDriver, opts: import('../types').FastUnlockOptions): Promise<void>;
|
|
278
|
+
/**
|
|
279
|
+
*
|
|
280
|
+
* @param {string} key
|
|
281
|
+
* @returns {string}
|
|
282
|
+
*/
|
|
283
|
+
export function encodePassword(key: string): string;
|
|
284
|
+
/**
|
|
285
|
+
*
|
|
286
|
+
* @param {string} key
|
|
287
|
+
* @returns {string[]}
|
|
288
|
+
*/
|
|
289
|
+
export function stringKeyToArr(key: string): string[];
|
|
290
|
+
/**
|
|
291
|
+
* @this {AndroidDriver}
|
|
292
|
+
* @param {AndroidDriverCaps} capabilities
|
|
293
|
+
* @returns {Promise<void>}
|
|
294
|
+
*/
|
|
295
|
+
export function fingerprintUnlock(this: import("../../driver").AndroidDriver, capabilities: AndroidDriverCaps): Promise<void>;
|
|
296
|
+
/**
|
|
297
|
+
* @this {AndroidDriver}
|
|
298
|
+
* @param {AndroidDriverCaps} capabilities
|
|
299
|
+
* @returns {Promise<void>}
|
|
300
|
+
*/
|
|
301
|
+
export function pinUnlock(this: import("../../driver").AndroidDriver, capabilities: AndroidDriverCaps): Promise<void>;
|
|
302
|
+
/**
|
|
303
|
+
* @this {AndroidDriver}
|
|
304
|
+
* @param {AndroidDriverCaps} capabilities
|
|
305
|
+
* @returns {Promise<void>}
|
|
306
|
+
*/
|
|
307
|
+
export function pinUnlockWithKeyEvent(this: import("../../driver").AndroidDriver, capabilities: AndroidDriverCaps): Promise<void>;
|
|
308
|
+
/**
|
|
309
|
+
* @this {AndroidDriver}
|
|
310
|
+
* @param {AndroidDriverCaps} capabilities
|
|
311
|
+
* @returns {Promise<void>}
|
|
312
|
+
*/
|
|
313
|
+
export function passwordUnlock(this: import("../../driver").AndroidDriver, capabilities: AndroidDriverCaps): Promise<void>;
|
|
314
|
+
/**
|
|
315
|
+
*
|
|
316
|
+
* @param {number} key
|
|
317
|
+
* @param {import('@appium/types').Position} initPos
|
|
318
|
+
* @param {number} piece
|
|
319
|
+
* @returns {import('@appium/types').Position}
|
|
320
|
+
*/
|
|
321
|
+
export function getPatternKeyPosition(key: number, initPos: import('@appium/types').Position, piece: number): import('@appium/types').Position;
|
|
322
|
+
/**
|
|
323
|
+
* @param {string[]|number[]} keys
|
|
324
|
+
* @param {import('@appium/types').Position} initPos
|
|
325
|
+
* @param {number} piece
|
|
326
|
+
* @returns {import('../types').TouchAction[]}
|
|
327
|
+
*/
|
|
328
|
+
export function getPatternActions(keys: string[] | number[], initPos: import('@appium/types').Position, piece: number): import('../types').TouchAction[];
|
|
329
|
+
/**
|
|
330
|
+
* @this {AndroidDriver}
|
|
331
|
+
* @param {number?} [timeoutMs=null]
|
|
332
|
+
*/
|
|
333
|
+
export function verifyUnlock(this: import("../../driver").AndroidDriver, timeoutMs?: number | null | undefined): Promise<void>;
|
|
334
|
+
/**
|
|
335
|
+
* @this {AndroidDriver}
|
|
336
|
+
* @param {AndroidDriverCaps} capabilities
|
|
337
|
+
*/
|
|
338
|
+
export function patternUnlock(this: import("../../driver").AndroidDriver, capabilities: AndroidDriverCaps): Promise<void>;
|
|
339
|
+
export const PIN_UNLOCK: "pin";
|
|
340
|
+
export const PIN_UNLOCK_KEY_EVENT: "pinWithKeyEvent";
|
|
341
|
+
export const PASSWORD_UNLOCK: "password";
|
|
342
|
+
export const PATTERN_UNLOCK: "pattern";
|
|
343
|
+
export const FINGERPRINT_UNLOCK: "fingerprint";
|
|
344
|
+
export const KEYCODE_NUMPAD_ENTER: 66;
|
|
345
|
+
export const UNLOCK_WAIT_TIME: 100;
|
|
346
|
+
export const INPUT_KEYS_WAIT_TIME: 100;
|
|
347
|
+
export type AndroidDriverCaps = import('@appium/types').Capabilities<import('../../constraints').AndroidDriverConstraints>;
|
|
348
|
+
export type AndroidDriver = import('../../driver').AndroidDriver;
|
|
349
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../lib/commands/lock/helpers.js"],"names":[],"mappings":"AAkDA;;;;GAIG;AACH,6CAHW,OAAO,UAAU,EAAE,UAAU,GAC3B,MAAM,CAalB;AAED;;;;GAIG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAoCC;AAED;;;GAGG;AACH,6EAF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