appium-android-driver 5.14.7 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/build/lib/commands/actions.d.ts +6 -224
- package/build/lib/commands/actions.d.ts.map +1 -1
- package/build/lib/commands/actions.js +306 -405
- package/build/lib/commands/actions.js.map +1 -1
- package/build/lib/commands/alert.d.ts +7 -9
- package/build/lib/commands/alert.d.ts.map +1 -1
- package/build/lib/commands/alert.js +24 -18
- package/build/lib/commands/alert.js.map +1 -1
- package/build/lib/commands/app-management.d.ts +7 -313
- package/build/lib/commands/app-management.d.ts.map +1 -1
- package/build/lib/commands/app-management.js +135 -293
- package/build/lib/commands/app-management.js.map +1 -1
- package/build/lib/commands/context.d.ts +8 -92
- package/build/lib/commands/context.d.ts.map +1 -1
- package/build/lib/commands/context.js +381 -439
- package/build/lib/commands/context.js.map +1 -1
- package/build/lib/commands/element.d.ts +8 -35
- package/build/lib/commands/element.d.ts.map +1 -1
- package/build/lib/commands/element.js +153 -136
- package/build/lib/commands/element.js.map +1 -1
- package/build/lib/commands/emu-console.d.ts +6 -48
- package/build/lib/commands/emu-console.d.ts.map +1 -1
- package/build/lib/commands/emu-console.js +19 -34
- package/build/lib/commands/emu-console.js.map +1 -1
- package/build/lib/commands/execute.d.ts +6 -5
- package/build/lib/commands/execute.d.ts.map +1 -1
- package/build/lib/commands/execute.js +77 -66
- package/build/lib/commands/execute.js.map +1 -1
- package/build/lib/commands/file-actions.d.ts +7 -128
- package/build/lib/commands/file-actions.d.ts.map +1 -1
- package/build/lib/commands/file-actions.js +183 -219
- package/build/lib/commands/file-actions.js.map +1 -1
- package/build/lib/commands/find.d.ts +8 -12
- package/build/lib/commands/find.d.ts.map +1 -1
- package/build/lib/commands/find.js +19 -23
- package/build/lib/commands/find.js.map +1 -1
- package/build/lib/commands/general.d.ts +9 -132
- package/build/lib/commands/general.d.ts.map +1 -1
- package/build/lib/commands/general.js +281 -312
- package/build/lib/commands/general.js.map +1 -1
- package/build/lib/commands/ime.d.ts +7 -10
- package/build/lib/commands/ime.d.ts.map +1 -1
- package/build/lib/commands/ime.js +47 -35
- package/build/lib/commands/ime.js.map +1 -1
- package/build/lib/commands/index.d.ts +27 -2
- package/build/lib/commands/index.d.ts.map +1 -1
- package/build/lib/commands/index.js +41 -19
- package/build/lib/commands/index.js.map +1 -1
- package/build/lib/commands/intent.d.ts +7 -417
- package/build/lib/commands/intent.d.ts.map +1 -1
- package/build/lib/commands/intent.js +104 -216
- package/build/lib/commands/intent.js.map +1 -1
- package/build/lib/commands/keyboard.d.ts +6 -5
- package/build/lib/commands/keyboard.d.ts.map +1 -1
- package/build/lib/commands/keyboard.js +16 -8
- package/build/lib/commands/keyboard.js.map +1 -1
- package/build/lib/commands/log.d.ts +7 -44
- package/build/lib/commands/log.d.ts.map +1 -1
- package/build/lib/commands/log.js +146 -108
- package/build/lib/commands/log.js.map +1 -1
- package/build/lib/commands/media-projection.d.ts +7 -143
- package/build/lib/commands/media-projection.d.ts.map +1 -1
- package/build/lib/commands/media-projection.js +113 -140
- package/build/lib/commands/media-projection.js.map +1 -1
- package/build/lib/commands/mixins.d.ts +740 -0
- package/build/lib/commands/mixins.d.ts.map +1 -0
- package/build/lib/commands/mixins.js +19 -0
- package/build/lib/commands/mixins.js.map +1 -0
- package/build/lib/commands/network.d.ts +7 -138
- package/build/lib/commands/network.d.ts.map +1 -1
- package/build/lib/commands/network.js +212 -254
- package/build/lib/commands/network.js.map +1 -1
- package/build/lib/commands/performance.d.ts +24 -70
- package/build/lib/commands/performance.d.ts.map +1 -1
- package/build/lib/commands/performance.js +144 -100
- package/build/lib/commands/performance.js.map +1 -1
- package/build/lib/commands/permissions.d.ts +8 -92
- package/build/lib/commands/permissions.d.ts.map +1 -1
- package/build/lib/commands/permissions.js +75 -87
- package/build/lib/commands/permissions.js.map +1 -1
- package/build/lib/commands/recordscreen.d.ts +7 -193
- package/build/lib/commands/recordscreen.d.ts.map +1 -1
- package/build/lib/commands/recordscreen.js +151 -182
- package/build/lib/commands/recordscreen.js.map +1 -1
- package/build/lib/commands/shell.d.ts +7 -7
- package/build/lib/commands/shell.d.ts.map +1 -1
- package/build/lib/commands/shell.js +40 -33
- package/build/lib/commands/shell.js.map +1 -1
- package/build/lib/commands/streamscreen.d.ts +9 -103
- package/build/lib/commands/streamscreen.d.ts.map +1 -1
- package/build/lib/commands/streamscreen.js +261 -218
- package/build/lib/commands/streamscreen.js.map +1 -1
- package/build/lib/commands/system-bars.d.ts +22 -90
- package/build/lib/commands/system-bars.d.ts.map +1 -1
- package/build/lib/commands/system-bars.js +76 -74
- package/build/lib/commands/system-bars.js.map +1 -1
- package/build/lib/commands/touch.d.ts +10 -29
- package/build/lib/commands/touch.d.ts.map +1 -1
- package/build/lib/commands/touch.js +301 -285
- package/build/lib/commands/touch.js.map +1 -1
- package/build/lib/commands/types.d.ts +978 -0
- package/build/lib/commands/types.d.ts.map +1 -0
- package/build/lib/commands/types.js +3 -0
- package/build/lib/commands/types.js.map +1 -0
- package/build/lib/constraints.d.ts +291 -0
- package/build/lib/constraints.d.ts.map +1 -0
- package/build/lib/{desired-caps.js → constraints.js} +103 -102
- package/build/lib/constraints.js.map +1 -0
- package/build/lib/driver.d.ts +68 -37
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +123 -80
- package/build/lib/driver.js.map +1 -1
- package/build/lib/helpers/android.d.ts +164 -0
- package/build/lib/helpers/android.d.ts.map +1 -0
- package/build/lib/helpers/android.js +819 -0
- package/build/lib/helpers/android.js.map +1 -0
- package/build/lib/helpers/index.d.ts +7 -0
- package/build/lib/helpers/index.d.ts.map +1 -0
- package/build/lib/helpers/index.js +29 -0
- package/build/lib/helpers/index.js.map +1 -0
- package/build/lib/helpers/types.d.ts +121 -0
- package/build/lib/helpers/types.d.ts.map +1 -0
- package/build/lib/helpers/types.js +3 -0
- package/build/lib/helpers/types.js.map +1 -0
- package/build/lib/helpers/unlock.d.ts +32 -0
- package/build/lib/helpers/unlock.d.ts.map +1 -0
- package/build/lib/helpers/unlock.js +273 -0
- package/build/lib/helpers/unlock.js.map +1 -0
- package/build/lib/helpers/webview.d.ts +74 -0
- package/build/lib/helpers/webview.d.ts.map +1 -0
- package/build/lib/helpers/webview.js +421 -0
- package/build/lib/helpers/webview.js.map +1 -0
- package/build/lib/index.d.ts +9 -0
- package/build/lib/index.d.ts.map +1 -0
- package/build/lib/index.js +37 -0
- package/build/lib/index.js.map +1 -0
- package/build/lib/method-map.d.ts +0 -8
- package/build/lib/method-map.d.ts.map +1 -1
- package/build/lib/method-map.js +63 -74
- package/build/lib/method-map.js.map +1 -1
- package/build/lib/stubs.d.ts +0 -1
- package/build/lib/stubs.d.ts.map +1 -1
- package/build/lib/stubs.js +1 -0
- package/build/lib/stubs.js.map +1 -1
- package/build/lib/utils.d.ts +1 -1
- package/build/lib/utils.d.ts.map +1 -1
- package/lib/commands/actions.js +351 -464
- package/lib/commands/alert.js +27 -17
- package/lib/commands/app-management.js +156 -314
- package/lib/commands/context.js +457 -441
- package/lib/commands/element.js +201 -157
- package/lib/commands/emu-console.js +25 -45
- package/lib/commands/execute.js +106 -90
- package/lib/commands/file-actions.js +222 -240
- package/lib/commands/find.ts +103 -0
- package/lib/commands/general.js +327 -339
- package/lib/commands/ime.js +50 -34
- package/lib/commands/{index.js → index.ts} +20 -24
- package/lib/commands/intent.js +108 -249
- package/lib/commands/keyboard.js +20 -8
- package/lib/commands/log.js +172 -116
- package/lib/commands/media-projection.js +134 -161
- package/lib/commands/mixins.ts +966 -0
- package/lib/commands/network.js +252 -281
- package/lib/commands/performance.js +203 -132
- package/lib/commands/permissions.js +108 -109
- package/lib/commands/recordscreen.js +212 -209
- package/lib/commands/shell.js +51 -40
- package/lib/commands/streamscreen.js +355 -289
- package/lib/commands/system-bars.js +92 -83
- package/lib/commands/touch.js +357 -294
- package/lib/commands/types.ts +1097 -0
- package/lib/{desired-caps.js → constraints.ts} +106 -103
- package/lib/{driver.js → driver.ts} +278 -132
- package/lib/helpers/android.ts +1143 -0
- package/lib/helpers/index.ts +6 -0
- package/lib/helpers/types.ts +134 -0
- package/lib/helpers/unlock.ts +329 -0
- package/lib/helpers/webview.ts +582 -0
- package/lib/index.ts +18 -0
- package/lib/method-map.js +87 -98
- package/lib/stubs.ts +0 -1
- package/package.json +26 -19
- package/build/index.js +0 -51
- package/build/lib/android-helpers.d.ts +0 -136
- package/build/lib/android-helpers.d.ts.map +0 -1
- package/build/lib/android-helpers.js +0 -855
- package/build/lib/android-helpers.js.map +0 -1
- package/build/lib/commands/coverage.d.ts +0 -5
- package/build/lib/commands/coverage.d.ts.map +0 -1
- package/build/lib/commands/coverage.js +0 -19
- package/build/lib/commands/coverage.js.map +0 -1
- package/build/lib/desired-caps.d.ts +0 -353
- package/build/lib/desired-caps.d.ts.map +0 -1
- package/build/lib/desired-caps.js.map +0 -1
- package/build/lib/unlock-helpers.d.ts +0 -38
- package/build/lib/unlock-helpers.d.ts.map +0 -1
- package/build/lib/unlock-helpers.js +0 -266
- package/build/lib/unlock-helpers.js.map +0 -1
- package/build/lib/webview-helpers.d.ts +0 -224
- package/build/lib/webview-helpers.d.ts.map +0 -1
- package/build/lib/webview-helpers.js +0 -528
- package/build/lib/webview-helpers.js.map +0 -1
- package/index.js +0 -24
- package/lib/android-helpers.js +0 -983
- package/lib/commands/coverage.js +0 -18
- package/lib/commands/find.js +0 -82
- package/lib/unlock-helpers.js +0 -278
- package/lib/webview-helpers.js +0 -602
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// @ts-check
|
|
2
3
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
4
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
5
|
};
|
|
5
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
+
const mixins_1 = require("./mixins");
|
|
7
8
|
const lodash_1 = __importDefault(require("lodash"));
|
|
8
9
|
const driver_1 = require("appium/driver");
|
|
9
10
|
const support_1 = require("appium/support");
|
|
10
11
|
const bluebird_1 = __importDefault(require("bluebird"));
|
|
11
|
-
let commands = {}, helpers = {}, extensions = {};
|
|
12
|
-
exports.commands = commands;
|
|
13
|
-
exports.helpers = helpers;
|
|
14
12
|
const AIRPLANE_MODE_MASK = 0b001;
|
|
15
13
|
const WIFI_MASK = 0b010;
|
|
16
14
|
const DATA_MASK = 0b100;
|
|
@@ -23,271 +21,231 @@ const GEO_EPSILON = Number.MIN_VALUE;
|
|
|
23
21
|
const WIFI_KEY_NAME = 'wifi';
|
|
24
22
|
const DATA_KEY_NAME = 'data';
|
|
25
23
|
const AIRPLANE_MODE_KEY_NAME = 'airplaneMode';
|
|
26
|
-
const SUPPORTED_SERVICE_NAMES =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
// no need to check anything else if we are in airplane mode
|
|
32
|
-
if (!airplaneModeOn) {
|
|
33
|
-
let wifiOn = await this.isWifiOn();
|
|
34
|
-
connection |= (wifiOn ? WIFI_MASK : 0);
|
|
35
|
-
let dataOn = await this.adb.isDataOn();
|
|
36
|
-
connection |= (dataOn ? DATA_MASK : 0);
|
|
37
|
-
}
|
|
38
|
-
return connection;
|
|
39
|
-
};
|
|
24
|
+
const SUPPORTED_SERVICE_NAMES = /** @type {const} */ ([
|
|
25
|
+
WIFI_KEY_NAME,
|
|
26
|
+
DATA_KEY_NAME,
|
|
27
|
+
AIRPLANE_MODE_KEY_NAME,
|
|
28
|
+
]);
|
|
40
29
|
/**
|
|
41
|
-
*
|
|
30
|
+
* @type {import('./mixins').NetworkMixin & ThisType<import('../driver').AndroidDriver>}
|
|
31
|
+
* @satisfies {import('@appium/types').ExternalDriver}
|
|
42
32
|
*/
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
await
|
|
33
|
+
const NetworkMixin = {
|
|
34
|
+
async getNetworkConnection() {
|
|
35
|
+
const adb = /** @type {ADB} */ (this.adb);
|
|
36
|
+
this.log.info('Getting network connection');
|
|
37
|
+
let airplaneModeOn = await adb.isAirplaneModeOn();
|
|
38
|
+
let connection = airplaneModeOn ? AIRPLANE_MODE_MASK : 0;
|
|
39
|
+
// no need to check anything else if we are in airplane mode
|
|
40
|
+
if (!airplaneModeOn) {
|
|
41
|
+
let wifiOn = await this.isWifiOn();
|
|
42
|
+
connection |= wifiOn ? WIFI_MASK : 0;
|
|
43
|
+
let dataOn = await adb.isDataOn();
|
|
44
|
+
connection |= dataOn ? DATA_MASK : 0;
|
|
45
|
+
}
|
|
46
|
+
return connection;
|
|
47
|
+
},
|
|
48
|
+
async isWifiOn() {
|
|
49
|
+
return await /** @type {ADB} */ (this.adb).isWifiOn();
|
|
50
|
+
},
|
|
51
|
+
async mobileSetConnectivity(opts = {}) {
|
|
52
|
+
const { wifi, data, airplaneMode } = opts;
|
|
53
|
+
const adb = /** @type {ADB} */ (this.adb);
|
|
54
|
+
if (lodash_1.default.every([wifi, data, airplaneMode], lodash_1.default.isUndefined)) {
|
|
55
|
+
throw new driver_1.errors.InvalidArgumentError(`Either one of ${JSON.stringify(SUPPORTED_SERVICE_NAMES)} options must be provided`);
|
|
56
|
+
}
|
|
57
|
+
const currentState = await this.mobileGetConnectivity({
|
|
58
|
+
services: /** @type {import('./types').ServiceType[]} */ ([
|
|
59
|
+
...(lodash_1.default.isUndefined(wifi) ? [] : [WIFI_KEY_NAME]),
|
|
60
|
+
...(lodash_1.default.isUndefined(data) ? [] : [DATA_KEY_NAME]),
|
|
61
|
+
...(lodash_1.default.isUndefined(airplaneMode) ? [] : [AIRPLANE_MODE_KEY_NAME]),
|
|
62
|
+
]),
|
|
63
|
+
});
|
|
64
|
+
/** @type {(Promise<any>|(() => Promise<any>))[]} */
|
|
65
|
+
const setters = [];
|
|
66
|
+
if (!lodash_1.default.isUndefined(wifi) && currentState.wifi !== Boolean(wifi)) {
|
|
67
|
+
setters.push(adb.setWifiState(wifi, this.isEmulator()));
|
|
68
|
+
}
|
|
69
|
+
if (!lodash_1.default.isUndefined(data) && currentState.data !== Boolean(data)) {
|
|
70
|
+
setters.push(adb.setDataState(data, this.isEmulator()));
|
|
71
|
+
}
|
|
72
|
+
if (!lodash_1.default.isUndefined(airplaneMode) && currentState.airplaneMode !== Boolean(airplaneMode)) {
|
|
73
|
+
setters.push(async () => {
|
|
74
|
+
await adb.setAirplaneMode(airplaneMode);
|
|
75
|
+
if ((await adb.getApiLevel()) < 30) {
|
|
76
|
+
await adb.broadcastAirplaneMode(airplaneMode);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
if (!lodash_1.default.isEmpty(setters)) {
|
|
81
|
+
await bluebird_1.default.all(setters);
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
async mobileGetConnectivity(opts = {}) {
|
|
85
|
+
let { services = SUPPORTED_SERVICE_NAMES } = opts;
|
|
86
|
+
const svcs = lodash_1.default.castArray(services);
|
|
87
|
+
const unsupportedServices = lodash_1.default.difference(services, SUPPORTED_SERVICE_NAMES);
|
|
88
|
+
if (!lodash_1.default.isEmpty(unsupportedServices)) {
|
|
89
|
+
throw new driver_1.errors.InvalidArgumentError(`${support_1.util.pluralize('Service name', unsupportedServices.length, false)} ${unsupportedServices} ` +
|
|
90
|
+
`${unsupportedServices.length === 1 ? 'is' : 'are'} not known. Only the following services are ` +
|
|
91
|
+
`suported: ${SUPPORTED_SERVICE_NAMES}`);
|
|
92
|
+
}
|
|
93
|
+
const adb = /** @type {ADB} */ (this.adb);
|
|
94
|
+
const statePromises = {
|
|
95
|
+
wifi: bluebird_1.default.resolve(svcs.includes(WIFI_KEY_NAME) ? adb.isWifiOn() : undefined),
|
|
96
|
+
data: bluebird_1.default.resolve(svcs.includes(DATA_KEY_NAME) ? adb.isDataOn() : undefined),
|
|
97
|
+
airplaneMode: bluebird_1.default.resolve(svcs.includes(AIRPLANE_MODE_KEY_NAME) ? adb.isAirplaneModeOn() : undefined),
|
|
98
|
+
};
|
|
99
|
+
await bluebird_1.default.all(lodash_1.default.values(statePromises));
|
|
100
|
+
return {
|
|
101
|
+
wifi: Boolean(statePromises.wifi.value()),
|
|
102
|
+
data: Boolean(statePromises.data.value()),
|
|
103
|
+
airplaneMode: Boolean(statePromises.airplaneMode.value()),
|
|
104
|
+
};
|
|
105
|
+
},
|
|
106
|
+
async setNetworkConnection(type) {
|
|
107
|
+
this.log.info('Setting network connection');
|
|
108
|
+
// decode the input
|
|
109
|
+
const shouldEnableAirplaneMode = (type & AIRPLANE_MODE_MASK) !== 0;
|
|
110
|
+
const shouldEnableWifi = (type & WIFI_MASK) !== 0;
|
|
111
|
+
const shouldEnableDataConnection = (type & DATA_MASK) !== 0;
|
|
112
|
+
const currentState = await this.getNetworkConnection();
|
|
113
|
+
const isAirplaneModeEnabled = (currentState & AIRPLANE_MODE_MASK) !== 0;
|
|
114
|
+
const isWiFiEnabled = (currentState & WIFI_MASK) !== 0;
|
|
115
|
+
const isDataEnabled = (currentState & DATA_MASK) !== 0;
|
|
116
|
+
const adb = /** @type {ADB} */ (this.adb);
|
|
117
|
+
if (shouldEnableAirplaneMode !== isAirplaneModeEnabled) {
|
|
118
|
+
await this.wrapBootstrapDisconnect(async () => {
|
|
119
|
+
await adb.setAirplaneMode(shouldEnableAirplaneMode);
|
|
120
|
+
});
|
|
121
|
+
await this.wrapBootstrapDisconnect(async () => {
|
|
122
|
+
if ((await adb.getApiLevel()) < 30) {
|
|
123
|
+
await adb.broadcastAirplaneMode(shouldEnableAirplaneMode);
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
this.log.info(`Not changing airplane mode, since it is already ${shouldEnableAirplaneMode ? 'enabled' : 'disabled'}`);
|
|
129
|
+
}
|
|
130
|
+
if (shouldEnableWifi === isWiFiEnabled && shouldEnableDataConnection === isDataEnabled) {
|
|
131
|
+
this.log.info('Not changing data connection/Wi-Fi states, since they are already set to expected values');
|
|
132
|
+
if (await adb.isAirplaneModeOn()) {
|
|
133
|
+
return AIRPLANE_MODE_MASK | currentState;
|
|
134
|
+
}
|
|
135
|
+
return ~AIRPLANE_MODE_MASK & currentState;
|
|
136
|
+
}
|
|
137
|
+
await this.wrapBootstrapDisconnect(async () => {
|
|
138
|
+
if (shouldEnableWifi !== isWiFiEnabled) {
|
|
139
|
+
await this.setWifiState(shouldEnableWifi);
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
this.log.info(`Not changing Wi-Fi state, since it is already ` +
|
|
143
|
+
`${shouldEnableWifi ? 'enabled' : 'disabled'}`);
|
|
144
|
+
}
|
|
145
|
+
if (shouldEnableAirplaneMode) {
|
|
146
|
+
this.log.info('Not changing data connection state, because airplane mode is enabled');
|
|
147
|
+
}
|
|
148
|
+
else if (shouldEnableDataConnection === isDataEnabled) {
|
|
149
|
+
this.log.info(`Not changing data connection state, since it is already ` +
|
|
150
|
+
`${shouldEnableDataConnection ? 'enabled' : 'disabled'}`);
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
await adb.setDataState(shouldEnableDataConnection, this.isEmulator());
|
|
86
154
|
}
|
|
87
155
|
});
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
* Retrieves the connectivity properties from the device under test
|
|
106
|
-
*
|
|
107
|
-
* @param {GetConnectivityOptions?} opts If no service names are provided then the
|
|
108
|
-
* connectivity state is returned for all of them.
|
|
109
|
-
* @returns {GetConnectivityResult}
|
|
110
|
-
*/
|
|
111
|
-
commands.mobileGetConnectivity = async function mobileGetConnectivity(opts = {}) {
|
|
112
|
-
let { services = SUPPORTED_SERVICE_NAMES, } = opts;
|
|
113
|
-
if (!lodash_1.default.isArray(services)) {
|
|
114
|
-
services = [services];
|
|
115
|
-
}
|
|
116
|
-
const unsupportedServices = lodash_1.default.difference(services, SUPPORTED_SERVICE_NAMES);
|
|
117
|
-
if (!lodash_1.default.isEmpty(unsupportedServices)) {
|
|
118
|
-
throw new driver_1.errors.InvalidArgumentError(`${support_1.util.pluralize('Service name', unsupportedServices.length, false)} ${unsupportedServices} ` +
|
|
119
|
-
`${unsupportedServices.length === 1 ? 'is' : 'are'} not known. Only the following services are ` +
|
|
120
|
-
`suported: ${SUPPORTED_SERVICE_NAMES}`);
|
|
121
|
-
}
|
|
122
|
-
const statePromises = {
|
|
123
|
-
wifi: bluebird_1.default.resolve(services.includes(WIFI_KEY_NAME) ? this.adb.isWifiOn() : undefined),
|
|
124
|
-
data: bluebird_1.default.resolve(services.includes(DATA_KEY_NAME) ? this.adb.isDataOn() : undefined),
|
|
125
|
-
airplaneMode: bluebird_1.default.resolve(services.includes(AIRPLANE_MODE_KEY_NAME) ? this.adb.isAirplaneModeOn() : undefined),
|
|
126
|
-
};
|
|
127
|
-
await bluebird_1.default.all(lodash_1.default.values(statePromises));
|
|
128
|
-
return lodash_1.default.fromPairs(services.map((k) => [k, statePromises[k].value()]));
|
|
129
|
-
};
|
|
130
|
-
commands.setNetworkConnection = async function setNetworkConnection(type) {
|
|
131
|
-
this.log.info('Setting network connection');
|
|
132
|
-
// decode the input
|
|
133
|
-
const shouldEnableAirplaneMode = (type & AIRPLANE_MODE_MASK) !== 0;
|
|
134
|
-
const shouldEnableWifi = (type & WIFI_MASK) !== 0;
|
|
135
|
-
const shouldEnableDataConnection = (type & DATA_MASK) !== 0;
|
|
136
|
-
const currentState = await this.getNetworkConnection();
|
|
137
|
-
const isAirplaneModeEnabled = (currentState & AIRPLANE_MODE_MASK) !== 0;
|
|
138
|
-
const isWiFiEnabled = (currentState & WIFI_MASK) !== 0;
|
|
139
|
-
const isDataEnabled = (currentState & DATA_MASK) !== 0;
|
|
140
|
-
if (shouldEnableAirplaneMode !== isAirplaneModeEnabled) {
|
|
156
|
+
return await this.getNetworkConnection();
|
|
157
|
+
},
|
|
158
|
+
async setWifiState(wifi) {
|
|
159
|
+
await /** @type {ADB} */ (this.adb).setWifiState(wifi, this.isEmulator());
|
|
160
|
+
},
|
|
161
|
+
async toggleData() {
|
|
162
|
+
const adb = /** @type {ADB} */ (this.adb);
|
|
163
|
+
let data = !(await adb.isDataOn());
|
|
164
|
+
this.log.info(`Turning network data ${data ? 'on' : 'off'}`);
|
|
165
|
+
await this.wrapBootstrapDisconnect(async () => {
|
|
166
|
+
await adb.setWifiAndData({ data }, this.isEmulator());
|
|
167
|
+
});
|
|
168
|
+
},
|
|
169
|
+
async toggleWiFi() {
|
|
170
|
+
const adb = /** @type {ADB} */ (this.adb);
|
|
171
|
+
let wifi = !(await adb.isWifiOn());
|
|
172
|
+
this.log.info(`Turning WiFi ${wifi ? 'on' : 'off'}`);
|
|
141
173
|
await this.wrapBootstrapDisconnect(async () => {
|
|
142
|
-
await
|
|
174
|
+
await adb.setWifiAndData({ wifi }, this.isEmulator());
|
|
143
175
|
});
|
|
176
|
+
},
|
|
177
|
+
async toggleFlightMode() {
|
|
178
|
+
const adb = /** @type {ADB} */ (this.adb);
|
|
179
|
+
/*
|
|
180
|
+
* TODO: Implement isRealDevice(). This method fails on
|
|
181
|
+
* real devices, it should throw a NotYetImplementedError
|
|
182
|
+
*/
|
|
183
|
+
let flightMode = !(await adb.isAirplaneModeOn());
|
|
184
|
+
this.log.info(`Turning flight mode ${flightMode ? 'on' : 'off'}`);
|
|
144
185
|
await this.wrapBootstrapDisconnect(async () => {
|
|
145
|
-
|
|
146
|
-
|
|
186
|
+
await adb.setAirplaneMode(flightMode);
|
|
187
|
+
});
|
|
188
|
+
await this.wrapBootstrapDisconnect(async () => {
|
|
189
|
+
if ((await adb.getApiLevel()) < 30) {
|
|
190
|
+
await adb.broadcastAirplaneMode(flightMode);
|
|
147
191
|
}
|
|
148
192
|
});
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
this.log.info('Not changing data connection/Wi-Fi states, since they are already set to expected values');
|
|
155
|
-
if (await this.adb.isAirplaneModeOn()) {
|
|
156
|
-
return AIRPLANE_MODE_MASK | currentState;
|
|
157
|
-
}
|
|
158
|
-
return ~AIRPLANE_MODE_MASK & currentState;
|
|
159
|
-
}
|
|
160
|
-
await this.wrapBootstrapDisconnect(async () => {
|
|
161
|
-
if (shouldEnableWifi !== isWiFiEnabled) {
|
|
162
|
-
await this.setWifiState(shouldEnableWifi);
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
this.log.info(`Not changing Wi-Fi state, since it is already ` +
|
|
166
|
-
`${shouldEnableWifi ? 'enabled' : 'disabled'}`);
|
|
193
|
+
},
|
|
194
|
+
async setGeoLocation(location) {
|
|
195
|
+
await /** @type {ADB} */ (this.adb).setGeoLocation(location, this.isEmulator());
|
|
196
|
+
try {
|
|
197
|
+
return await this.getGeoLocation();
|
|
167
198
|
}
|
|
168
|
-
|
|
169
|
-
this.log.
|
|
199
|
+
catch (e) {
|
|
200
|
+
this.log.warn(`Could not get the current geolocation info: ${ /** @type {Error} */(e).message}`);
|
|
201
|
+
this.log.warn(`Returning the default zero'ed values`);
|
|
202
|
+
return {
|
|
203
|
+
latitude: GEO_EPSILON,
|
|
204
|
+
longitude: GEO_EPSILON,
|
|
205
|
+
altitude: GEO_EPSILON,
|
|
206
|
+
};
|
|
170
207
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
208
|
+
},
|
|
209
|
+
async mobileRefreshGpsCache(opts = {}) {
|
|
210
|
+
const { timeoutMs } = opts;
|
|
211
|
+
await /** @type {ADB} */ (this.adb).refreshGeoLocationCache(timeoutMs);
|
|
212
|
+
},
|
|
213
|
+
async getGeoLocation() {
|
|
214
|
+
const { latitude, longitude, altitude } = await /** @type {ADB} */ (this.adb).getGeoLocation();
|
|
215
|
+
return {
|
|
216
|
+
latitude: parseFloat(String(latitude)) || GEO_EPSILON,
|
|
217
|
+
longitude: parseFloat(String(longitude)) || GEO_EPSILON,
|
|
218
|
+
altitude: parseFloat(String(altitude)) || GEO_EPSILON,
|
|
219
|
+
};
|
|
220
|
+
},
|
|
221
|
+
async isLocationServicesEnabled() {
|
|
222
|
+
return (await /** @type {ADB} */ (this.adb).getLocationProviders()).includes('gps');
|
|
223
|
+
},
|
|
224
|
+
async toggleLocationServices() {
|
|
225
|
+
this.log.info('Toggling location services');
|
|
226
|
+
const isGpsEnabled = await this.isLocationServicesEnabled();
|
|
227
|
+
this.log.debug(`Current GPS state: ${isGpsEnabled}. ` +
|
|
228
|
+
`The service is going to be ${isGpsEnabled ? 'disabled' : 'enabled'}`);
|
|
229
|
+
await /** @type {ADB} */ (this.adb).toggleGPSLocationProvider(!isGpsEnabled);
|
|
230
|
+
},
|
|
231
|
+
async wrapBootstrapDisconnect(wrapped) {
|
|
232
|
+
if (!this.bootstrap) {
|
|
233
|
+
return await wrapped();
|
|
174
234
|
}
|
|
175
|
-
|
|
176
|
-
|
|
235
|
+
this.bootstrap.ignoreUnexpectedShutdown = true;
|
|
236
|
+
try {
|
|
237
|
+
await wrapped();
|
|
238
|
+
await /** @type {ADB} */ (this.adb).restart();
|
|
239
|
+
await this.bootstrap.start(this.opts.appPackage, this.opts.disableAndroidWatchers, this.opts.acceptSslCerts);
|
|
177
240
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
};
|
|
181
|
-
/**
|
|
182
|
-
* decoupling to override behaviour in other drivers like UiAutomator2.
|
|
183
|
-
*/
|
|
184
|
-
commands.setWifiState = async function setWifiState(wifi) {
|
|
185
|
-
await this.adb.setWifiState(wifi, this.isEmulator());
|
|
186
|
-
};
|
|
187
|
-
commands.toggleData = async function toggleData() {
|
|
188
|
-
let data = !(await this.adb.isDataOn());
|
|
189
|
-
this.log.info(`Turning network data ${data ? 'on' : 'off'}`);
|
|
190
|
-
await this.wrapBootstrapDisconnect(async () => {
|
|
191
|
-
await this.adb.setWifiAndData({ data }, this.isEmulator());
|
|
192
|
-
});
|
|
193
|
-
};
|
|
194
|
-
commands.toggleWiFi = async function toggleWiFi() {
|
|
195
|
-
let wifi = !(await this.adb.isWifiOn());
|
|
196
|
-
this.log.info(`Turning WiFi ${wifi ? 'on' : 'off'}`);
|
|
197
|
-
await this.wrapBootstrapDisconnect(async () => {
|
|
198
|
-
await this.adb.setWifiAndData({ wifi }, this.isEmulator());
|
|
199
|
-
});
|
|
200
|
-
};
|
|
201
|
-
commands.toggleFlightMode = async function toggleFlightMode() {
|
|
202
|
-
/*
|
|
203
|
-
* TODO: Implement isRealDevice(). This method fails on
|
|
204
|
-
* real devices, it should throw a NotYetImplementedError
|
|
205
|
-
*/
|
|
206
|
-
let flightMode = !(await this.adb.isAirplaneModeOn());
|
|
207
|
-
this.log.info(`Turning flight mode ${flightMode ? 'on' : 'off'}`);
|
|
208
|
-
await this.wrapBootstrapDisconnect(async () => {
|
|
209
|
-
await this.adb.setAirplaneMode(flightMode);
|
|
210
|
-
});
|
|
211
|
-
await this.wrapBootstrapDisconnect(async () => {
|
|
212
|
-
if (await this.adb.getApiLevel() < 30) {
|
|
213
|
-
await this.adb.broadcastAirplaneMode(flightMode);
|
|
241
|
+
finally {
|
|
242
|
+
this.bootstrap.ignoreUnexpectedShutdown = false;
|
|
214
243
|
}
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
commands.setGeoLocation = async function setGeoLocation(location) {
|
|
218
|
-
await this.adb.setGeoLocation(location, this.isEmulator());
|
|
219
|
-
try {
|
|
220
|
-
return await this.getGeoLocation();
|
|
221
|
-
}
|
|
222
|
-
catch (e) {
|
|
223
|
-
this.log.warn(`Could not get the current geolocation info: ${e.message}`);
|
|
224
|
-
this.log.warn(`Returning the default zero'ed values`);
|
|
225
|
-
return {
|
|
226
|
-
latitude: GEO_EPSILON,
|
|
227
|
-
longitude: GEO_EPSILON,
|
|
228
|
-
altitude: GEO_EPSILON,
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
};
|
|
232
|
-
/**
|
|
233
|
-
* @typedef {Object} GpsCacheRefreshOptions
|
|
234
|
-
* @property {number} timeoutMs [20000] The maximum number of milliseconds
|
|
235
|
-
* to block until GPS cache is refreshed. Providing zero or a negative
|
|
236
|
-
* value to it skips waiting completely.
|
|
237
|
-
*/
|
|
238
|
-
/**
|
|
239
|
-
* Sends an async request to refresh the GPS cache.
|
|
240
|
-
* This feature only works if the device under test has
|
|
241
|
-
* Google Play Services installed. In case the vanilla
|
|
242
|
-
* LocationManager is used the device API level must be at
|
|
243
|
-
* version 30 (Android R) or higher.
|
|
244
|
-
*
|
|
245
|
-
* @param {GpsCacheRefreshOptions} opts
|
|
246
|
-
*/
|
|
247
|
-
commands.mobileRefreshGpsCache = async function mobileRefreshGpsCache(opts = {}) {
|
|
248
|
-
const { timeoutMs } = opts;
|
|
249
|
-
await this.adb.refreshGeoLocationCache(timeoutMs);
|
|
250
|
-
};
|
|
251
|
-
commands.getGeoLocation = async function getGeoLocation() {
|
|
252
|
-
const { latitude, longitude, altitude } = await this.adb.getGeoLocation();
|
|
253
|
-
return {
|
|
254
|
-
latitude: parseFloat(latitude) || GEO_EPSILON,
|
|
255
|
-
longitude: parseFloat(longitude) || GEO_EPSILON,
|
|
256
|
-
altitude: parseFloat(altitude) || GEO_EPSILON,
|
|
257
|
-
};
|
|
258
|
-
};
|
|
259
|
-
/**
|
|
260
|
-
* Checks if GPS is enabled
|
|
261
|
-
*
|
|
262
|
-
* @returns {Promise<Boolean>} True if yes
|
|
263
|
-
*/
|
|
264
|
-
commands.isLocationServicesEnabled = async function iLocationServicesEnabled() {
|
|
265
|
-
return (await this.adb.getLocationProviders()).includes('gps');
|
|
244
|
+
},
|
|
266
245
|
};
|
|
246
|
+
(0, mixins_1.mixin)(NetworkMixin);
|
|
247
|
+
exports.default = NetworkMixin;
|
|
267
248
|
/**
|
|
268
|
-
*
|
|
249
|
+
* @typedef {import('appium-adb').ADB} ADB
|
|
269
250
|
*/
|
|
270
|
-
commands.toggleLocationServices = async function toggleLocationServices() {
|
|
271
|
-
this.log.info('Toggling location services');
|
|
272
|
-
const isGpsEnabled = await this.isLocationServicesEnabled();
|
|
273
|
-
this.log.debug(`Current GPS state: ${isGpsEnabled}. ` +
|
|
274
|
-
`The service is going to be ${isGpsEnabled ? 'disabled' : 'enabled'}`);
|
|
275
|
-
await this.adb.toggleGPSLocationProvider(!isGpsEnabled);
|
|
276
|
-
};
|
|
277
|
-
helpers.wrapBootstrapDisconnect = async function wrapBootstrapDisconnect(wrapped) {
|
|
278
|
-
if (!this.bootstrap) {
|
|
279
|
-
return await wrapped();
|
|
280
|
-
}
|
|
281
|
-
this.bootstrap.ignoreUnexpectedShutdown = true;
|
|
282
|
-
try {
|
|
283
|
-
await wrapped();
|
|
284
|
-
await this.adb.restart();
|
|
285
|
-
await this.bootstrap.start(this.opts.appPackage, this.opts.disableAndroidWatchers, this.opts.acceptSslCerts);
|
|
286
|
-
}
|
|
287
|
-
finally {
|
|
288
|
-
this.bootstrap.ignoreUnexpectedShutdown = false;
|
|
289
|
-
}
|
|
290
|
-
};
|
|
291
|
-
Object.assign(extensions, commands, helpers);
|
|
292
|
-
exports.default = extensions;
|
|
293
251
|
//# sourceMappingURL=network.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network.js","sourceRoot":"","sources":["../../../lib/commands/network.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"network.js","sourceRoot":"","sources":["../../../lib/commands/network.js"],"names":[],"mappings":";AAAA,YAAY;;;;;AAEZ,qCAA+B;AAC/B,oDAAuB;AACvB,0CAAqC;AACrC,4CAAoC;AACpC,wDAAyB;AAEzB,MAAM,kBAAkB,GAAG,KAAK,CAAC;AACjC,MAAM,SAAS,GAAG,KAAK,CAAC;AACxB,MAAM,SAAS,GAAG,KAAK,CAAC;AACxB,mDAAmD;AACnD,yEAAyE;AACzE,6DAA6D;AAC7D,0EAA0E;AAC1E,qHAAqH;AACrH,MAAM,WAAW,GAAG,MAAM,CAAC,SAAS,CAAC;AACrC,MAAM,aAAa,GAAG,MAAM,CAAC;AAC7B,MAAM,aAAa,GAAG,MAAM,CAAC;AAC7B,MAAM,sBAAsB,GAAG,cAAc,CAAC;AAC9C,MAAM,uBAAuB,GAAG,oBAAoB,CAAC,CAAC;IACpD,aAAa;IACb,aAAa;IACb,sBAAsB;CACvB,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,YAAY,GAAG;IACnB,KAAK,CAAC,oBAAoB;QACxB,MAAM,GAAG,GAAG,kBAAkB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC1C,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;QAC5C,IAAI,cAAc,GAAG,MAAM,GAAG,CAAC,gBAAgB,EAAE,CAAC;QAClD,IAAI,UAAU,GAAG,cAAc,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;QAEzD,4DAA4D;QAC5D,IAAI,CAAC,cAAc,EAAE;YACnB,IAAI,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnC,UAAU,IAAI,MA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