在 Heroku CI 上运行 Capybara 测试时,net::ERR_NAME_NOT_RESOLVED

Dav*_*ner 5 continuous-integration selenium ruby-on-rails heroku selenium-chromedriver

我在ActionDispatch::SystemTestCase本地运行良好,但在 Heroku CI 中失败并出现以下错误:

Selenium::WebDriver::Error::UnknownError: unknown error: net::ERR_NAME_NOT_RESOLVED
  (Session info: headless chrome=85.0.4183.83)
    test/system/my_failing_test.rb:29
Run Code Online (Sandbox Code Playgroud)

值得注意的是,第 29 行是 Capybaravisit命令,因此出现了与 DNS 相关的错误消息。

更重要的是,我遵循 Heroku 文档在无头 Chrome 上设置 Selenium。我相信该配置的重要部分在这里: https://devcenter.heroku.com/articles/heroku-ci-browser-and-user-acceptance-testing-uat#testing-with-selenium

总结一下我的配置:我的测试环境有以下构建包app.json

heroku/ruby
heroku/google-chrome
heroku/chromedriver

...并且我逐字添加了 Heroku 建议的“特殊配置”(上述链接中的#3) https://github.com/heroku/heroku-buildpack-google-chrome#selenium

使用构建包时是否缺少某些服务器配置?处理 buildpack 缺少的测试服务器 Web 调用的
功能是什么?rails test

我已经为此奋斗了一段时间,所以非常感谢任何建议!