检查元素的功能未显示在量角器中

oc.*_*ara 3 end-to-end protractor

如何检查元素未显示在量角器中?

我对带有返回 true 或 false 参数的通用函数感兴趣。我会在测试中多次使用它。

ale*_*cxe 6

.isDisplayed() 你的功能是:

expect(elm.isDisplayed()).toBe(false);  // elm is not visible
Run Code Online (Sandbox Code Playgroud)

  • @ginna 好吧,我们在这里谈论可见性检查。如果您的元素根本不存在于 DOM 中,则您需要使用 `.isPresent()` 代替。 (2认同)