ebrehault / resurrectio

CasperJS test recorder Chrome extension
GNU General Public License v2.0
721 stars 106 forks source link

Unable to record scripts if bootstrap-dropdown.js is included #15

Open dzwicker opened 10 years ago

dzwicker commented 10 years ago

Hi,

we use casperjs for our web tests and i have tried to record some basic scripts with resurrectio. But on our web pages nothing was recorded. I started to reduce the page content to figure out what the problem is. I thing the problem is located in the bootstrap-dropdown.js lib. I will attach a zip (png just rename) with 2 files as test case. The html page and the bootstrap script. I disable the bootstrap script and record everything will work and the click to the button is recorder. But with the bootstrap script no click is recorded.

test

ebrehault commented 10 years ago

Hi,

That's probably caused by event propagation stopped somewhere, but at first sight, I do not see anything harmful in bootstrap-dropdown.js. I will test more precisely to find out.

ebrehault commented 10 years ago

ok I found the problem. In bootstrap-dropdown.js, line 161, you have: .on('click.dropdown-menu', function (e) { e.stopPropagation() }) As there is no selector, it stops the propagation to any click. It should be something like: .on('click.dropdown-menu', '.dropdown', function (e) { e.stopPropagation() })

Maybe that's fixed in a newer version of bootstrap 2.

Nevertheless, the problem will remain anyway for the dropdown menu itself: as progation is stopped, resurrectio will not get the click event. So we probably need to overload the stopPropagation method to make sure resurrectio always gets informed of anything happening.