我几天来一直在努力解决这个问题,但无法弄清楚是什么导致了这个问题。测试套件在TravisCI上运行正常,在我重新启动计算机时在本地运行。在做了本地的事情后,我不断收到相同的错误信息:
Unable to load URL: http://localhost.dev:3001/en/users/sign_in because of error loading http://localhost.dev:3001/en/users/sign_in: Unknown error (Capybara::Webkit::InvalidResponseError)
以下是完整的webkit-debug跟踪:
Using the default profile...
..........Finished "EnableLogging" with response "Success()"
Wrote response true ""
Received "Visit"
Started "Visit"
Load started
"Visit" started page load
Started request to "http://localhost.dev:3001/en/users/sign_in"
Finished "Visit" with response "Success()"
Received 0 from "http://localhost.dev:3001/en/users/sign_in"
Page finished with false
Load finished
Page load from command finished
Wrote response false "{"class":"InvalidResponseError","message":"Unable to load URL: http://localhost.dev:3001/en/users/sign_in because of error loading http://localhost.dev:3001/en/users/sign_in: Unknown error"}"
F-Received "Reset"
Started "Reset"
undefined|0|SECURITY_ERR: DOM Exception 18: An attempt was made to break through the security policy of the user agent.
Finished "Reset" with response "Success()"
Wrote response true ""
Received "FindXpath"
Started "FindXpath"
Finished "FindXpath" with response "Success()"
Wrote response true ""
..........F--------
(::) failed steps (::)
Unable to load URL: http://localhost.dev:3001/en/users/sign_in because of error loading http://localhost.dev:3001/en/users/sign_in: Unknown error (Capybara::Webkit::InvalidResponseError)
这会在应用中的任何地方出现,我尝试visit
路径。根据我的理解,“未知错误”来自qt,而不是capybara-webkit,但我不太确定谁最好问。我正在使用DNSmasq进行子域名,我们有多种语言,因此localhost:3000被重定向到www.localhost.dev:3000/en。
当前版本的事物:
修改1:也发布在capybara-webkit
回购:https://github.com/thoughtbot/capybara-webkit/issues/667
编辑2:这是测试日志文件:https://gist.github.com/GolfyMcG/060053eba51a9ba69722
答案 0 :(得分:0)
正如我在相关的Github问题中发布的那样,我在这里找到了解决方案:
https://apple.stackexchange.com/questions/26616/dns-not-resolving-on-mac-os
与Capybara-webkit没有任何关系,而是与我如何让我的ElasticSearch实例进行测试的方式有关。