Skip to content

Commit 8e04783

Browse files
Takeshi KishiSrinivasanTarget
authored andcommitted
Update javadoc of capabilities to follow latest Appium documents (appium#1204)
* update General capabilities * update Android capabilities * update iOS capabilities * fix headlines * fix reviewed code. * edit Android appWaitActivity docs
1 parent 960caf4 commit 8e04783

File tree

3 files changed

+114
-42
lines changed

3 files changed

+114
-42
lines changed

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

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,39 @@
1919
import org.openqa.selenium.remote.CapabilityType;
2020

2121
/**
22-
* The list of Android-specific capabilities.
23-
* Read:
24-
* https://github.com/appium/appium/blob/1.5/docs/en/writing-running-appium/caps.md#android-only
22+
* The list of Android-specific capabilities. <br>
23+
* Read: <br>
24+
* <a href="https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/caps.md#android-only">
25+
* https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/caps.md#android-only</a>
2526
*/
2627
public interface AndroidMobileCapabilityType extends CapabilityType {
28+
2729
/**
2830
* Activity name for the Android activity you want to launch from your package.
29-
* This often needs to be preceded by a . (e.g., .MainActivity instead of MainActivity).
31+
* This often needs to be preceded by a {@code .} (e.g., {@code .MainActivity}
32+
* instead of {@code MainActivity}). By default this capability is received from the package
33+
* manifest (action: android.intent.action.MAIN , category: android.intent.category.LAUNCHER)
3034
*/
3135
String APP_ACTIVITY = "appActivity";
3236

3337
/**
34-
* Java package of the Android app you want to run.
38+
* Java package of the Android app you want to run. By default this capability is received
39+
* from the package manifest ({@literal @}package attribute value)
3540
*/
3641
String APP_PACKAGE = "appPackage";
3742

3843
/**
39-
* Activity name for the Android activity you want to wait for.
44+
* Activity name/names, comma separated, for the Android activity you want to wait for.
45+
* By default the value of this capability is the same as for {@code appActivity}.
46+
* You must set it to the very first focused application activity name in case it is different
47+
* from the one which is set as {@code appActivity} if your capability has {@code appActivity}
48+
* and {@code appPackage}. You can also use wildcards ({@code *}).
4049
*/
4150
String APP_WAIT_ACTIVITY = "appWaitActivity";
4251

4352
/**
4453
* Java package of the Android app you want to wait for.
54+
* By default the value of this capability is the same as for {@code appActivity}
4555
*/
4656
String APP_WAIT_PACKAGE = "appWaitPackage";
4757

@@ -63,7 +73,10 @@ public interface AndroidMobileCapabilityType extends CapabilityType {
6373

6474
/**
6575
* (Chrome and webview only) Enable Chromedriver's performance logging (default false).
76+
*
77+
* @deprecated move to {@link MobileCapabilityType#ENABLE_PERFORMANCE_LOGGING}
6678
*/
79+
@Deprecated
6780
String ENABLE_PERFORMANCE_LOGGING = "enablePerformanceLogging";
6881

6982
/**
@@ -164,8 +177,9 @@ public interface AndroidMobileCapabilityType extends CapabilityType {
164177
String INTENT_FLAGS = "intentFlags";
165178

166179
/**
167-
* Additional intent arguments that will be used to start activity. See Intent arguments:
168-
* http://developer.android.com/reference/android/content/Intent.html
180+
* Additional intent arguments that will be used to start activity. See
181+
* <a href="https://developer.android.com/reference/android/content/Intent.html">
182+
* Intent arguments</a>.
169183
*/
170184
String OPTIONAL_INTENT_ARGUMENTS = "optionalIntentArguments";
171185

@@ -214,8 +228,9 @@ public interface AndroidMobileCapabilityType extends CapabilityType {
214228

215229
/**
216230
* Allows passing chromeOptions capability for ChromeDriver.
217-
* For more information see chromeOptions:
218-
* https://sites.google.com/a/chromium.org/chromedriver/capabilities
231+
* For more information see
232+
* <a href="https://sites.google.com/a/chromium.org/chromedriver/capabilities">
233+
* chromeOptions</a>.
219234
*/
220235
String CHROME_OPTIONS = "chromeOptions";
221236

@@ -244,13 +259,21 @@ public interface AndroidMobileCapabilityType extends CapabilityType {
244259
String AUTO_GRANT_PERMISSIONS = "autoGrantPermissions";
245260

246261
/**
247-
* Add androidNaturalOrientation capability to allow for correct handling of
248-
* orientation on landscape-oriented devices.
262+
* Allow for correct handling of orientation on landscape-oriented devices.
263+
* Set to {@code true} to basically flip the meaning of {@code PORTRAIT} and {@code LANDSCAPE}.
264+
* Defaults to {@code false}.
249265
*/
250266
String ANDROID_NATURAL_ORIENTATION = "androidNaturalOrientation";
251267

252268
/**
253-
* The port number, which being used by UIAutomator2.
269+
* {@code systemPort} used to connect to <a href="https://github.com/appium/appium-uiautomator2-server">
270+
* appium-uiautomator2-server</a> or
271+
* <a href="https://github.com/appium/appium-espresso-driver">appium-espresso-driver</a>.
272+
* The default is {@code 8200} in general and selects one port from {@code 8200} to {@code 8299}
273+
* for appium-uiautomator2-server, it is {@code 8300} from {@code 8300} to {@code 8399} for
274+
* appium-espresso-driver. When you run tests in parallel, you must adjust the port to avoid conflicts. Read
275+
* <a href="https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/parallel-tests.md#parallel-android-tests">
276+
* Parallel Testing Setup Guide</a> for more details.
254277
*/
255278
String SYSTEM_PORT = "systemPort";
256279
}

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

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,14 @@
1919
import org.openqa.selenium.remote.CapabilityType;
2020

2121
/**
22-
* The list of iOS-specific capabilities.
23-
* Read:
24-
* https://github.com/appium/appium/blob/1.5/docs/en/writing-running-appium/caps.md#ios-only
22+
* The list of iOS-specific capabilities. <br>
23+
* Read: <br>
24+
* <a href="https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/caps.md#ios-only">
25+
* https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/caps.md#ios-only</a>
26+
* <br>
27+
* and<br>
28+
* <a href="https://github.com/appium/appium-xcuitest-driver#desired-capabilities">
29+
* https://github.com/appium/appium-xcuitest-driver#desired-capabilities</a>
2530
*/
2631
public interface IOSMobileCapabilityType extends CapabilityType {
2732

@@ -78,7 +83,7 @@ public interface IOSMobileCapabilityType extends CapabilityType {
7883
String NATIVE_INSTRUMENTS_LIB = "nativeInstrumentsLib";
7984

8085
/**
81-
* (Sim-only) Enable "real", non-javascript-based web taps in Safari.
86+
* Enable "real", non-javascript-based web taps in Safari.
8287
* Default: false.
8388
* Warning: depending on viewport size/ratio this might not accurately tap an element.
8489
*/
@@ -164,7 +169,7 @@ public interface IOSMobileCapabilityType extends CapabilityType {
164169
String APP_NAME = "appName";
165170

166171
/**
167-
* Capability to pre-authorize a specific SSL cert in the iOS trust store.
172+
* (Sim only) Add an SSL certificate to IOS Simulator.
168173
*/
169174
String CUSTOM_SSL_CERT = "customSSLCert";
170175

@@ -175,8 +180,11 @@ public interface IOSMobileCapabilityType extends CapabilityType {
175180
String TAP_WITH_SHORT_PRESS_DURATION = "tapWithShortPressDuration";
176181

177182
/**
178-
* The capability to direct Appium to set the simulator scale.
179-
* The XCUITest specific capability.
183+
* Simulator scale factor.
184+
* This is useful to have if the default resolution of simulated device is
185+
* greater than the actual display resolution. So you can scale the simulator
186+
* to see the whole device screen without scrolling.
187+
* This capability only works below Xcode9.
180188
*/
181189
String SCALE_FACTOR = "scaleFactor";
182190

@@ -229,7 +237,10 @@ public interface IOSMobileCapabilityType extends CapabilityType {
229237
* creating tons of unnecessary screenshots and logs,
230238
* which are impossible to shutdown using programming
231239
* interfaces provided by Apple
240+
*
241+
* @deprecated This capability was deleted at Appium 1.14.0
232242
*/
243+
@Deprecated
233244
String PREVENT_WDAATTACHMENTS = "preventWDAAttachments";
234245

235246
/**
@@ -248,18 +259,28 @@ public interface IOSMobileCapabilityType extends CapabilityType {
248259
String KEYCHAIN_PATH = "keychainPath";
249260

250261
/**
251-
* Forces uninstall of any existing WebDriverAgent app on device.
252-
* This can provide stability in some situations. Defaults to false.
262+
* If {@code true}, forces uninstall of any existing WebDriverAgent app on device.
263+
* Set it to {@code true} if you want to apply different startup options for WebDriverAgent for each session.
264+
* Although, it is only guaranteed to work stable on Simulator. Real devices require WebDriverAgent
265+
* client to run for as long as possible without reinstall/restart to avoid issues like
266+
* <a href="https://github.com/facebook/WebDriverAgent/issues/507">
267+
* https://github.com/facebook/WebDriverAgent/issues/507</a>.
268+
* The {@code false} value (the default behaviour since driver version 2.35.0) will try to detect currently
269+
* running WDA listener executed by previous testing session(s) and reuse it if possible, which is
270+
* highly recommended for real device testing and to speed up suites of multiple tests in general.
271+
* A new WDA session will be triggered at the default URL (http://localhost:8100) if WDA is not
272+
* listening and {@code webDriverAgentUrl} capability is not set. The negative/unset value of {@code useNewWDA}
273+
* capability has no effect prior to xcuitest driver version 2.35.0.
253274
*/
254275
String USE_NEW_WDA = "useNewWDA";
255276

256277
/**
257-
* Time, in ms, to wait for WebDriverAgewnt to be pingable. Defaults to 60000ms.
278+
* Time, in ms, to wait for WebDriverAgent to be pingable. Defaults to 60000ms.
258279
*/
259280
String WDA_LAUNCH_TIMEOUT = "wdaLaunchTimeout";
260281

261282
/**
262-
* Timeout, in ms, for waiting for a resonse from WebDriverAgent. Defaults to 240000ms.
283+
* Timeout, in ms, for waiting for a response from WebDriverAgent. Defaults to 240000ms.
263284
*/
264285
String WDA_CONNECTION_TIMEOUT = "wdaConnectionTimeout";
265286

@@ -273,7 +294,7 @@ public interface IOSMobileCapabilityType extends CapabilityType {
273294
/**
274295
* String representing a signing certificate.
275296
* Must be used in conjunction with xcodeOrgId.
276-
* This is usually just iPhone Developer.
297+
* This is usually just iPhone Developer, so the default (if not included) is iPhone Developer
277298
*/
278299
String XCODE_SIGNING_ID = "xcodeSigningId";
279300

@@ -288,13 +309,22 @@ public interface IOSMobileCapabilityType extends CapabilityType {
288309
* Whether to perform reset on test session finish (false) or not (true).
289310
* Keeping this variable set to true and Simulator running
290311
* (the default behaviour since version 1.6.4) may significantly shorten the
291-
* duratiuon of test session initialization.
312+
* duration of test session initialization.
292313
* Defaults to true.
293314
*/
294315
String RESET_ON_SESSION_START_ONLY = "resetOnSessionStartOnly";
295316

296317
/**
297318
* Custom timeout(s) in milliseconds for WDA backend commands execution.
319+
* This might be useful if WDA backend freezes unexpectedly or requires
320+
* too much time to fail and blocks automated test execution.
321+
* The value is expected to be of type string and can either contain
322+
* max milliseconds to wait for each WDA command to be executed before
323+
* terminating the session forcefully or a valid JSON string,
324+
* where keys are internal Appium command names (you can find these in logs,
325+
* look for "Executing command 'command_name'" records) and values are
326+
* timeouts in milliseconds. You can also set the 'default' key to assign
327+
* the timeout for all other commands not explicitly enumerated as JSON keys.
298328
*/
299329
String COMMAND_TIMEOUTS = "commandTimeouts";
300330

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

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
import org.openqa.selenium.remote.CapabilityType;
2020

2121
/**
22-
* The list of common capabilities.
23-
* Read:
24-
* https://github.com/appium/appium/blob/1.5/docs/en/
25-
* writing-running-appium/caps.md#appium-server-capabilities
22+
* The list of common capabilities. <br>
23+
* Read: <br>
24+
* <a href="https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/caps.md#general-capabilities">
25+
* https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/caps.md#general-capabilities</a>
2626
*/
2727
public interface MobileCapabilityType extends CapabilityType {
2828

@@ -48,11 +48,15 @@ public interface MobileCapabilityType extends CapabilityType {
4848
String NEW_COMMAND_TIMEOUT = "newCommandTimeout";
4949

5050
/**
51-
* The absolute local path or remote http URL to an .ipa or .apk file,
52-
* or a .zip containing one of these. Appium will attempt to install this app
53-
* binary on the appropriate device first. Note that this capability is not required for
54-
* Android if you specify appPackage and appActivity capabilities (see below).
55-
* Incompatible with browserName.
51+
* The absolute local path or remote http URL to a {@code .ipa} file (IOS),
52+
* {@code .app} folder (IOS Simulator), {@code .apk} file (Android) or {@code .apks} file (Android App Bundle),
53+
* or a {@code .zip} file containing one of these (for .app, the .app folder must be the root of the zip file).
54+
* Appium will attempt to install this app binary on the appropriate device first.
55+
* Note that this capability is not required for Android if you specify {@code appPackage}
56+
* and {@code appActivity} capabilities (see below). Incompatible with {@code browserName}. See
57+
* <a href="https://github.com/appium/appium/blob/v1.13.0/docs/en/writing-running-appium/android/android-appbundle.md">
58+
* here</a>
59+
* about {@code .apks} file.
5660
*/
5761
String APP = "app";
5862

@@ -67,12 +71,13 @@ public interface MobileCapabilityType extends CapabilityType {
6771
String APPIUM_VERSION = "appiumVersion";
6872

6973
/**
70-
* (Sim/Emu-only) Language to set for the simulator / emulator.
74+
* Language to set for iOS (XCUITest driver only) and Android.
7175
*/
7276
String LANGUAGE = "language";
7377

7478
/**
75-
* (Sim/Emu-only) Locale to set for the simulator / emulator.
79+
* Locale to set for iOS (XCUITest driver only) and Android.
80+
* {@code fr_CA} format for iOS. {@code CA} format (country name abbreviation) for Android
7681
*/
7782
String LOCALE = "locale";
7883

@@ -87,14 +92,18 @@ public interface MobileCapabilityType extends CapabilityType {
8792
String AUTO_WEBVIEW = "autoWebview";
8893

8994
/**
90-
* Don't reset app state before this session. Default false.
95+
* Don't reset app state before this session. See
96+
* <a href="https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/other/reset-strategies.md">
97+
* here</a>
98+
* for more detail.
9199
*/
92100
String NO_RESET = "noReset";
93101

94102
/**
95-
* (iOS) Delete the entire simulator folder.
96-
* (Android) Reset app state by uninstalling app instead of clearing app data.
97-
* On Android, this will also remove the app after the session is complete. Default false.
103+
* Perform a complete reset. See
104+
* <a href="https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/other/reset-strategies.md">
105+
* here</a>
106+
* for more detail.
98107
*/
99108
String FULL_RESET = "fullReset";
100109

@@ -106,7 +115,11 @@ public interface MobileCapabilityType extends CapabilityType {
106115

107116
/**
108117
* Enable or disable the reporting of the timings for various Appium-internal events
109-
* (e.g., the start and end of each command, etc.). Defaults to false.
118+
* (e.g., the start and end of each command, etc.). Defaults to {@code false}.
119+
* To enable, use {@code true}. The timings are then reported as {@code events} property on response
120+
* to querying the current session. See the
121+
* <a href="https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/event-timings.md">
122+
* event timing docs</a> for the the structure of this response.
110123
*/
111124
String EVENT_TIMINGS = "eventTimings";
112125

@@ -115,4 +128,10 @@ public interface MobileCapabilityType extends CapabilityType {
115128
* If {@code false} then it is switched to W3C mode.
116129
*/
117130
String FORCE_MJSONWP = "forceMjsonwp";
131+
132+
/**
133+
* (Web and webview only) Enable ChromeDriver's (on Android)
134+
* or Safari's (on iOS) performance logging (default {@code false}).
135+
*/
136+
String ENABLE_PERFORMANCE_LOGGING = "enablePerformanceLogging";
118137
}

0 commit comments

Comments
 (0)