docker - 如何从打开浏览器(非无头)的容器中运行赛普拉斯测试?
问题描述
我正在尝试非无头运行赛普拉斯测试(我知道如何无头运行它们)以使其打开 Firefox 并运行所有测试。在文档中,我需要做的就是运行cypress run --browser firefox
,这是在您使用 npm 包管理器安装 cypress 时使用的。我正在使用容器化的赛普拉斯。
容器结构:
cypress
- integration
- cypress.json
- plugins
- node_modules
显然我可以运行docker run -it -v $PWD:/services/cypress -w / --entrypoint=cypress tdd_cypress --browser firefox run
这在我的情况下会引发错误。
编辑:
我再次运行该命令以查看实际发生的情况,它似乎正在运行,但它正在容器内运行测试。当我按下 Ctrl+C 时,我在看到这个后得出了这个结论:
^CThe Test Runner unexpectedly exited via a exit event with signal SIGINT
Please search Cypress documentation for possible solutions:
https://on.cypress.io
Check if there is a GitHub issue describing this crash:
https://github.com/cypress-io/cypress/issues
Consider opening a new issue.
----------
Platform: linux (Debian - 10.3)
Cypress Version: 4.8.0
^ 这让我觉得测试确实在运行我只是看不到它们在运行,因为它们在容器中运行(如果我在 CI 中无头运行测试,这很好)。
如何在打开浏览器并在容器中运行 Cypress 的情况下运行测试?
解决方案
推荐阅读
- node.js - 输入到我的数据库中的数据与我输入到我的 mongodb 中的数据不同
- typescript - 在注册时获取新用户的名称并使用 Cloud Functions 存储在数据库中
- eloquent - 获取不同连接上的表和关系
- javascript - Vuefire Firestore 设置数据
- xml - 用 Kotlin 解析 XML?
- python - 从 3D 点获取深度图
- ios - NavigationLink SwiftUI 导致加载图像时出现问题
- python - 哪个代码更简洁高效?
- twitter-bootstrap - 无行与有行的引导容器只有一列,宽度为 100%
- azure - 如何调试 Azure Stack 应用服务 webfarm 部署因超时而失败?