如何向下滚动 UITable 视图,直到看到带有标签“值"的单元格?(葫芦)视图、葫芦、单元格、标签

由网友(把手交与我)分享简介:如何向下滚动 UITableView,直到在 Calabash/Cucumber 中看到带有Value"标签的单元格.我一直在尝试使用:How do i scroll a UITableView down until i see a cell with label "Value" in Calabash/Cucumb...

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

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"

并使用:

      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:

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

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

推荐答案

添加步骤定义

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

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

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

它对我来说很好用.

阅读全文

相关推荐

最新文章