Module: Appium::Core::Ios::Uiautomation::Device

Defined in:
lib/appium_lib_core/ios/uiautomation/device.rb

Class Method Summary collapse

Class Method Details

.add_methodsObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/appium_lib_core/ios/uiautomation/device.rb', line 20

def self.add_methods
  # UiAutomation, Override included method in bridge
  ::Appium::Core::Device.add_endpoint_method(:hide_keyboard) do
    def hide_keyboard(close_key = nil, strategy = nil)
      option = {}

      option[:key] = close_key || 'Done'        # default to Done key.
      option[:strategy] = strategy || :pressKey # default to pressKey

      execute :hide_keyboard, {}, option
    end
  end

  # UiAutomation, Override included method in bridge
  ::Appium::Core::Device.add_endpoint_method(:background_app) do
    def background_app(duration = 0)
      execute :background_app, {}, seconds: duration
    end
  end
end