Module: Appium::Core::Base::Device::AppManagement
- Defined in:
- lib/appium_lib_core/common/device/app_management.rb
Instance Method Summary collapse
- #activate_app(app_id) ⇒ Object
- #app_installed?(app_id) ⇒ Boolean
- #app_strings(language = nil) ⇒ Object
- #background_app(duration = 0) ⇒ Object
- #close_app ⇒ Object
- #install_app(path, options = {}) ⇒ Object
- #launch_app ⇒ Object
- #remove_app(id, keep_data: nil, timeout: nil) ⇒ Object
- #reset ⇒ Object
- #terminate_app(app_id, timeout: nil) ⇒ Object
Instance Method Details
#activate_app(app_id) ⇒ Object
65 66 67 68 |
# File 'lib/appium_lib_core/common/device/app_management.rb', line 65 def activate_app(app_id) # required: [['appId'], ['bundleId']] execute :activate_app, {}, bundleId: app_id end |
#app_installed?(app_id) ⇒ Boolean
60 61 62 63 |
# File 'lib/appium_lib_core/common/device/app_management.rb', line 60 def app_installed?(app_id) # required: [['appId'], ['bundleId']] execute :app_installed?, {}, bundleId: app_id end |
#app_strings(language = nil) ⇒ Object
32 33 34 35 |
# File 'lib/appium_lib_core/common/device/app_management.rb', line 32 def app_strings(language = nil) opts = language ? { language: language } : {} execute :app_strings, {}, opts end |
#background_app(duration = 0) ⇒ Object
37 38 39 40 |
# File 'lib/appium_lib_core/common/device/app_management.rb', line 37 def background_app(duration = 0) # Should override in each driver raise NotImplementedError end |
#close_app ⇒ Object
24 25 26 |
# File 'lib/appium_lib_core/common/device/app_management.rb', line 24 def close_app execute :close_app end |
#install_app(path, options = {}) ⇒ Object
42 43 44 45 46 47 |
# File 'lib/appium_lib_core/common/device/app_management.rb', line 42 def install_app(path, = {}) args = { appPath: path } args[:options] = unless .empty? execute :install_app, {}, args end |
#launch_app ⇒ Object
20 21 22 |
# File 'lib/appium_lib_core/common/device/app_management.rb', line 20 def launch_app execute :launch_app end |
#remove_app(id, keep_data: nil, timeout: nil) ⇒ Object
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/appium_lib_core/common/device/app_management.rb', line 49 def remove_app(id, keep_data: nil, timeout: nil) # required: [['appId'], ['bundleId']] args = { appId: id } args[:options] = {} unless keep_data.nil? && timeout.nil? args[:options][:keepData] = keep_data unless keep_data.nil? args[:options][:timeout] = timeout unless timeout.nil? execute :remove_app, {}, args end |
#reset ⇒ Object
28 29 30 |
# File 'lib/appium_lib_core/common/device/app_management.rb', line 28 def reset execute :reset end |
#terminate_app(app_id, timeout: nil) ⇒ Object
70 71 72 73 74 75 76 77 78 79 |
# File 'lib/appium_lib_core/common/device/app_management.rb', line 70 def terminate_app(app_id, timeout: nil) # required: [['appId'], ['bundleId']] # args = { appId: app_id } args[:options] = {} unless timeout.nil? args[:options][:timeout] = timeout unless timeout.nil? execute :terminate_app, {}, args end |