Module: Cukunity::IOS::TouchInput

Extended by:
Utils, TouchInputMethods
Defined in:
lib/cukunity/drivers/iOS/touch_input.rb

Constant Summary

Constants included from Utils

Utils::MOBILE_DEVICE_DEFAULT_TIMEOUT

Constants included from TouchInputMethods

TouchInputMethods::DEFAULT_TAP_DELAY

Class Method Summary collapse

Methods included from Utils

bundle_identifier, device_udid, mobile_device_cmd, uiautomation_cmd, unity_command

Methods included from Utils

#check_timeout, #merge_options, #restrict_options, #to_options, #wait_connectivity

Methods included from TouchInputMethods

default_tap_delay, default_tap_delay=, set_default_tap_delay

Class Method Details

.touch_screen(options) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/cukunity/drivers/iOS/touch_input.rb', line 7

def self.touch_screen(options)
  options = merge_options(options, { :x => 0, :y => 0, :method => 'tap', :tapCount => 1 })
  wait = (options.delete(:wait) || self.default_tap_delay).to_f
  # FIXME: screen dimensions
  options[:x] = options[:x].to_i / 2
  options[:y] = options[:y].to_i / 2
  unity_command('touch_screen', restrict_options(options, :x, :y, :method, :tapCount))
  sleep(wait) unless wait.nil? or wait <= 0
end