Ios Frank不能触摸带有标记的文本字段

Ios Frank不能触摸带有标记的文本字段,ios,testing,cucumber,bdd,frank,Ios,Testing,Cucumber,Bdd,Frank,我有一个UITableViewCell,它由一个UITextTable和一个UITextField组成 此UITextField不带占位符和accessibilityhint 我必须编写我的功能文件,按标签触摸此UItextfield When /^I touch the (\d*)(?:st|nd|rd|th)? text field$/ do |ordinal| ordinal = ordinal.to_i text_field_selector = "textField t

我有一个UITableViewCell,它由一个UITextTable和一个UITextField组成 此UITextField不带占位符和accessibilityhint 我必须编写我的功能文件,按标签触摸此UItextfield

When /^I touch the (\d*)(?:st|nd|rd|th)? text field$/ do |ordinal| ordinal = ordinal.to_i text_field_selector = "textField tag:#{ordinal}" touch (text_field_selector) end 根据此步骤定义,FrankCumber提出了错误消息,表示

could not find anything matching [textFeild tag:2] 我将代码改为:

When /^I touch the (\d*)(?:st|nd|rd|th)? text field$/ do |ordinal| ordinal = ordinal.to_i text_field_selector = "textField tag:#{ordinal}" frankly_map (text_field_selector, 'becomeFirstResponder') end 现在,frank最终没有发出任何错误消息,并将其标记为已通过的测试步骤,但我希望当进入此测试步骤时,键盘会出现,并等待用户输入文本。 实际结果是键盘闪烁了一下,很快就消失了。无法输入任何内容


这很奇怪,我不知道这是怎么回事。

我不认识frank,但您可以使用ask方法在Cucumber的控制台中捕获一个参数。有些东西看起来像这样:

When /^I touch the text field$/ do
    ordinal = ask("Which field number?").to_i
    text_field_selector = "textField tag:#{ordinal}"
    touch (text_field_selector)
end