Created
March 10, 2014 07:55
-
-
Save justin808/9461067 to your computer and use it in GitHub Desktop.
Capybara, Poltergeist, typeahead.js
This file contains 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) | |
script = %Q{ $('#{selector}').val('#{value}').focus().keypress() } | |
page.execute_script(script) | |
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