Wire mobile app management doc into the rest (#9888)

* Wire mobile app management doc into the rest

* Add rendered markup
This commit is contained in:
Isaac A. Murchie
2018-01-02 16:39:17 -05:00
committed by GitHub
parent ed1161f300
commit 0d36044ada
12 changed files with 122 additions and 23 deletions
@@ -1,6 +1,28 @@
---
name: Background App
short_description: Send the currently running app for this session to the background
description:
>
Send the currently active app to the background, and either return after a
certain amount of time, or leave the app deactivated.
There are 3 types of parameters which may be passed to this method:
1. An object that looks like `{"timeout": secs}`, where `secs` is an
integer designating how long, in seconds, to background the app for. -1
means to deactivate the app entirely.
2. `null`, which means to deactivate the app entirely.
3. _Deprecated_ An integer: how long, in seconds, to background the app for. -1 means to
deactivate the app entirely.
iOS tests with XCUITest can also use the `mobile: terminateApp` method to
terminate the current app (see detailed [documentation](/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management.md#mobile-terminateapp)),
and the `mobile: activateApp` to activate an existing application on the
device under test and moves it to the foreground (see detailed [documentation](/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management.md#mobile-activateapp)).
example_usage:
java:
|
@@ -1,6 +1,10 @@
---
name: Install App
short_description: Install the given app onto the device
description:
>
iOS tests with XCUITest can also use the `mobile: installApp` method. See
detailed [documentation](/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management.md#mobile-installapp).
example_usage:
java:
@@ -1,6 +1,10 @@
---
name: Is App Installed
short_description: Check whether the specified app is installed on the device
description:
>
iOS tests with XCUITest can also use the `mobile: isAppInstalled` method. See
detailed [documentation](/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management.md#mobile-isappinstalled).
example_usage:
java:
@@ -1,6 +1,11 @@
---
name: Launch an App
short_description: Launch an app on device
description:
>
iOS tests with XCUITest can also use the `mobile: launchApp` method. See
detailed [documentation](/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management.md#mobile-launchapp).
example_usage:
java:
|
@@ -1,6 +1,11 @@
---
name: Remove App
short_description: Remove an app from the device
description:
>
iOS tests with XCUITest can also use the `mobile: removeApp` method. See
detailed [documentation](/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management.md#mobile-removeapp).
example_usage:
java:
@@ -46,6 +46,22 @@ $driver->backgroundApp(10);
```
## Description
Send the currently active app to the background, and either return after a certain amount of time, or leave the app deactivated.
There are 3 types of parameters which may be passed to this method:
1. An object that looks like `{"timeout": secs}`, where `secs` is an
integer designating how long, in seconds, to background the app for. -1
means to deactivate the app entirely.
2. `null`, which means to deactivate the app entirely.
3. _Deprecated_ An integer: how long, in seconds, to background the app for. -1 means to
deactivate the app entirely.
iOS tests with XCUITest can also use the `mobile: terminateApp` method to terminate the current app (see detailed [documentation](/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management.md#mobile-terminateapp)), and the `mobile: activateApp` to activate an existing application on the device under test and moves it to the foreground (see detailed [documentation](/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management.md#mobile-activateapp)).
## Support
@@ -46,6 +46,10 @@ $driver->installApp('/Users/johndoe/path/to/app.apk');
```
## Description
iOS tests with XCUITest can also use the `mobile: installApp` method. See detailed [documentation](/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management.md#mobile-installapp).
## Support
@@ -46,6 +46,10 @@ $driver->isAppInstalled('com.example.AppName')
```
## Description
iOS tests with XCUITest can also use the `mobile: isAppInstalled` method. See detailed [documentation](/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management.md#mobile-isappinstalled).
## Support
@@ -46,6 +46,10 @@ $driver->launchApp();
```
## Description
iOS tests with XCUITest can also use the `mobile: launchApp` method. See detailed [documentation](/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management.md#mobile-launchapp).
## Support
@@ -46,6 +46,10 @@ $driver->removeApp('com.example.AppName');
```
## Description
iOS tests with XCUITest can also use the `mobile: removeApp` method. See detailed [documentation](/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management.md#mobile-removeapp).
## Support
@@ -1,17 +1,28 @@
## Advanced Applications Management Commands For iOS With WebDriverAgent/XCTest Backend
Since Xcode9 there is a possibility to manage multiple applications in scope of a single session. It makes it possible to open iOS preferences and change values there while the application under test is in background and then restore it back to foreground or check scenarious, where the application under test is terminated and then started again. Appium for iOS has special set of `mobile:` subcommands, which provides user interface to such features.
Since Xcode9 there is a possibility to manage multiple applications in scope of
a single session. It makes it possible to open iOS preferences and change values
there while the application under test is in background and then restore it back
to foreground or check scenarious, where the application under test is
terminated and then started again. Appium for iOS has special set of `mobile:`
subcommands, which provides user interface to such features.
`Important note`: Make sure you don't cache WebElement instances between application restarts, since they are going to be invalidated after each restart.
**Important note:** Make sure you don't cache WebElement instances between
application restarts, since they are going to be invalidated after each restart.
### mobile: installApp
Installs given application to the device under test. If the same application is already installed then it's going to be installed over the existing one, which allows you to test upgrades. Be careful while reinstalling the main application under test: make sure that `terminateApp` has been called first, otherwise WebDriverAgent will detect the state as a potential crash of the application.
Installs given application to the device under test. If the same application is
already installed then it's going to be installed over the existing one, which
allows you to test upgrades. Be careful while reinstalling the main application
under test: make sure that `terminateApp` has been called first, otherwise
WebDriverAgent will detect the state as a potential crash of the application.
#### Supported arguments
* _app_: The path to an existing .ipa/.app file on the server file system, zipped .app file or an URL pointing to a remote .ipa/.zip file. Mandatory argument.
* `app`: The path to an existing .ipa/.app file on the server file system,
zipped .app file or an URL pointing to a remote .ipa/.zip file. Mandatory argument.
#### Usage examples
@@ -25,11 +36,14 @@ js.executeScript("mobile: installApp", params);
### mobile: removeApp
Uninistalls an existing application from the device under test. This endpoint does not verify whether the application is already installed or not before uninstalling it.
Uninstalls an existing application from the device under test. This endpoint
does not verify whether the application is already installed or not before
uninstalling it.
#### Supported arguments
* _bundleId_: The bundle identifier of the application, which is going to be uninstalled. Mandatory argument.
* `bundleId`: The bundle identifier of the application, which is going to be
uninstalled. Mandatory argument.
#### Usage examples
@@ -41,11 +55,13 @@ driver.execute_script('mobile: removeApp', {'bundleId': 'com.myapp'});
### mobile: isAppInstalled
Verifies whether the application with given bundle identifier is installed on the device. Returns `true` or `false`.
Verifies whether the application with given bundle identifier is installed on
the device. Returns `true` or `false`.
#### Supported arguments
* _bundleId_: The bundle identifier of the application, which is going to be verified. Mandatory argument.
* `bundleId`: The bundle identifier of the application, which is going to be
verified. Mandatory argument.
#### Usage examples
@@ -59,13 +75,15 @@ final boolean isInstalled = (Boolean)js.executeScript("mobile: isAppInstalled",
### mobile: launchApp
Executes an existing application on the device. If the application is already running then it will be brought to the foreground.
Executes an existing application on the device. If the application is already
running then it will be brought to the foreground.
#### Supported arguments
* _bundleId_: The bundle identifier of the application, which is going to be executed. Mandatory argument.
* _arguments_: The list of command line arguments. Optional.
* _environment_: Environemnt variables mapping. Optional.
* `bundleId`: The bundle identifier of the application, which is going to be
executed. Mandatory argument.
* `arguments`: The list of command line arguments. Optional.
* `environment`: Environemnt variables mapping. Optional.
#### Usage examples
@@ -79,11 +97,13 @@ driver.execute_script('mobile: launchApp', {'bundleId': 'com.myapp',
### mobile: terminateApp
Terminates an existing application on the device. If the application is not running then the returned result will be `false`, otherwise `true`.
Terminates an existing application on the device. If the application is not
running then the returned result will be `false`, otherwise `true`.
#### Supported arguments
* _bundleId_: The bundle identifier of the application, which is going to be terminated. Mandatory argument.
* `bundleId`: The bundle identifier of the application, which is going to be
terminated. Mandatory argument.
#### Usage examples
@@ -97,11 +117,14 @@ final boolean wasRunningBefore = (Boolean)js.executeScript("mobile: terminateApp
### mobile: activateApp
Activates an existing application on the device under test and moves it to the foreground. The application should be already running in order to activate it. The call is ignored if the application is already in foreground.
Activates an existing application on the device under test and moves it to the
foreground. The application should be already running in order to activate it.
The call is ignored if the application is already in foreground.
#### Supported arguments
* _bundleId_: The bundle identifier of the application, which is going to be brought to the foreground. Mandatory argument.
* `bundleId`: The bundle identifier of the application, which is going to be
brought to the foreground. Mandatory argument.
#### Usage examples
@@ -113,17 +136,20 @@ driver.execute_script('mobile: activateApp', {'bundleId': 'com.myapp'});
### mobile: queryAppState
Queries the state of an existing application on the device. There are five possible application states (check https://developer.apple.com/documentation/xctest/xcuiapplicationstate?language=objc for more details):
Queries the state of an existing application on the device. There are five
possible application states (check [Apple's documentation](https://developer.apple.com/documentation/xctest/xcuiapplicationstate?language=objc)
for more details):
* _0_: The current application state cannot be determined/is unknown
* _1_: The application is not running
* _2_: The application is running in the background and is suspended
* _3_: The application is running in the background and is not suspended
* _4_: The application is running in the foreground
* `0`: The current application state cannot be determined/is unknown
* `1`: The application is not running
* `2`: The application is running in the background and is suspended
* `3`: The application is running in the background and is not suspended
* `4`: The application is running in the foreground
#### Supported arguments
* _bundleId_: The bundle identifier of the application, which state is going to be queried. Mandatory argument.
* `bundleId`: The bundle identifier of the application, which state is going to
be queried. Mandatory argument.
#### Usage examples
+1
View File
@@ -211,6 +211,7 @@ module.exports = {
]],
["iOS", ["ios",
["XCUITest Mobile Gestures", "ios-xctest-mobile-gestures.md"],
["XCUITest Mobile App Management", "ios-xctest-mobile-apps-management.md"],
["iOS Pasteboard Guide", "ios-xctest-pasteboard.md"],
["iOS Predicate Guide", "ios-predicate.md"],
["iOS Touch ID Guide", "ios-touch-id.md"],