Docker容器中的Chrome无头的调试角度测试

发布于 2025-02-10 01:09:05 字数 116 浏览 2 评论 0原文

我想调试我的角度测试(Jasmine + Karma)在Docker容器下在Chrome无头部运行。 因此,我可以编写更好的角度测试,并通过调试启用启用测试文件来理解问题。

请求查看此上的任何文档/参考。

I want to debug my Angular test (Jasmine + Karma) running in Chrome Headless under Docker Container.
So I can write better Angular Tests with Debugging enabled for my test files to understand the issue.

Requesting to see any documentation/references on this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

窗影残 2025-02-17 01:09:05

当您开始测试时,您会看到一个消息:

[karma-server]: Karma v4.0.0 server started at http://0.0.0.0:9876/

这是我们需要暴露的端口。在Docker组合中,看起来像这样:

    ports:
      - 9876:9876

然后您可以在浏览器中转到该URL。

奖励积分:如果您的Docker主机是遥远的,则可以在机器和Docker主机之间打开SSH隧道:

ssh -L 9876:localhost:9876 [email protected] -p 22 -N

When you kick off the tests, you'll see a message like:

[karma-server]: Karma v4.0.0 server started at http://0.0.0.0:9876/

That's the port that we need to expose. In Docker Compose, it would look like this:

    ports:
      - 9876:9876

Then you can just go to that URL in your browser.

Bonus points: if your docker host is remote, you can open an SSH tunnel between your machine and docker host like this:

ssh -L 9876:localhost:9876 [email protected] -p 22 -N
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文