Testcafe 可以看到按钮但不能点击它

sjt*_*003 6 javascript testing automated-tests angularjs testcafe

在 testcafe 测试中,我如何点击一个清晰可点击的元素(t.debug()我可以点击该元素)并且不使用ClientFunctiont.eval- 在 testcafe 的 github 问题中推荐的这些“解决方法”不起作用。

一些额外的考虑:

  • 我正在测试的代码是 Angular 1.7。
  • Selector被验证为正确的(我尝试了各种类型的选择)
  • 测试咖啡厅版本 1.8.4
  • t.wait在选择之前和之后尝试了不同的时间,然后单击
  • 我试过改变元素类型(<button>to<div>等)

小智 5

在单击之前尝试等待元素可见

await element.with({ visibilityCheck: true }).with({timeout: 10000});
Run Code Online (Sandbox Code Playgroud)