From eea48b144d1f5f8623898f3469836cd882f2ca24 Mon Sep 17 00:00:00 2001 From: a-en Date: Mon, 16 Sep 2019 22:50:06 +0300 Subject: [PATCH 1/5] missing capabilities added --- .../remote/AndroidMobileCapabilityType.java | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) diff --git a/src/main/java/io/appium/java_client/remote/AndroidMobileCapabilityType.java b/src/main/java/io/appium/java_client/remote/AndroidMobileCapabilityType.java index ad1a792ec..8eea15bc4 100644 --- a/src/main/java/io/appium/java_client/remote/AndroidMobileCapabilityType.java +++ b/src/main/java/io/appium/java_client/remote/AndroidMobileCapabilityType.java @@ -65,12 +65,24 @@ public interface AndroidMobileCapabilityType extends CapabilityType { */ String DEVICE_READY_TIMEOUT = "deviceReadyTimeout"; + /** + * Allow to install a test package which has {@code android:testOnly="true"} in the manifest. + * {@code false} by default + */ + String ALLOW_TEST_PACKAGES = "allowTestPackages"; + /** * Fully qualified instrumentation class. Passed to -w in adb shell * am instrument -e coverage true -w. */ String ANDROID_COVERAGE = "androidCoverage"; + /** + * A broadcast action implemented by yourself which is used to dump coverage into file system. + * Passed to -a in adb shell am broadcast -a + */ + String ANDROID_COVERAGE_END_INTENT = "androidCoverageEndIntent"; + /** * (Chrome and webview only) Enable Chromedriver's performance logging (default false). * @@ -100,6 +112,12 @@ public interface AndroidMobileCapabilityType extends CapabilityType { */ String ANDROID_INSTALL_TIMEOUT = "androidInstallTimeout"; + /** + * The name of the directory on the device in which the apk will be push before install. + * Defaults to {@code /data/local/tmp} + */ + String ANDROID_INSTALL_PATH = "androidInstallPath"; + /** * Name of avd to launch. */ @@ -154,6 +172,50 @@ public interface AndroidMobileCapabilityType extends CapabilityType { */ String CHROMEDRIVER_EXECUTABLE = "chromedriverExecutable"; + /** + * An array of arguments to be passed to the chromedriver binary when it's run by Appium. + * By default no CLI args are added beyond what Appium uses internally (such as {@code --url-base}, {@code --port}, + * {@code --adb-port}, and {@code --log-path}. + */ + String CHROMEDRIVER_ARGS = "chromedriverArgs"; + + /** + * The absolute path to a directory to look for Chromedriver executables in, for automatic discovery of compatible + * Chromedrivers. Ignored if {@code chromedriverUseSystemExecutable} is {@code true} + */ + String CHROMEDRIVER_EXECUTABLE_DIR = "chromedriverExecutableDir"; + + /** + * The absolute path to a file which maps Chromedriver versions to the minimum Chrome that it supports. + * Ignored if {@code chromedriverUseSystemExecutable} is {@code true} + */ + String CHROMEDRIVER_CHROME_MAPPING_FILE = "chromedriverChromeMappingFile"; + + /** + * If true, bypasses automatic Chromedriver configuration and uses the version that comes downloaded with Appium. + * Ignored if {@code chromedriverExecutable} is set. Defaults to {@code false} + */ + String CHROMEDRIVER_USE_SYSTEM_EXECUTABLE = "chromedriverUseSystemExecutable"; + + /** + * Numeric port to start Chromedriver on. Note that use of this capability is discouraged as it will cause undefined + * behavior in case there are multiple webviews present. By default Appium will find a free port. + */ + String CHROMEDRIVER_PORT = "chromedriverPort"; + + /** + * A list of valid ports for Appium to use for communication with Chromedrivers. This capability supports multiple + * webview scenarios. The form of this capability is an array of numeric ports, where array items can themselves be + * arrays of length 2, where the first element is the start of an inclusive range and the second is the end. + * By default, Appium will use any free port. + */ + String CHROMEDRIVER_PORTS = "chromedriverPorts"; + + /** + * Sets the chromedriver flag {@code --disable-build-check} for Chrome webview tests + */ + String CHROMEDRIVER_DISABLE_BUILD_CHECK = "chromedriverDisableBuildCheck"; + /** * Amount of time to wait for Webview context to become active, in ms. Defaults to 2000. */ @@ -252,6 +314,40 @@ public interface AndroidMobileCapabilityType extends CapabilityType { */ String ANDROID_SCREENSHOT_PATH = "androidScreenshotPath"; + /** + * Set the network speed emulation. Specify the maximum network upload and download speeds. Defaults to {@code full} + */ + String NETWORK_SPEED = "networkSpeed"; + + /** + * Toggle gps location provider for emulators before starting the session. By default the emulator will have this + * option enabled or not according to how it has been provisioned. + */ + String GPS_ENABLED = "gpsEnabled"; + + /** + * Set this capability to {@code true} to run the Emulator headless when device display is not needed to be visible. + * {@code false} is the default value. isHeadless is also support for iOS, check XCUITest-specific capabilities. + */ + String IS_HEADLESS = "isHeadless"; + + /** + * Timeout in milliseconds used to wait for adb command execution. Defaults to {@code 20000} + */ + String ADB_EXEC_TIMEOUT = "adbExecTimeout"; + + /** + * Sets the locale for more details. */ String SYSTEM_PORT = "systemPort"; + + /** + * Optional remote ADB server host + */ + String REMOTE_ADB_HOST = "remoteAdbHost"; + + /** + * Skips unlock during session creation. Defaults to {@code false} + */ + String SKIP_UNLOCK = "skipUnlock"; + + /** + * Unlock the target device with particular lock pattern instead of just waking up the device with a helper app. + * It works with {@code unlockKey} capability. Defaults to undefined. {@code fingerprint} is available only for + * Android 6.0+ and emulators. + * Read unlock doc in + * android driver. + */ + String UNLOCK_TYPE = "unlockType"; + + /** + * A key pattern to unlock used by {@code unlockType}. + */ + String UNLOCK_KEY = "unlockKey"; + + /** + * Initializing the app under test automatically. + * Appium does not install/launch the app under test if this is {@code false}. Defaults to {@code true} + */ + String AUTO_LAUNCH = "autoLaunch"; + + /** + * Skips to start capturing logcat. It might improve performance such as network. + * Log related commands will not work. Defaults to {@code false}. + */ + String SKIP_LOGCAT_CAPTURE = "skipLogcatCapture"; + + /** + * A package, list of packages or * to uninstall package/s before installing apks for test. + * {@code '*'} uninstall all of thrid-party packages except for packages which is necessary for Appium to test such as + * {@code io.appium.settings} or {@code io.appium.uiautomator2.server} since Appium already contains the logic to + * manage them. + */ + String UNINSTALL_OTHER_PACKAGES = "uninstallOtherPackages"; + + /** + * Set device animation scale zero if the value is true. After session is complete, Appium restores the animation + * scale to it's original value. Defaults to {@code false} + */ + String DISABLE_WINDOW_ANIMATION = "disableWindowAnimation"; } From 0886bce125800eb59cd2975095094f919c03cea6 Mon Sep 17 00:00:00 2001 From: a-en Date: Mon, 16 Sep 2019 23:35:01 +0300 Subject: [PATCH 2/5] minor updates --- .../java_client/remote/AndroidMobileCapabilityType.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/appium/java_client/remote/AndroidMobileCapabilityType.java b/src/main/java/io/appium/java_client/remote/AndroidMobileCapabilityType.java index 8eea15bc4..5a4a79882 100644 --- a/src/main/java/io/appium/java_client/remote/AndroidMobileCapabilityType.java +++ b/src/main/java/io/appium/java_client/remote/AndroidMobileCapabilityType.java @@ -350,7 +350,8 @@ public interface AndroidMobileCapabilityType extends CapabilityType { /** * Have Appium automatically determine which permissions your app requires and - * grant them to the app on install. Defaults to false. + * grant them to the app on install. Defaults to {@code false}. If noReset is {@code true}, this capability doesn't + * work. */ String AUTO_GRANT_PERMISSIONS = "autoGrantPermissions"; @@ -418,8 +419,8 @@ public interface AndroidMobileCapabilityType extends CapabilityType { String UNINSTALL_OTHER_PACKAGES = "uninstallOtherPackages"; /** - * Set device animation scale zero if the value is true. After session is complete, Appium restores the animation - * scale to it's original value. Defaults to {@code false} + * Set device animation scale zero if the value is {@code true}. After session is complete, Appium restores the + * animation scale to it's original value. Defaults to {@code false} */ String DISABLE_WINDOW_ANIMATION = "disableWindowAnimation"; } From b5fa86fb28475e3a25fb6cfecad0e114b275fc9d Mon Sep 17 00:00:00 2001 From: a-en Date: Tue, 17 Sep 2019 00:01:22 +0300 Subject: [PATCH 3/5] fixed checkstyle complaints --- .../remote/AndroidMobileCapabilityType.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/io/appium/java_client/remote/AndroidMobileCapabilityType.java b/src/main/java/io/appium/java_client/remote/AndroidMobileCapabilityType.java index 5a4a79882..1f1b4aaff 100644 --- a/src/main/java/io/appium/java_client/remote/AndroidMobileCapabilityType.java +++ b/src/main/java/io/appium/java_client/remote/AndroidMobileCapabilityType.java @@ -173,8 +173,8 @@ public interface AndroidMobileCapabilityType extends CapabilityType { String CHROMEDRIVER_EXECUTABLE = "chromedriverExecutable"; /** - * An array of arguments to be passed to the chromedriver binary when it's run by Appium. - * By default no CLI args are added beyond what Appium uses internally (such as {@code --url-base}, {@code --port}, + * An array of arguments to be passed to the chromedriver binary when it's run by Appium. + * By default no CLI args are added beyond what Appium uses internally (such as {@code --url-base}, {@code --port}, * {@code --adb-port}, and {@code --log-path}. */ String CHROMEDRIVER_ARGS = "chromedriverArgs"; @@ -212,7 +212,7 @@ public interface AndroidMobileCapabilityType extends CapabilityType { String CHROMEDRIVER_PORTS = "chromedriverPorts"; /** - * Sets the chromedriver flag {@code --disable-build-check} for Chrome webview tests + * Sets the chromedriver flag {@code --disable-build-check} for Chrome webview tests. */ String CHROMEDRIVER_DISABLE_BUILD_CHECK = "chromedriverDisableBuildCheck"; @@ -337,14 +337,14 @@ public interface AndroidMobileCapabilityType extends CapabilityType { String ADB_EXEC_TIMEOUT = "adbExecTimeout"; /** - * Sets the locale script. */ String LOCALE_SCRIPT = "localeScript"; /** - * Skip device initialization which includes i.a.: installation and running of Settings app or setting of - * permissions. Can be used to improve startup performance when the device was already used for automation and - * it's prepared for the next automation. Defaults to {@code false} + * Skip device initialization which includes i.a.: installation and running of Settings app or setting of + * permissions. Can be used to improve startup performance when the device was already used for automation and + * it's prepared for the next automation. Defaults to {@code false} */ String SKIP_DEVICE_INITIALIZATION = "skipDeviceInitialization"; @@ -375,7 +375,7 @@ public interface AndroidMobileCapabilityType extends CapabilityType { String SYSTEM_PORT = "systemPort"; /** - * Optional remote ADB server host + * Optional remote ADB server host. */ String REMOTE_ADB_HOST = "remoteAdbHost"; @@ -412,8 +412,8 @@ public interface AndroidMobileCapabilityType extends CapabilityType { /** * A package, list of packages or * to uninstall package/s before installing apks for test. - * {@code '*'} uninstall all of thrid-party packages except for packages which is necessary for Appium to test such as - * {@code io.appium.settings} or {@code io.appium.uiautomator2.server} since Appium already contains the logic to + * {@code '*'} uninstall all of thrid-party packages except for packages which is necessary for Appium to test such + * as {@code io.appium.settings} or {@code io.appium.uiautomator2.server} since Appium already contains the logic to * manage them. */ String UNINSTALL_OTHER_PACKAGES = "uninstallOtherPackages"; From 4839f7ab6348e1d4ebcc7a8551be40a183096674 Mon Sep 17 00:00:00 2001 From: a-en Date: Tue, 17 Sep 2019 11:36:52 +0300 Subject: [PATCH 4/5] for list of caps added version since cap is available --- .../remote/AndroidMobileCapabilityType.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/main/java/io/appium/java_client/remote/AndroidMobileCapabilityType.java b/src/main/java/io/appium/java_client/remote/AndroidMobileCapabilityType.java index 1f1b4aaff..79d05ad43 100644 --- a/src/main/java/io/appium/java_client/remote/AndroidMobileCapabilityType.java +++ b/src/main/java/io/appium/java_client/remote/AndroidMobileCapabilityType.java @@ -57,6 +57,7 @@ public interface AndroidMobileCapabilityType extends CapabilityType { /** * Timeout in milliseconds used to wait for the appWaitActivity to launch (default 20000). + * @since 1.6.0 */ String APP_WAIT_DURATION = "appWaitDuration"; @@ -109,12 +110,14 @@ public interface AndroidMobileCapabilityType extends CapabilityType { /** * Timeout in milliseconds used to wait for an apk to install to the device. Defaults to `90000`. + * @since 1.6.0 */ String ANDROID_INSTALL_TIMEOUT = "androidInstallTimeout"; /** * The name of the directory on the device in which the apk will be push before install. * Defaults to {@code /data/local/tmp} + * @since 1.6.5 */ String ANDROID_INSTALL_PATH = "androidInstallPath"; @@ -126,12 +129,14 @@ public interface AndroidMobileCapabilityType extends CapabilityType { /** * How long to wait in milliseconds for an avd to launch and connect to * ADB (default 120000). + * @since 0.18.0 */ String AVD_LAUNCH_TIMEOUT = "avdLaunchTimeout"; /** * How long to wait in milliseconds for an avd to finish its * boot animations (default 120000). + * @since 0.18.0 */ String AVD_READY_TIMEOUT = "avdReadyTimeout"; @@ -176,24 +181,28 @@ public interface AndroidMobileCapabilityType extends CapabilityType { * An array of arguments to be passed to the chromedriver binary when it's run by Appium. * By default no CLI args are added beyond what Appium uses internally (such as {@code --url-base}, {@code --port}, * {@code --adb-port}, and {@code --log-path}. + * @since 1.12.0 */ String CHROMEDRIVER_ARGS = "chromedriverArgs"; /** * The absolute path to a directory to look for Chromedriver executables in, for automatic discovery of compatible * Chromedrivers. Ignored if {@code chromedriverUseSystemExecutable} is {@code true} + * @since 1.8.0 */ String CHROMEDRIVER_EXECUTABLE_DIR = "chromedriverExecutableDir"; /** * The absolute path to a file which maps Chromedriver versions to the minimum Chrome that it supports. * Ignored if {@code chromedriverUseSystemExecutable} is {@code true} + * @since 1.8.0 */ String CHROMEDRIVER_CHROME_MAPPING_FILE = "chromedriverChromeMappingFile"; /** * If true, bypasses automatic Chromedriver configuration and uses the version that comes downloaded with Appium. * Ignored if {@code chromedriverExecutable} is set. Defaults to {@code false} + * @since 1.9.0 */ String CHROMEDRIVER_USE_SYSTEM_EXECUTABLE = "chromedriverUseSystemExecutable"; @@ -208,16 +217,19 @@ public interface AndroidMobileCapabilityType extends CapabilityType { * webview scenarios. The form of this capability is an array of numeric ports, where array items can themselves be * arrays of length 2, where the first element is the start of an inclusive range and the second is the end. * By default, Appium will use any free port. + * @since 1.13.0 */ String CHROMEDRIVER_PORTS = "chromedriverPorts"; /** * Sets the chromedriver flag {@code --disable-build-check} for Chrome webview tests. + * @since 1.11.0 */ String CHROMEDRIVER_DISABLE_BUILD_CHECK = "chromedriverDisableBuildCheck"; /** * Amount of time to wait for Webview context to become active, in ms. Defaults to 2000. + * @since 1.5.2 */ String AUTO_WEBVIEW_TIMEOUT = "autoWebviewTimeout"; @@ -252,11 +264,13 @@ public interface AndroidMobileCapabilityType extends CapabilityType { * the test app using adb. In other words, with dontStopAppOnReset set to true, * we will not include the -S flag in the adb shell am start call. * With this capability omitted or set to false, we include the -S flag. Default false + * @since 1.4.0 */ String DONT_STOP_APP_ON_RESET = "dontStopAppOnReset"; /** * Enable Unicode input, default false. + * @since 1.2.0 */ String UNICODE_KEYBOARD = "unicodeKeyboard"; @@ -269,6 +283,7 @@ public interface AndroidMobileCapabilityType extends CapabilityType { /** * Skip checking and signing of app with debug keys, will work only with * UiAutomator and not with selendroid, default false. + * @since 1.2.2 */ String NO_SIGN = "noSign"; @@ -285,6 +300,7 @@ public interface AndroidMobileCapabilityType extends CapabilityType { * Disables android watchers that watch for application not responding and application crash, * this will reduce cpu usage on android device/emulator. This capability will work only with * UiAutomator and not with selendroid, default false. + * @since 1.4.0 */ String DISABLE_ANDROID_WATCHERS = "disableAndroidWatchers"; @@ -305,12 +321,14 @@ public interface AndroidMobileCapabilityType extends CapabilityType { /** * In a web context, use native (adb) method for taking a screenshot, rather than proxying * to ChromeDriver, default false. + * @since 1.5.3 */ String NATIVE_WEB_SCREENSHOT = "nativeWebScreenshot"; /** * The name of the directory on the device in which the screenshot will be put. * Defaults to /data/local/tmp. + * @since 1.6.0 */ String ANDROID_SCREENSHOT_PATH = "androidScreenshotPath"; @@ -338,6 +356,7 @@ public interface AndroidMobileCapabilityType extends CapabilityType { /** * Sets the locale Date: Tue, 17 Sep 2019 11:38:21 +0300 Subject: [PATCH 5/5] changed description for 'autoLaunch' capability --- .../appium/java_client/remote/AndroidMobileCapabilityType.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/appium/java_client/remote/AndroidMobileCapabilityType.java b/src/main/java/io/appium/java_client/remote/AndroidMobileCapabilityType.java index 79d05ad43..a73e9075f 100644 --- a/src/main/java/io/appium/java_client/remote/AndroidMobileCapabilityType.java +++ b/src/main/java/io/appium/java_client/remote/AndroidMobileCapabilityType.java @@ -422,7 +422,7 @@ public interface AndroidMobileCapabilityType extends CapabilityType { /** * Initializing the app under test automatically. - * Appium does not install/launch the app under test if this is {@code false}. Defaults to {@code true} + * Appium does not launch the app under test if this is {@code false}. Defaults to {@code true} */ String AUTO_LAUNCH = "autoLaunch";