我正在尝试学习如何为 frank 编写测试脚本(cucumber 测试脚本)。
这是我写的
When I navigate to "aaa"
Then I should be on the aaa screen
Then I navigate to "bob"
Then I should be on the bob screen
When /^I navigate to "(.*?)"$/ do |aaa|
touch "view:'UITabBarButton' marked:'aaa'"
END
Then /^I should be on the aaa screen$/ do
check_element_exists "view:'UIImageView' marked:'xxx'"
END
Then /^navigating to "(.*?)"$/ do |bbb|
touch "view:'UITabBarButton' marked:'bbb'"
end
Then /^I SHould be on the bbb screen$/ do
check_element_exists "view:'UIImageView' marked:'zzz'"
end
写字母而不是 View /图片名称的地方
这是我运行脚本时得到的结果
/Users/janogrodowczyk/SMHI/ios/ios/Frank/features/step_definitions/test_steps.rb:14: 语法错误,意外的 $end,期待 kEND(SyntaxError)
而且我不知道从前两行开始我做错了什么
When I navigate to "aaa"
Then I should be on the aaa screen
只有在没有其他运行的情况下才能正常工作。
最好的问候
最佳答案
END
和 end
是不同的 ruby 关键字。
END
表示程序结束前要执行的代码。
end
表示一个类、方法、控制结构等的结束
关于ruby - 编写 cucumber 测试用例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13766563/