capybara-select2 icon indicating copy to clipboard operation
capybara-select2 copied to clipboard

Capybara::Poltergeist::MouseEventFailed

Open passalini opened this issue 11 years ago • 8 comments

Hi, I'm trying to use this gem at my project, but when I put this in my spec it returns this error:

Capybara::Poltergeist::MouseEventFailed:
  Firing a click at co-ordinates [188, 135] failed. 
  Poltergeist detected another element with CSS selector 'html body 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').

my files: select2_spec.rb:

#...a lot of anothers specs...
select2(@kuririn.email, from: 'User')
expect(page).to_not have_content @goku.email
expect(page).to have_content @kuririn.email

view.html.erb

<%= simple_form_for :filter, url: 'filter', method: 'get', html: {class: 'form-inline' } do |f| %>
  <label for="user_id">User</label>
  <%= f.input_field :user_id, collection: @project.users, as: :select,
      value_method: :id,
      label_method: :email,
      class: "select_users_by_select2" %>
<% end %>

<% @users.each do |user| %>
  <%= user.email %>
<% end %>

passalini avatar Jul 29 '13 13:07 passalini

+1

chalmagean avatar Sep 02 '13 09:09 chalmagean

+1

zda avatar Sep 18 '13 23:09 zda

people, try this: https://gist.github.com/passalini/6614466

passalini avatar Sep 21 '13 18:09 passalini

This works for me. Clicking on the select2-drop-mask is what the user would actually do to deactivate the select2 drop down.

find(:xpath, '//div[@id="select2-drop-mask"]').click

hotgazpacho avatar May 06 '14 20:05 hotgazpacho

Well, it seems that this isn't going to get fixed I guess :(

domness avatar Jul 18 '14 08:07 domness

I had this problem with contenteditable divs. The parent div would be reported as the "overlapping" element, even if I used CSS to set z-order. When making an example project to demo the error, I found that when I replace poltergeist with selenium the problem went away. YMMV

IamNaN avatar Nov 09 '14 17:11 IamNaN

+1

HenryYan2012 avatar Jan 28 '15 05:01 HenryYan2012

I had this problem with popups. I have two step in my spec test. Step one, Open a popup and close it. Step two, click a button on the main page. Poltergeist executed step two before the popup really closed. So "overlapping" element occured. BTW, my spec test works well with selenium.

HenryYan2012 avatar Jan 28 '15 08:01 HenryYan2012