如何向下滚动 UITable 视图,直到看到带有标签“值"的单元格?(葫芦) [英] How do i scroll a UITable view down until i see a cell with label "Value" in Calabash

查看:28
本文介绍了如何向下滚动 UITable 视图,直到看到带有标签“值"的单元格?(葫芦)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何向下滚动 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

它对我来说很好用.

这篇关于如何向下滚动 UITable 视图,直到看到带有标签“值"的单元格?(葫芦)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆