如何向下滚动UITable视图,直到我在Calabash中看到标签为"Value"的单元格

Dav*_*son 2 iphone cucumber ios calabash

如何向下滚动UITableView,直到我在Calabash/Cucumber中看到标签为"Value"的单元格.我一直在尝试使用:

      Then I swipe down until I see "Value"
Run Code Online (Sandbox Code Playgroud)

和使用:

      Then I scroll down until I see "Value"
Run Code Online (Sandbox Code Playgroud)

但它们似乎都没有用.谢谢!

我尝试使用上述内容时得到的消息显然是:

您可以使用以下代码段实现未定义步骤的步骤定义:

然后(/ ^我向下滑动,直到我看到"(.*?)"$ /)do | arg1 | pending#用你希望你已经结束的代码表达上面的正则表达式

Cha*_*ara 11

添加步骤定义

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

到ProjectName/features/step_definitions/my_first_steps.rb ruby​​文件并在你的calabash脚本中添加

Then I scroll to cell with "AAA" label
Run Code Online (Sandbox Code Playgroud)

它对我来说很好.