简体   繁体   English

水豚有可能检查HTML元素是否被溢出覆盖:隐藏的父对象?

[英]It it possible for Capybara to check if an HTML element is covered via an overflow: hidden parent?

If an HTML button overflow's beyond an ancestor's bounds, and that ancestor has overflow: hidden , then a user cannot click the button. 如果HTML按钮的溢出超出了祖先的范围,并且该祖先已经overflow: hidden ,那么用户将无法单击该按钮。 Is it possible to catch errors like this using Capybara? 是否有可能使用Capybara捕获此类错误? Element.visible? Element.visible? returns true in this case, even though the user cannot see/interact with the element. 在这种情况下,即使用户看不到元素或与元素进行交互,它也会返回true。

没有布尔方法可以检查它是否重叠,但是如果您尝试与之交互(单击它),它将失败,这是在功能测试(而不是测试按钮的可见性)中应该做的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM