我使用Watir和Cucumber进行测试,我想检查一个页面的标题是否包含一些给定的字符串。
我尝试过:
Then(/^the title page should include (.*)$/) do |title|
@browser.title.include?title
@browser.close
end
但不起作用。有什么想法吗?
答案 0 :(得分:0)
我找到了答案 1.宝石安装rspec-expectations。 2.在.rb文件中添加要求" rspec /期望" 3.期望(@ browser.title)。包括(标题)