当 Testcafe 单击禁用按钮或在只读输入中键入文本时的预期行为是什么

What is expected behavior when Testcafe clicks on a disabled button or type text into readonly input

在这两种情况下,Testcafe 的预期行为是什么:

  1. 等待t.click(带有“已禁用”参数的按钮)
  2. await t.typeText(输入'readonly'参数)

Testcafe 应该抛出错误还是跳过操作?目前,在这些情况下,Testcafe 只是跳过这些步骤并继续前进。

我知道我可以使用

await t.expect(input.hasAttribute('readonly').notOk().typeText(input,'text');

如果 Testcafe 自动进行此验证,将非常有帮助。

跳过 disabled/readonly 元素的操作是预期的行为。

我同意在某些情况下验证目标元素是否已启用和可写是有意义的。但是,具有 disabled/readonly 元素的操作在技术上并非无效,它们可能用于某些测试用例。

我在 GitHub 上创建了一个问题以供进一步讨论:https://github.com/DevExpress/testcafe/issues/4106