From a85364b24bb322578400ed3a7040fc3373f74c98 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Tue, 18 Oct 2022 23:27:14 -0700 Subject: [PATCH] feat: add skipping app state check in terminateApp when the given timeout is zero (#827) --- README.md | 9 +++++++-- package.json | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 59634a608..6f5f54d8b 100644 --- a/README.md +++ b/README.md @@ -856,14 +856,19 @@ True is the app has been found on the device and successfully removed. Otherwise ### mobile: terminateApp -Terminates the app if it is running. +Terminates the app and waits until the app is terminated up to the given timeout +by checking the app state to ensure if the app process is actually stopped. + +The app state check can be skipped if the given timeout is lower or equal to zero since Espresso driver 2.13.0. +The skip helps when you want to terminate the app process but do not want to check the process existence +because the app under test may, for example, restart it automatically. #### Arguments Name | Type | Required | Description | Example --- | --- | --- | --- | --- appId | string | yes | The identifier of the application package to be terminated | `my.app.id` -timeout | number | no | The count of milliseconds to wait until the app is terminated. 500ms by default. | 1500 +timeout | number | no | The count of milliseconds to wait until the app is terminated. 500ms by default. | 1500, 0 #### Returned Result diff --git a/package.json b/package.json index 167310937..a0d8a0781 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "dependencies": { "@babel/runtime": "^7.4.3", "appium-adb": "^9.10.2", - "appium-android-driver": "^5.4.0", + "appium-android-driver": "^5.6.0", "asyncbox": "^2.3.1", "bluebird": "^3.5.0", "lodash": "^4.17.11",