How do i scroll a UITable view down until i see a cell with label "Value" in Calabash

David Karlsson picture David Karlsson · May 2, 2013 · Viewed 8.1k times · Source

How do i scroll a UITableView down until i see a cell with label "Value" in Calabash/Cucumber. I've been trying to do it using:

      Then I swipe down until I see "Value"

and using:

      Then I scroll down until I see "Value"

but none of them seem to work. Thanks!

The message I get when I try with the above is obviously:

You can implement step definitions for undefined steps with these snippets:

Then(/^I swipe down until I see "(.*?)"$/) do |arg1| pending # express the regexp above with the code you wish you had end

Answer

Chathura Palihakkara picture Chathura Palihakkara · May 8, 2013

add step definitions

Then /^I scroll to cell with "([^\"]*)" label$/ do |name|
    wait_poll(:until_exists => "label text:'#{name}'", :timeout => 20) do
    scroll("tableView", :down)
    end
end

to the ProjectName/features/step_definitions/my_first_steps.rb ruby file and In your calabash script add

Then I scroll to cell with "AAA" label

its working fine for me.