Automated tests Cy.click失败,因为目标元素已禁用或其部分可见
cy.click失败,原因为“目标元素已禁用”。但此处启用了目标元素。 目标元素的外部TML如下所示 有时cy.click失败,原因是目标元素不完全可见。即,如果按钮或锚定ag文本在该点击失败时部分可见Automated tests Cy.click失败,因为目标元素已禁用或其部分可见,automated-tests,cypress,Automated Tests,Cypress,cy.click失败,原因为“目标元素已禁用”。但此处启用了目标元素。 目标元素的外部TML如下所示 有时cy.click失败,原因是目标元素不完全可见。即,如果按钮或锚定ag文本在该点击失败时部分可见 <a class="btn" data-click="myClickEvent" data-bind="enable: enabled, css: { 'disabled': !enabled() }, attr:{'test-id':te
<a class="btn" data-click="myClickEvent" data-bind="enable: enabled, css: { 'disabled': !enabled() }, attr:{'test-id':text}" test-id="elementDataTestID">...</a>
我调试并发现“EnsureRenotDisabled”正在被调用,在计算subject.prop('disabled')之后,它返回true,抛出该错误。除了力之外,还有其他的解决方法:真的。它可以工作,但不希望使用
情景2:
单击失败的另一种情况是,如果按钮不完全可见,那么它也不工作。
除{force:true}之外的任何解
=>已在cypress.io中提出问题。但他们尚未答复
版本
Cypress版本:5.1。
操作系统:-Windows 10
浏览器:-电子和铬