Created
June 23, 2015 11:10
-
-
Save hybridknight/4cbe3e057cd13a10a3eb to your computer and use it in GitHub Desktop.
typeahead.js spec support for capybara, poltergeist, and selenium
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fill_in_autocomplete(selector, value) | |
find("#{selector}.typeahead.tt-input").native.send_keys value | |
end | |
def choose_autocomplete(text) | |
expect(page).to have_css(".tt-suggestion p", text: text, visible: false) | |
script = %Q{ $('.tt-suggestion:contains("#{text}")').click() } | |
page.execute_script(script) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment