File tree 2 files changed +16
-1
lines changed
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -345,6 +345,20 @@ export async function background(seconds) {
345
345
return await this . adb . startApp ( args ) ;
346
346
}
347
347
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
+
348
362
/**
349
363
* @this {AndroidDriver}
350
364
* @param {import('../driver').AndroidDriverOpts? } [opts=null]
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ import {
71
71
installAUT ,
72
72
resetAUT ,
73
73
background ,
74
+ mobileBackgroundApp ,
74
75
getCurrentActivity ,
75
76
getCurrentPackage ,
76
77
mobileClearApp ,
@@ -413,7 +414,7 @@ class AndroidDriver
413
414
activateApp = activateApp ;
414
415
queryAppState = queryAppState ;
415
416
isAppInstalled = isAppInstalled ;
416
- mobileBackgroundApp = background ;
417
+ mobileBackgroundApp = mobileBackgroundApp ;
417
418
418
419
mobileGetUiMode = mobileGetUiMode ;
419
420
mobileSetUiMode = mobileSetUiMode ;
You can’t perform that action at this time.
0 commit comments