Skip to content

Instantly share code, notes, and snippets.

@zephyr-dev
Created October 11, 2012 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zephyr-dev/3875727 to your computer and use it in GitHub Desktop.
Save zephyr-dev/3875727 to your computer and use it in GitHub Desktop.
find(".select2-input").set(friend.name)
wait_for_dom # wait for ajax search to return
find(".select2-result-label").click
page.should have_content(friend.name)
def wait_for_dom
uuid = SecureRandom.uuid
page.evaluate_script <<-EOS
_.defer(function() {
$('body').append("<div id='#{uuid}'></div>");
});
EOS
page.find("##{uuid}")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment