Skip to content

Commit 2a847cf

Browse files
committed
modify default arg
1 parent 2032273 commit 2a847cf

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

lib/commands/app-management.js

+14
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,20 @@ export async function background(seconds) {
345345
return await this.adb.startApp(args);
346346
}
347347

348+
/**
349+
* Puts the app to background and waits the given number of seconds then restores the app
350+
* if necessary. The call is blocking.
351+
*
352+
* @this {AndroidDriver}
353+
* @param {number} [seconds=-1] The amount of seconds to wait between putting the app to background and restoring it.
354+
* Any negative value means to not restore the app after putting it to background.
355+
* @returns {Promise<void>}
356+
*/
357+
export async function mobileBackgroundApp (seconds = -1) {
358+
await this.background(seconds);
359+
}
360+
361+
348362
/**
349363
* @this {AndroidDriver}
350364
* @param {import('../driver').AndroidDriverOpts?} [opts=null]

lib/driver.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ import {
7171
installAUT,
7272
resetAUT,
7373
background,
74+
mobileBackgroundApp,
7475
getCurrentActivity,
7576
getCurrentPackage,
7677
mobileClearApp,
@@ -413,7 +414,7 @@ class AndroidDriver
413414
activateApp = activateApp;
414415
queryAppState = queryAppState;
415416
isAppInstalled = isAppInstalled;
416-
mobileBackgroundApp = background;
417+
mobileBackgroundApp = mobileBackgroundApp;
417418

418419
mobileGetUiMode = mobileGetUiMode;
419420
mobileSetUiMode = mobileSetUiMode;

0 commit comments

Comments
 (0)