使用 cypress 在 CI 中测试 Web 扩展

发布于 2025-01-15 18:24:27 字数 369 浏览 4 评论 0原文

我想使用 cypress 将 E2E 测试添加到我的 Web 扩展中,并在 CI 上运行它们。

这可能吗?

测试在 $cypress open 上本地通过,但在 $cypress run 上失败

该扩展向 dom 中添加了一个元素,但 cypress 找不到它(该扩展没有似乎以无头模式加载)

这是一个可重现的存储库,其中包含最简单的一行测试: https://github.com/goldylucks/cypress-test-tiny

I want to add E2E tests to my web extension, using cypress, and run them on a CI.

Is that even possible?

The tests pass locally on $ cypress open, but fail on $cypress run

The extension adds an element to the dom and cypress can't find it (the extension doesn't seem to get loaded in headless mode)

Here's a reproducible repo with the most simple one line test:
https://github.com/goldylucks/cypress-test-tiny

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文