【发布时间】:2019-10-19 07:07:12
【问题描述】:
我在自定义 docker 容器中运行 testcafe,并且我的 Web 应用程序在不同的 docker 容器(或 docker-compose)中运行。如果我从网络浏览器使用该应用程序,我会转到 localhost:8080
如何从 testcafe docker 容器访问应用程序?
> docker run -ti mycustom/testcafe firefox /tests/*
Error details:
Failed to find a DNS-record for the resource at "http://localhost:8080/".
我尝试添加--network=network-name,但没有帮助。
【问题讨论】:
-
您能提供一个minimal reproducible example 来说明您想要做什么吗?当你说“在 localhost 中运行”时,它是哪个 localhost——物理主机的 localhost、同一个 Docker 容器的 localhost、不同的容器或主机的 localhost?
-
感谢您的回答和提问。编辑了我原来的问题。所以,我的应用程序在 docker 中运行,并在另一个容器中运行 testcafe 测试。
标签: docker automated-tests e2e-testing web-testing testcafe