Method: Cukunity::Android::TouchInput.touch_screen
- Defined in:
- lib/cukunity/drivers/android/touch_input.rb
.touch_screen(options) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/cukunity/drivers/android/touch_input.rb', line 7 def self.touch_screen() = (, { :x => 0, :y => 0, :type => :tap }) wait = (.delete(:wait) || 0.1).to_f [:x] = [:x].to_i [:y] = [:y].to_i prefix = if [:type] == :tap "tap" else "touch #{type}" end req = %Q[#{prefix} #{[:x]} #{[:y]}] monkey.command(req) sleep(wait) unless wait.nil? or wait <= 0 end |