@javascript标签不适用于使用水豚驱动程序的黄瓜测试用例

时间:2015-04-01 06:50:19

标签: cucumber capybara-webkit

在场景中使用@javascript标记时出现此错误:

由于加载错误http://testdomain.mentorstring.com:3000/login而无法加载网址:http://testdomain.mentorstring.com:3000/login:未知错误(Capybara :: Webkit :: InvalidResponseError)。

当我在没有javascript标签的情况下运行时,我没有得到错误,测试通过。

2 个答案:

答案 0 :(得分:0)

页面上可能是错误。加载页面时检查浏览器控制台。另外,请在此处查看更多详细信息:Capybara webkit invalid response error, how to debug?

这个答案还提供了一种调试方式:https://stackoverflow.com/a/12194920/769971

答案 1 :(得分:0)

尝试在env.rb文件中使用以下capybara配置

Capybara.configure do |config|
  config.run_server = true
  config.server_port = 3000
  config.javascript_driver = :webkit
  config.default_wait_time = 30
  config.always_include_port = true
  config.default_host = 'your_app_url'
  config.app_host = 'http://your_app_url'
end
相关问题