Method: ICuke::SimulatorDriver#scroll_to

Defined in:
lib/icuke/simulator_driver.rb

#scroll_to(text, options = {}) ⇒ Object



163
164
165
166
167
168
169
170
171
# File 'lib/icuke/simulator_driver.rb', line 163

def scroll_to(text, options = {})
  x, y, x2, y2 = screen.swipe_coordinates(swipe_direction(options[:direction]))
  previous_response = response.dup
  until screen.visible?(text) do
    @simulator.fire_event(Swipe.new(x, y, x2, y2, 0.15, options))
    refresh
    raise %Q{Content "#{text}" not found in: #{screen}} if response == previous_response
  end
end