Module: Appium::Ios::Xcuitest::MultiAppHandler
- Defined in:
- lib/appium_lib/ios/xcuitest/command/multi_app_handler.rb
Overview
Note Works only for Xcode 9+. Instance methods have xcuitest_ prefix to prevent conflicts for core commands. see: github.com/appium/ruby_lib_core/blob/82e2526de95b05e8a49872e0b69835e99acc66e5/lib/appium_lib_core/common/command.rb#L39
Instance Method Summary collapse
-
#xcuitest_activate_app(bundle_id:) ⇒ Object
Activates an existing application on the device under test and moves it to the foreground.
-
#xcuitest_app_installed?(bundle_id:) ⇒ boolean
Verifies whether the application with given bundle identifier is installed on the device.
-
#xcuitest_install_app(app:) ⇒ Object
Installs given application to the device under test.
-
#xcuitest_launch_app(bundle_id:) ⇒ Object
Executes an existing application on the device.
-
#xcuitest_query_app_status(bundle_id:) ⇒ 0|1|2|3|4
Get the status of an existing application on the device.
-
#xcuitest_remove_app(bundle_id:) ⇒ Object
Uninstalls an existing application from the device under test.
-
#xcuitest_terminate_app(bundle_id:) ⇒ Object
Terminates an existing application on the device.
Instance Method Details
#xcuitest_activate_app(bundle_id:) ⇒ Object
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.
118 119 120 121 |
# File 'lib/appium_lib/ios/xcuitest/command/multi_app_handler.rb', line 118 def xcuitest_activate_app(bundle_id:) args = { bundleId: bundle_id } @driver.execute_script 'mobile: activateApp', args end |
#xcuitest_app_installed?(bundle_id:) ⇒ boolean
Verifies whether the application with given bundle identifier is installed on the device.
35 36 37 38 |
# File 'lib/appium_lib/ios/xcuitest/command/multi_app_handler.rb', line 35 def xcuitest_app_installed?(bundle_id:) args = { bundleId: bundle_id } @driver.execute_script 'mobile: isAppInstalled', args end |
#xcuitest_install_app(app:) ⇒ Object
Installs given application to the device under test. If the same application is already installed then it’s going to be installed over it, which allows to test upgrades. Be careful while reinstalling the main application under test - make sure you called terminateApp for it first, otherwise WebDriverAgent will detect it as a potential application crash.
21 22 23 24 |
# File 'lib/appium_lib/ios/xcuitest/command/multi_app_handler.rb', line 21 def xcuitest_install_app(app:) args = { app: app } @driver.execute_script 'mobile: installApp', args end |
#xcuitest_launch_app(bundle_id:) ⇒ Object
Executes an existing application on the device. If the application is already running then it will be brought to the foreground.
65 66 67 68 |
# File 'lib/appium_lib/ios/xcuitest/command/multi_app_handler.rb', line 65 def xcuitest_launch_app(bundle_id:) args = { bundleId: bundle_id } @driver.execute_script 'mobile: launchApp', args end |
#xcuitest_query_app_status(bundle_id:) ⇒ 0|1|2|3|4
Get the status of an existing application on the device. State:
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
For more details: developer.apple.com/documentation/xctest/xcuiapplicationstate
102 103 104 105 |
# File 'lib/appium_lib/ios/xcuitest/command/multi_app_handler.rb', line 102 def xcuitest_query_app_status(bundle_id:) args = { bundleId: bundle_id } @driver.execute_script 'mobile: queryAppState', args end |
#xcuitest_remove_app(bundle_id:) ⇒ Object
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.
50 51 52 53 |
# File 'lib/appium_lib/ios/xcuitest/command/multi_app_handler.rb', line 50 def xcuitest_remove_app(bundle_id:) args = { bundleId: bundle_id } @driver.execute_script 'mobile: removeApp', args end |
#xcuitest_terminate_app(bundle_id:) ⇒ Object
Terminates an existing application on the device. If the application is not running then the returned result will be false, otherwise true.
80 81 82 83 |
# File 'lib/appium_lib/ios/xcuitest/command/multi_app_handler.rb', line 80 def xcuitest_terminate_app(bundle_id:) args = { bundleId: bundle_id } @driver.execute_script 'mobile: terminateApp', args end |