appium-android-driver 7.1.1 → 7.1.3
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 +14 -0
- package/build/lib/commands/actions.js +13 -13
- package/build/lib/commands/actions.js.map +1 -1
- package/build/lib/commands/app-management.d.ts.map +1 -1
- package/build/lib/commands/app-management.js +14 -17
- package/build/lib/commands/app-management.js.map +1 -1
- package/build/lib/commands/context.js +5 -9
- package/build/lib/commands/context.js.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.js +2 -2
- package/build/lib/commands/element.js.map +1 -1
- package/build/lib/commands/file-actions.d.ts.map +1 -1
- package/build/lib/commands/file-actions.js +14 -16
- package/build/lib/commands/file-actions.js.map +1 -1
- package/build/lib/commands/general.d.ts.map +1 -1
- package/build/lib/commands/general.js +23 -27
- package/build/lib/commands/general.js.map +1 -1
- package/build/lib/commands/ime.d.ts.map +1 -1
- package/build/lib/commands/ime.js +6 -7
- package/build/lib/commands/ime.js.map +1 -1
- package/build/lib/commands/intent.js +7 -7
- package/build/lib/commands/intent.js.map +1 -1
- package/build/lib/commands/log.d.ts.map +1 -1
- package/build/lib/commands/log.js +2 -3
- package/build/lib/commands/log.js.map +1 -1
- package/build/lib/commands/media-projection.d.ts.map +1 -1
- package/build/lib/commands/media-projection.js +6 -9
- package/build/lib/commands/media-projection.js.map +1 -1
- package/build/lib/commands/network.d.ts.map +1 -1
- package/build/lib/commands/network.js +30 -37
- package/build/lib/commands/network.js.map +1 -1
- package/build/lib/commands/performance.js +5 -5
- package/build/lib/commands/performance.js.map +1 -1
- package/build/lib/commands/permissions.d.ts.map +1 -1
- package/build/lib/commands/permissions.js +9 -12
- package/build/lib/commands/permissions.js.map +1 -1
- package/build/lib/commands/recordscreen.d.ts.map +1 -1
- package/build/lib/commands/recordscreen.js +8 -10
- package/build/lib/commands/recordscreen.js.map +1 -1
- package/build/lib/commands/shell.d.ts.map +1 -1
- package/build/lib/commands/shell.js +3 -4
- package/build/lib/commands/shell.js.map +1 -1
- package/build/lib/commands/streamscreen.d.ts.map +1 -1
- package/build/lib/commands/streamscreen.js +3 -4
- package/build/lib/commands/streamscreen.js.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/touch.js +1 -1
- package/build/lib/commands/touch.js.map +1 -1
- package/build/lib/driver.d.ts +1 -1
- package/build/lib/driver.d.ts.map +1 -1
- package/lib/commands/actions.js +13 -13
- package/lib/commands/app-management.js +14 -17
- package/lib/commands/context.js +7 -7
- package/lib/commands/deviceidle.js +1 -1
- package/lib/commands/element.js +2 -2
- package/lib/commands/file-actions.js +14 -16
- package/lib/commands/general.js +23 -26
- package/lib/commands/ime.js +6 -7
- package/lib/commands/intent.js +7 -7
- package/lib/commands/log.js +2 -3
- package/lib/commands/media-projection.js +6 -9
- package/lib/commands/network.js +30 -37
- package/lib/commands/performance.js +5 -5
- package/lib/commands/permissions.js +9 -11
- package/lib/commands/recordscreen.js +8 -10
- package/lib/commands/shell.js +3 -4
- package/lib/commands/streamscreen.js +3 -4
- package/lib/commands/system-bars.js +2 -2
- package/lib/commands/touch.js +1 -1
- package/lib/driver.ts +1 -1
- package/package.json +1 -1
|
@@ -205,8 +205,7 @@ async function terminateBackgroundScreenRecording(adb, force = true) {
|
|
|
205
205
|
*/
|
|
206
206
|
const RecordScreenMixin = {
|
|
207
207
|
async startRecordingScreen(options = {}) {
|
|
208
|
-
|
|
209
|
-
await verifyScreenRecordIsSupported(adb, this.isEmulator());
|
|
208
|
+
await verifyScreenRecordIsSupported(this.adb, this.isEmulator());
|
|
210
209
|
|
|
211
210
|
let result = '';
|
|
212
211
|
const {
|
|
@@ -220,7 +219,7 @@ const RecordScreenMixin = {
|
|
|
220
219
|
result = await this.stopRecordingScreen(options);
|
|
221
220
|
}
|
|
222
221
|
|
|
223
|
-
if (await terminateBackgroundScreenRecording(adb, true)) {
|
|
222
|
+
if (await terminateBackgroundScreenRecording(this.adb, true)) {
|
|
224
223
|
this.log.warn(
|
|
225
224
|
`There were some ${SCREENRECORD_BINARY} process leftovers running ` +
|
|
226
225
|
`in the background. Make sure you stop screen recording each time after it is started, ` +
|
|
@@ -231,7 +230,7 @@ const RecordScreenMixin = {
|
|
|
231
230
|
if (!_.isEmpty(this._screenRecordingProperties)) {
|
|
232
231
|
// XXX: this doesn't need to be done in serial, does it?
|
|
233
232
|
for (const record of this._screenRecordingProperties.records || []) {
|
|
234
|
-
await
|
|
233
|
+
await this.adb.rimraf(record);
|
|
235
234
|
}
|
|
236
235
|
this._screenRecordingProperties = undefined;
|
|
237
236
|
}
|
|
@@ -255,20 +254,19 @@ const RecordScreenMixin = {
|
|
|
255
254
|
recordingProcess: null,
|
|
256
255
|
stopped: false,
|
|
257
256
|
};
|
|
258
|
-
await scheduleScreenRecord(adb, this._screenRecordingProperties, this.log);
|
|
257
|
+
await scheduleScreenRecord(this.adb, this._screenRecordingProperties, this.log);
|
|
259
258
|
return result;
|
|
260
259
|
},
|
|
261
260
|
|
|
262
261
|
async stopRecordingScreen(options = {}) {
|
|
263
|
-
|
|
264
|
-
await verifyScreenRecordIsSupported(adb, this.isEmulator());
|
|
262
|
+
await verifyScreenRecordIsSupported(this.adb, this.isEmulator());
|
|
265
263
|
|
|
266
264
|
if (!_.isEmpty(this._screenRecordingProperties)) {
|
|
267
265
|
this._screenRecordingProperties.stopped = true;
|
|
268
266
|
}
|
|
269
267
|
|
|
270
268
|
try {
|
|
271
|
-
await terminateBackgroundScreenRecording(adb, false);
|
|
269
|
+
await terminateBackgroundScreenRecording(this.adb, false);
|
|
272
270
|
} catch (err) {
|
|
273
271
|
this.log.warn(/** @type {Error} */ (err).message);
|
|
274
272
|
if (!_.isEmpty(this._screenRecordingProperties)) {
|
|
@@ -313,8 +311,8 @@ const RecordScreenMixin = {
|
|
|
313
311
|
for (const pathOnDevice of this._screenRecordingProperties.records) {
|
|
314
312
|
const relativePath = path.resolve(tmpRoot, path.posix.basename(pathOnDevice));
|
|
315
313
|
localRecords.push(relativePath);
|
|
316
|
-
await adb.pull(pathOnDevice, relativePath);
|
|
317
|
-
await adb.rimraf(pathOnDevice);
|
|
314
|
+
await this.adb.pull(pathOnDevice, relativePath);
|
|
315
|
+
await this.adb.rimraf(pathOnDevice);
|
|
318
316
|
}
|
|
319
317
|
let resultFilePath = /** @type {string} */ (_.last(localRecords));
|
|
320
318
|
if (localRecords.length > 1) {
|
package/lib/commands/shell.js
CHANGED
|
@@ -14,7 +14,6 @@ import {mixin} from './mixins';
|
|
|
14
14
|
const ShellMixin = {
|
|
15
15
|
async mobileShell(opts) {
|
|
16
16
|
this.ensureFeatureEnabled(ADB_SHELL_FEATURE);
|
|
17
|
-
const adb = /** @type {ADB} */ (this.adb);
|
|
18
17
|
const {
|
|
19
18
|
command,
|
|
20
19
|
args = /** @type {string[]} */ ([]),
|
|
@@ -26,10 +25,10 @@ const ShellMixin = {
|
|
|
26
25
|
throw new errors.InvalidArgumentError(`The 'command' argument is mandatory`);
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
const adbArgs = [...adb.executable.defaultArgs, 'shell', command, ..._.castArray(args)];
|
|
30
|
-
this.log.debug(`Running '${adb.executable.path} ${util.quote(adbArgs)}'`);
|
|
28
|
+
const adbArgs = [...this.adb.executable.defaultArgs, 'shell', command, ..._.castArray(args)];
|
|
29
|
+
this.log.debug(`Running '${this.adb.executable.path} ${util.quote(adbArgs)}'`);
|
|
31
30
|
try {
|
|
32
|
-
const {stdout, stderr} = await exec(adb.executable.path, adbArgs, {timeout});
|
|
31
|
+
const {stdout, stderr} = await exec(this.adb.executable.path, adbArgs, {timeout});
|
|
33
32
|
if (includeStderr) {
|
|
34
33
|
return {
|
|
35
34
|
stdout,
|
|
@@ -336,9 +336,8 @@ const StreamScreenMixin = {
|
|
|
336
336
|
considerRotation = false,
|
|
337
337
|
logPipelineDetails = false,
|
|
338
338
|
} = options;
|
|
339
|
-
const adb = /** @type {ADB} */ (this.adb);
|
|
340
339
|
if (_.isUndefined(this._screenStreamingProps)) {
|
|
341
|
-
await verifyStreamingRequirements(adb);
|
|
340
|
+
await verifyStreamingRequirements(this.adb);
|
|
342
341
|
}
|
|
343
342
|
if (!_.isEmpty(this._screenStreamingProps)) {
|
|
344
343
|
this.log.info(
|
|
@@ -362,8 +361,8 @@ const StreamScreenMixin = {
|
|
|
362
361
|
}
|
|
363
362
|
this._screenStreamingProps = undefined;
|
|
364
363
|
|
|
365
|
-
const deviceInfo = await getDeviceInfo(adb, this.log);
|
|
366
|
-
const deviceStreamingProc = await initDeviceStreamingProc(adb, this.log, deviceInfo, {
|
|
364
|
+
const deviceInfo = await getDeviceInfo(this.adb, this.log);
|
|
365
|
+
const deviceStreamingProc = await initDeviceStreamingProc(this.adb, this.log, deviceInfo, {
|
|
367
366
|
width,
|
|
368
367
|
height,
|
|
369
368
|
bitRate,
|
|
@@ -121,7 +121,7 @@ const SystemBarsMixin = {
|
|
|
121
121
|
/** @type {string} */
|
|
122
122
|
let stdout;
|
|
123
123
|
try {
|
|
124
|
-
stdout = await
|
|
124
|
+
stdout = await this.adb.shell(['dumpsys', 'window', 'windows']);
|
|
125
125
|
} catch (e) {
|
|
126
126
|
throw new Error(
|
|
127
127
|
`Cannot retrieve system bars details. Original error: ${/** @type {Error} */ (e).message}`
|
|
@@ -140,7 +140,7 @@ const SystemBarsMixin = {
|
|
|
140
140
|
* @returns
|
|
141
141
|
*/
|
|
142
142
|
const toStatusBarCommandCallable = (cmd, argsCallable) => async () =>
|
|
143
|
-
await
|
|
143
|
+
await this.adb.shell([
|
|
144
144
|
'cmd',
|
|
145
145
|
'statusbar',
|
|
146
146
|
cmd,
|
package/lib/commands/touch.js
CHANGED
|
@@ -98,7 +98,7 @@ const TouchMixin = {
|
|
|
98
98
|
endY += y || 0;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
let apiLevel = await
|
|
101
|
+
let apiLevel = await this.adb.getApiLevel();
|
|
102
102
|
// lollipop takes a little longer to get things rolling
|
|
103
103
|
let duration = apiLevel >= 5 ? 2 : 1;
|
|
104
104
|
// make sure that if the long press has a duration, we use it.
|
package/lib/driver.ts
CHANGED