注意:当我写完这个问题时,解决方案本身就出现了,但也许其他人可能会觉得这很有用,或者可以提供替代方案。
我已阅读以下文章:
此线程: https ://groups.google.com/forum/#!topic/ruby-capybara/Mz7txv1Sm0U
这个 poltergeist 问题:https ://github.com/jnicklas/capybara/issues/19
这个博客:https ://nulogy.com/articles/sleep-is-for-the-weak#.VNVcIrDF8vs
还有这个stackoverflow问题:Capybara synchronize with has_no_css?
但仍然无法拼凑出这个特定问题的答案。
我想等到页面上的元素消失后再继续。
此元素与我要单击的另一个元素重叠。当我尝试单击目标元素时,我收到此错误:
Capybara::Poltergeist::MouseEventFailed:
Firing a click at co-ordinates [1006, 322] failed. Poltergeist detected another element with CSS selector 'html body.widgets div#select2-drop-mask.select2-drop-mask' at this position. It may be overlapping the element you are trying to interact with. If you don't care about overlapping elements, try using node.trigger('click').
我尝试使用.trigger('click')
and .trigger(:click)
even,但似乎没有效果。
我尝试过的其他一些事情(“东西”是消失的元素):
@page.wait_until_thing_invisible
SitePrism::TimeOutWaitingForElementInvisibility:
execution expired