基于空手道UI的测试成功地在本地运行,使用空手道铬(步骤这里)启动带有暴露端口的容器。
现在,我试图在CI中的空手道铬容器中运行测试。我已经用KARATE_SOCAT_START=true启动了空手道铬容器,然后执行java -jar (独立jar)命令来运行测试。非基于UI的测试通过,但UI测试将引发以下异常:
ERROR com.intuit.karate - http request failed:
15:26:09 DOCKER: org.apache.http.conn.HttpHostConnectException: Connect to localhost:9222 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused (Connection refused)请注意,没有配置带有停靠器的driverTarget。只有以下驱动程序的配置:
* configure driver = { type: 'chrome', start: false, showDriverLog: true, port:9222 ,pollAttempts: 5}是否有可能使它以这种方式工作,还是应该设置一个自定义码头映像?
发布于 2022-11-23 15:01:53
我知道这个问题很古老,但是今天我偶然发现了同样的问题,我不得不为自动化配置空手道用户界面测试。我找到的解决方案是按以下方式配置铬驱动程序:
* configure driver = { type: 'chrome', showDriverLog: true, port: 9222, pollAttempts: 5, addOptions:['--no-sandbox'], headless: true }然后空手道独立的jar能够启动浏览器,所有测试都通过了。
希望这能有所帮助!
https://stackoverflow.com/questions/66273843
复制相似问题