Skip to content

Commit e19ac64

Browse files
a-enSrinivasanTarget
authored andcommitted
Update AndroidMobileCapabilityType (#1238)
* missing capabilities added * minor updates * fixed checkstyle complaints * for list of caps added version since cap is available * changed description for 'autoLaunch' capability
1 parent 9fb06b1 commit e19ac64

File tree

1 file changed

+173
-1
lines changed

1 file changed

+173
-1
lines changed

src/main/java/io/appium/java_client/remote/AndroidMobileCapabilityType.java

Lines changed: 173 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public interface AndroidMobileCapabilityType extends CapabilityType {
5757

5858
/**
5959
* Timeout in milliseconds used to wait for the appWaitActivity to launch (default 20000).
60+
* @since 1.6.0
6061
*/
6162
String APP_WAIT_DURATION = "appWaitDuration";
6263

@@ -65,12 +66,24 @@ public interface AndroidMobileCapabilityType extends CapabilityType {
6566
*/
6667
String DEVICE_READY_TIMEOUT = "deviceReadyTimeout";
6768

69+
/**
70+
* Allow to install a test package which has {@code android:testOnly="true"} in the manifest.
71+
* {@code false} by default
72+
*/
73+
String ALLOW_TEST_PACKAGES = "allowTestPackages";
74+
6875
/**
6976
* Fully qualified instrumentation class. Passed to -w in adb shell
7077
* am instrument -e coverage true -w.
7178
*/
7279
String ANDROID_COVERAGE = "androidCoverage";
7380

81+
/**
82+
* A broadcast action implemented by yourself which is used to dump coverage into file system.
83+
* Passed to -a in adb shell am broadcast -a
84+
*/
85+
String ANDROID_COVERAGE_END_INTENT = "androidCoverageEndIntent";
86+
7487
/**
7588
* (Chrome and webview only) Enable Chromedriver's performance logging (default false).
7689
*
@@ -97,9 +110,17 @@ public interface AndroidMobileCapabilityType extends CapabilityType {
97110

98111
/**
99112
* Timeout in milliseconds used to wait for an apk to install to the device. Defaults to `90000`.
113+
* @since 1.6.0
100114
*/
101115
String ANDROID_INSTALL_TIMEOUT = "androidInstallTimeout";
102116

117+
/**
118+
* The name of the directory on the device in which the apk will be push before install.
119+
* Defaults to {@code /data/local/tmp}
120+
* @since 1.6.5
121+
*/
122+
String ANDROID_INSTALL_PATH = "androidInstallPath";
123+
103124
/**
104125
* Name of avd to launch.
105126
*/
@@ -108,12 +129,14 @@ public interface AndroidMobileCapabilityType extends CapabilityType {
108129
/**
109130
* How long to wait in milliseconds for an avd to launch and connect to
110131
* ADB (default 120000).
132+
* @since 0.18.0
111133
*/
112134
String AVD_LAUNCH_TIMEOUT = "avdLaunchTimeout";
113135

114136
/**
115137
* How long to wait in milliseconds for an avd to finish its
116138
* boot animations (default 120000).
139+
* @since 0.18.0
117140
*/
118141
String AVD_READY_TIMEOUT = "avdReadyTimeout";
119142

@@ -154,8 +177,59 @@ public interface AndroidMobileCapabilityType extends CapabilityType {
154177
*/
155178
String CHROMEDRIVER_EXECUTABLE = "chromedriverExecutable";
156179

180+
/**
181+
* An array of arguments to be passed to the chromedriver binary when it's run by Appium.
182+
* By default no CLI args are added beyond what Appium uses internally (such as {@code --url-base}, {@code --port},
183+
* {@code --adb-port}, and {@code --log-path}.
184+
* @since 1.12.0
185+
*/
186+
String CHROMEDRIVER_ARGS = "chromedriverArgs";
187+
188+
/**
189+
* The absolute path to a directory to look for Chromedriver executables in, for automatic discovery of compatible
190+
* Chromedrivers. Ignored if {@code chromedriverUseSystemExecutable} is {@code true}
191+
* @since 1.8.0
192+
*/
193+
String CHROMEDRIVER_EXECUTABLE_DIR = "chromedriverExecutableDir";
194+
195+
/**
196+
* The absolute path to a file which maps Chromedriver versions to the minimum Chrome that it supports.
197+
* Ignored if {@code chromedriverUseSystemExecutable} is {@code true}
198+
* @since 1.8.0
199+
*/
200+
String CHROMEDRIVER_CHROME_MAPPING_FILE = "chromedriverChromeMappingFile";
201+
202+
/**
203+
* If true, bypasses automatic Chromedriver configuration and uses the version that comes downloaded with Appium.
204+
* Ignored if {@code chromedriverExecutable} is set. Defaults to {@code false}
205+
* @since 1.9.0
206+
*/
207+
String CHROMEDRIVER_USE_SYSTEM_EXECUTABLE = "chromedriverUseSystemExecutable";
208+
209+
/**
210+
* Numeric port to start Chromedriver on. Note that use of this capability is discouraged as it will cause undefined
211+
* behavior in case there are multiple webviews present. By default Appium will find a free port.
212+
*/
213+
String CHROMEDRIVER_PORT = "chromedriverPort";
214+
215+
/**
216+
* A list of valid ports for Appium to use for communication with Chromedrivers. This capability supports multiple
217+
* webview scenarios. The form of this capability is an array of numeric ports, where array items can themselves be
218+
* arrays of length 2, where the first element is the start of an inclusive range and the second is the end.
219+
* By default, Appium will use any free port.
220+
* @since 1.13.0
221+
*/
222+
String CHROMEDRIVER_PORTS = "chromedriverPorts";
223+
224+
/**
225+
* Sets the chromedriver flag {@code --disable-build-check} for Chrome webview tests.
226+
* @since 1.11.0
227+
*/
228+
String CHROMEDRIVER_DISABLE_BUILD_CHECK = "chromedriverDisableBuildCheck";
229+
157230
/**
158231
* Amount of time to wait for Webview context to become active, in ms. Defaults to 2000.
232+
* @since 1.5.2
159233
*/
160234
String AUTO_WEBVIEW_TIMEOUT = "autoWebviewTimeout";
161235

@@ -190,11 +264,13 @@ public interface AndroidMobileCapabilityType extends CapabilityType {
190264
* the test app using adb. In other words, with dontStopAppOnReset set to true,
191265
* we will not include the -S flag in the adb shell am start call.
192266
* With this capability omitted or set to false, we include the -S flag. Default false
267+
* @since 1.4.0
193268
*/
194269
String DONT_STOP_APP_ON_RESET = "dontStopAppOnReset";
195270

196271
/**
197272
* Enable Unicode input, default false.
273+
* @since 1.2.0
198274
*/
199275
String UNICODE_KEYBOARD = "unicodeKeyboard";
200276

@@ -207,6 +283,7 @@ public interface AndroidMobileCapabilityType extends CapabilityType {
207283
/**
208284
* Skip checking and signing of app with debug keys, will work only with
209285
* UiAutomator and not with selendroid, default false.
286+
* @since 1.2.2
210287
*/
211288
String NO_SIGN = "noSign";
212289

@@ -223,6 +300,7 @@ public interface AndroidMobileCapabilityType extends CapabilityType {
223300
* Disables android watchers that watch for application not responding and application crash,
224301
* this will reduce cpu usage on android device/emulator. This capability will work only with
225302
* UiAutomator and not with selendroid, default false.
303+
* @since 1.4.0
226304
*/
227305
String DISABLE_ANDROID_WATCHERS = "disableAndroidWatchers";
228306

@@ -243,25 +321,65 @@ public interface AndroidMobileCapabilityType extends CapabilityType {
243321
/**
244322
* In a web context, use native (adb) method for taking a screenshot, rather than proxying
245323
* to ChromeDriver, default false.
324+
* @since 1.5.3
246325
*/
247326
String NATIVE_WEB_SCREENSHOT = "nativeWebScreenshot";
248327

249328
/**
250329
* The name of the directory on the device in which the screenshot will be put.
251330
* Defaults to /data/local/tmp.
331+
* @since 1.6.0
252332
*/
253333
String ANDROID_SCREENSHOT_PATH = "androidScreenshotPath";
254334

335+
/**
336+
* Set the network speed emulation. Specify the maximum network upload and download speeds. Defaults to {@code full}
337+
*/
338+
String NETWORK_SPEED = "networkSpeed";
339+
340+
/**
341+
* Toggle gps location provider for emulators before starting the session. By default the emulator will have this
342+
* option enabled or not according to how it has been provisioned.
343+
*/
344+
String GPS_ENABLED = "gpsEnabled";
345+
346+
/**
347+
* Set this capability to {@code true} to run the Emulator headless when device display is not needed to be visible.
348+
* {@code false} is the default value. isHeadless is also support for iOS, check XCUITest-specific capabilities.
349+
*/
350+
String IS_HEADLESS = "isHeadless";
351+
352+
/**
353+
* Timeout in milliseconds used to wait for adb command execution. Defaults to {@code 20000}
354+
*/
355+
String ADB_EXEC_TIMEOUT = "adbExecTimeout";
356+
357+
/**
358+
* Sets the locale <a href="https://developer.android.com/reference/java/util/Locale>script</a>.
359+
* @since 1.10.0
360+
*/
361+
String LOCALE_SCRIPT = "localeScript";
362+
363+
/**
364+
* Skip device initialization which includes i.a.: installation and running of Settings app or setting of
365+
* permissions. Can be used to improve startup performance when the device was already used for automation and
366+
* it's prepared for the next automation. Defaults to {@code false}
367+
* @since 1.11.0
368+
*/
369+
String SKIP_DEVICE_INITIALIZATION = "skipDeviceInitialization";
370+
255371
/**
256372
* Have Appium automatically determine which permissions your app requires and
257-
* grant them to the app on install. Defaults to false.
373+
* grant them to the app on install. Defaults to {@code false}. If noReset is {@code true}, this capability doesn't
374+
* work.
258375
*/
259376
String AUTO_GRANT_PERMISSIONS = "autoGrantPermissions";
260377

261378
/**
262379
* Allow for correct handling of orientation on landscape-oriented devices.
263380
* Set to {@code true} to basically flip the meaning of {@code PORTRAIT} and {@code LANDSCAPE}.
264381
* Defaults to {@code false}.
382+
* @since 1.6.4
265383
*/
266384
String ANDROID_NATURAL_ORIENTATION = "androidNaturalOrientation";
267385

@@ -276,4 +394,58 @@ public interface AndroidMobileCapabilityType extends CapabilityType {
276394
* Parallel Testing Setup Guide</a> for more details.
277395
*/
278396
String SYSTEM_PORT = "systemPort";
397+
398+
/**
399+
* Optional remote ADB server host.
400+
* @since 1.7.0
401+
*/
402+
String REMOTE_ADB_HOST = "remoteAdbHost";
403+
404+
/**
405+
* Skips unlock during session creation. Defaults to {@code false}
406+
*/
407+
String SKIP_UNLOCK = "skipUnlock";
408+
409+
/**
410+
* Unlock the target device with particular lock pattern instead of just waking up the device with a helper app.
411+
* It works with {@code unlockKey} capability. Defaults to undefined. {@code fingerprint} is available only for
412+
* Android 6.0+ and emulators.
413+
* Read <a href="https://github.com/appium/appium-android-driver/blob/master/docs/UNLOCK.md">unlock doc</a> in
414+
* android driver.
415+
*/
416+
String UNLOCK_TYPE = "unlockType";
417+
418+
/**
419+
* A key pattern to unlock used by {@code unlockType}.
420+
*/
421+
String UNLOCK_KEY = "unlockKey";
422+
423+
/**
424+
* Initializing the app under test automatically.
425+
* Appium does not launch the app under test if this is {@code false}. Defaults to {@code true}
426+
*/
427+
String AUTO_LAUNCH = "autoLaunch";
428+
429+
/**
430+
* Skips to start capturing logcat. It might improve performance such as network.
431+
* Log related commands will not work. Defaults to {@code false}.
432+
* @since 1.12.0
433+
*/
434+
String SKIP_LOGCAT_CAPTURE = "skipLogcatCapture";
435+
436+
/**
437+
* A package, list of packages or * to uninstall package/s before installing apks for test.
438+
* {@code '*'} uninstall all of thrid-party packages except for packages which is necessary for Appium to test such
439+
* as {@code io.appium.settings} or {@code io.appium.uiautomator2.server} since Appium already contains the logic to
440+
* manage them.
441+
* @since 1.12.0
442+
*/
443+
String UNINSTALL_OTHER_PACKAGES = "uninstallOtherPackages";
444+
445+
/**
446+
* Set device animation scale zero if the value is {@code true}. After session is complete, Appium restores the
447+
* animation scale to it's original value. Defaults to {@code false}
448+
* @since 1.9.0
449+
*/
450+
String DISABLE_WINDOW_ANIMATION = "disableWindowAnimation";
279451
}

0 commit comments

Comments
 (0)