运行specs时出错:Poltergeist使用CSS选择器检测到另一个元素

Gab*_*nor 3 capybara activeadmin poltergeist

我在我的Gemfile中添加了activeadmin.

我跑了:

rails g active_admin:install Admin User
rake db:migrate
Run Code Online (Sandbox Code Playgroud)

然后我跑了:

bundle exec rake test:integrations
Run Code Online (Sandbox Code Playgroud)

我收到了这个错误:

Capybara::Poltergeist::ClickFailed:
Click at co-ordinates [330.5, 714] failed. Poltergeist detected another element 
with CSS selector 'html body div#ui-datepicker-div.ui-datepicker.ui-widget.ui-widget-content.ui-helper-clearfix.ui-corner-all div.ui-datepicker-header.ui-widget-header.ui-helper-clearfix.ui-corner-all div.ui-datepicker-title span.ui-datepicker-month' 
at this position. It may be overlapping the element you are trying to click.
Run Code Online (Sandbox Code Playgroud)

我试着不包括activeadmin js和css在推荐这篇文章,但我仍然得到错误.

有没有人有任何想法如何解决这个问题?

Don*_*ono 18

我假设消息来自失败的水豚步骤.今天我在针对ajax表单使用以下内容时遇到了这个问题:

find('some-css').click()
Run Code Online (Sandbox Code Playgroud)

不幸的是,它有时会返回非常令人沮丧的重叠css错误.我所做的是使用这种方法:

find('some-css').trigger('click')
Run Code Online (Sandbox Code Playgroud)

嘿presto每次都工作:)

希望这可以帮助.