public
Created

Trigger change event in Capybara

  • Download Gist
jQueryEvents.rb
Ruby
1 2 3 4 5 6 7 8
module JQueryEventsHelpers
def trigger_change(jQuerySelector)
script = "$('#{jQuerySelector}').trigger('change');"
page.execute_script(script);
end
end
 
World(JQueryEventsHelpers)

Very nice. This helped me a lot. I forked it and modified to allow triggering any javascript event:

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.