我正在使用 watir-cucumber 进行测试自动化。我单独编写了以下方法.rb,此方法不在步骤定义中。
def has_logged_in?
$browser.text.should include("t788")
end
当我从步骤定义中调用此方法时,会出现此错误,
wrong argument type String (expected Module) (TypeError)
相同的代码在步骤定义中工作正常。我四处搜索,发现该include方法用于包含模块,但那是ruby-include方法并且should include属于rspec\expectations. 那么我如何should include在上面的步骤定义之外调用方法。我在 linux 上使用 watir-cucumber