测试 javascript 小部件是否存在

发布于 2024-12-28 16:06:56 字数 31 浏览 2 评论 0原文

我如何用水豚轻松测试黄瓜,页面上是否存在小部件?

How I can easy test in cucumber with capybara, exist widget on page or not?

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

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

发布评论

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

评论(1

み格子的夏天 2025-01-04 16:06:56

如果您要使用本地脚本 src 创建小部件,则只需使用

标记 Cucumber 功能
@javascript

它会为你评估 javascript。

如果您从其他站点加载小部件,则此方法将不起作用(并且您需要查看 Selenium 或类似的方法)

If you are creating the widget with the script src being local, then just mark the cucumber feature with


@javascript

And it will evaluate javascript for you.

If you're loading a widget from another site, then this method won't work (and you'll need to look at Selenium or similar)

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