Skip to content
This repository has been archived by the owner on Nov 27, 2020. It is now read-only.

autocomplete can't be tested #439

Closed
myfitment opened this issue Dec 29, 2013 · 9 comments
Closed

autocomplete can't be tested #439

myfitment opened this issue Dec 29, 2013 · 9 comments

Comments

@myfitment
Copy link

I realize that there are some open issues around this, but while some people have claimed to have solved this, I have found it to be impossible. My assertions for the presence of the jQuery autocomplete fields always fail, regardless of what events I trigger. Even calling the autocomplete field manually generates nothing. The code works flawlessly when tested in the browser.

After 40 hours straight of trying to troubleshoot this one line, I am wondering if anyone else has overcome the issue of Poltergeist not being able to test the jQuery UI autocomplete.

@myfitment
Copy link
Author

I've determined that autocomplete is indeed firing, and is returning a result. However, when debugging via Poltergeist I find that Poltergeist is timing out while waiting for the autocomplete result HTML to generate.

@mikebaldry
Copy link

I got this working once, using key events to simulate someone typing.. if you just set the value, the events don't fire and the autocomplete doesn't show.. (at least in my case)

@superchris
Copy link

element.native.send_keys worked for me

@cshaffer
Copy link

+1 for native.send_keys. Using twitter's typeahead.js

@aprescott
Copy link
Contributor

I think send_keys is the answer here and it seems like autocomplete can be tested. Looks like we can close this.

@h4b00
Copy link

h4b00 commented Sep 16, 2014

hmm send_keys didn't work for me, anyone have example code?

@mmrwoods
Copy link

This is working for me, with both poltergeist/phantomjs and selenium/firefox...

def fill_in_autocomplete(selector, query)
  find(selector).native.send_keys(*query.chars)
end

phantomjs 1.9.7, poltergeist 1.5.1

@joxxoxo
Copy link

joxxoxo commented Jul 8, 2015

I'm also unable to make it work with send_keys :(
phantomjs 2.0.0, poltergeist 1.6.0, jQuery UI Autocomplete 1.11.4

UP: It's actually working, sorry. Didn't work during I was in the pry session, worked after I've left the debugger

@TommyF87
Copy link

TommyF87 commented Nov 8, 2016

@mmrwoods thanks for this solution, it works nicely.

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

No branches or pull requests

8 participants