Skip to content

Instantly share code, notes, and snippets.

@pullmonkey
Created March 3, 2011 22:47
Show Gist options
  • Save pullmonkey/853786 to your computer and use it in GitHub Desktop.
Save pullmonkey/853786 to your computer and use it in GitHub Desktop.
capybara celerity driver does not trigger JS change event
When /^(?:|I )select "([^"]*)" from "([^"]*)"(?: within "([^"]*)")?$/ do |value, field, selector|
with_scope(selector) do
select(value, :from => field)
# this is what changed .. 1) need to find the ID of the field that was passed in and then trigger a change event
id = "#" + find_field(field)[:id]
page.execute_script("$('#{id}').trigger('change');")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment