Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to click element #17

Open
GCorbel opened this issue Aug 18, 2013 · 1 comment
Open

Failed to click element #17

GCorbel opened this issue Aug 18, 2013 · 1 comment

Comments

@GCorbel
Copy link

GCorbel commented Aug 18, 2013

Hi,

I create a spec with this line :

select2("A first name A name", from: 'Artiste', search: true) 

And I have this javascript :

$(this).select2(
  placeholder: "Artiste"
  minimumInputLength: 1
  ajax:
    url: '/artists.json'
    data: (term) ->
      q: term
    results: (data) ->
      results: data

It works on production but I have this error when I run my tests :

 Failure/Error: select2("A first name A name", from: 'Artiste', search: true)
 Capybara::Webkit::ClickFailed:
   Failed to click element /html/body/div[@id='page']/div[@id='main-content']/div/div/form[@id='new_painting']/div[2]/div[1]/div/div[@id='s2id_painting_artist_id']/a at position 781, 

The spec fail at this line : https://github.com/goodwill/capybara-select2/blob/master/gem/lib/capybara-select2.rb#L27

Is there something to do?

Thanks!

@bertBruynooghe
Copy link

I think the from field should be the content of the label you added to the original input, not the placeholder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants