capybara-select2
capybara-select2 copied to clipboard
Failed to click element
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!
I think the from field should be the content of the label you added to the original input, not the placeholder.