【发布时间】:2013-10-22 02:56:53
【问题描述】:
我正在尝试创建一个自定义黄瓜格式化程序,它将在每个步骤之前执行一些操作。我的问题是在我们的舞台环境中发生的随机弹出横幅(模态)。我无法关闭它们,因为营销正在测试它们,并且它们破坏了回归脚本。很难围绕它们编写代码,因为我不知道它们会弹出什么文件,也不知道它们会在那里呆多久。所以我虽然创建了一个在每个步骤之前运行的格式化程序。但我在从它向浏览器传递命令时遇到问题。
require 'watir-webdriver'
module Custom
class Formator
def initialize(step_mother, io, options)
@step_mother = step_mother
@io = io
end
def before_step(step)
@browser.goto "http://stage.website.local/"
end
end
end
当我使用它时,我得到一个错误
undefined method `goto' for nil:NilClass (NoMethodError)
【问题讨论】:
标签: ruby testing cucumber watir