Ios 如何与frank一起编写Cumber测试

Ios 如何与frank一起编写Cumber测试,ios,unit-testing,cucumber,frank,Ios,Unit Testing,Cucumber,Frank,我刚接触cucumber/frank/ruby,并尝试按照这里的步骤进行操作 我正在尝试创建一个步骤定义。在本教程中,他们为您提供了编写步骤定义的代码。这是他们的代码,示例步骤定义为: Then /^I should be on the Home screen$/ do check_element_exists "view view:'UIImageView' marked:'Icon512x512.png'" end When /^I navigate to "(.*?)"$/ do |t

我刚接触cucumber/frank/ruby,并尝试按照这里的步骤进行操作 我正在尝试创建一个步骤定义。在本教程中,他们为您提供了编写步骤定义的代码。这是他们的代码,示例步骤定义为:

Then /^I should be on the Home screen$/ do
  check_element_exists "view view:'UIImageView' marked:'Icon512x512.png'"
end
When /^I navigate to "(.*?)"$/ do |tab_name|
  touch "view:'UITabBarButton' marked:'#{tab_name}'"
end
Then /^I should be on the Events screen$/ do
  check_element_exists "view:'UIScrollView' view:'UIButton' marked:'archery'"
  check_element_exists "view:'UIScrollView' view:'UIButton' marked:'badminton'"
  check_element_exists "view:'UIScrollView' view:'UIButton' marked:'boxing'"
end
我试着只写应用于我的应用程序的第一部分,并这样写:

Then /^I should be on the Map screen$/ do
  check_element_exists "view view:'UIButtonLabel' marked:'Photo View'"
end
Then /^I should be on the Map screen$/ do
  check_element_exists "view view:'UIButton' marked:'Photo View'"
end
这给了我一个错误 然后我应该在地图屏幕上#features/step_definitions/navigation_steps.rb:1 “地图视图视图:'UIButtonLabel'标记:'Photo view'accessibilityLabel失败,因为:选择器无效。” *-[\uu NSArrayM objectAtIndex:]:索引0超出空数组的界限(运行时错误) /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/Ruby/1.8/timeout.rb:53:in
timeout'
./features/step\u definitions/navigation\u steps.rb:1:in
/^I应该在地图屏幕上$/'
功能/导航。功能:5:在“那么我应该在地图屏幕上”

中,如果我理解正确,并且您访问一个默认按钮,应该如下所示:

Then /^I should be on the Map screen$/ do
  check_element_exists "view view:'UIButtonLabel' marked:'Photo View'"
end
Then /^I should be on the Map screen$/ do
  check_element_exists "view view:'UIButton' marked:'Photo View'"
end
试着贴一张你的共生体的截图,干杯