运行规格时出错:Poltergeist使用CSS选择器检测到另一个元素 [英] Error when running specs: Poltergeist detected another element with CSS selector

查看:94
本文介绍了运行规格时出错:Poltergeist使用CSS选择器检测到另一个元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Gemfile中添加了activeadmin。

I added activeadmin in my Gemfile.

我运行了:

rails g active_admin:install Admin User
rake db:migrate

然后我跑了:

bundle exec rake test:integrations

,我收到此错误:

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.

我尝试按照这篇文章,但我仍然收到错误消息。

I tried excluding the activeadmin js and css as recommended in this post, but I still get the error.

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

Does anyone have any ideas of how to solve this?

推荐答案

我假设消息来自水豚步骤失败。我今天在对ajax格式使用以下命令时遇到了这个问题:

I am assuming the message is from a failing capybara step. I ran into this issue today when using the following against an ajax form:

find('some-css').click()

不幸的是,它有时返回非常令人沮丧的重叠CSS错误。我所做的是改为使用此方法:

Unfortunately on occasion it was returning the very frustrating overlapping css error. What I did was to use this method instead:

find('some-css').trigger('click')

嘿,Presto每次都能工作:)

And hey presto works every time :)

希望这会有所帮助。

这篇关于运行规格时出错:Poltergeist使用CSS选择器检测到另一个元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆