Method: ICuke::SimulatorDriver#tap

Defined in:
lib/icuke/simulator_driver.rb

#tap(label, options = {}) {|element| ... } ⇒ Object

Yields:

  • (element)


56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/icuke/simulator_driver.rb', line 56

def tap(label, options = {}, &block)
  options = {
    :pause => true
  }.merge(options)

  element = screen.first_tappable_element(label)
  x, y = screen.element_center(element)

  @simulator.fire_event(Tap.new(x, y, options))

  sleep(options[:pause] ? 2 : 0.2)

  refresh

  yield element if block_given?
end