capybara-envjs
capybara-envjs copied to clipboard
jQuery's live events don't work
Hello there,
Seems capybara-envjs has troubles with jQuery's live events. If an event listener is bound using bind(), everything works fine, but if using live(), it does not. I put together simple example to demonstrate it:
http://github.com/madadam/capybara-envjs-jquery-live-failure-example
Just run ruby -rubygems test.rb to see it. With selenium driver, it works fine, with envjs, it fails.
Yup. Known issue. But so far, no one that has the need to make it work has stepped up to work on it, I'm afraid.
I'd step up, why not :) Is the problem only in capybara-envjs or is it envjs itself?
That'd be cool, if you could.
The problem is in envjs itself and it might be fixed in the Java master (we want to remerge, but it's going take a chunk of time we never seem to find ... the java master underwent a big reorg after the ruby port, before a merge).
The relevant code in the ruby branch is in window/event.js, dispatchEvent in particular. I haven't been tracking what this looks like in the java master lately.
If you try calling a focus before clicking the element, it seems to work:
page.execute_script %Q{ $("#derp").trigger("focus") }
find("#derp").click