thoughtbot/capybara-webkit — Issue #227: Make #click work like in real browsers (add mouseDown/Up)
Author: jgonera
Created: 2011-12-14 09:28:18+00:00
State: open

Right now, the `click` method fires the only the click event:
https://github.com/thoughtbot/capybara-webkit/blob/master/src/capybara.js#L63

That's not what happens in real browsers when the user clicks some element. Instead, three events should be fired in this order: mouseDown, mouseUp, click (see http://www.quirksmode.org/js/events_mouse.html). This is important when testing web apps that use some more sophisticated frameworks which provide desktop-like widgets, e.g. Dojo.

They sometimes use mouseDown/Up instead of click event to detect user clicks because those events contain more information (e.g. which mouse button was clicked). Which brings another issue: optional argument for `click` indicating the mouse button to be clicked.