minkphp / MinkSelenium2Driver

Selenium2 (webdriver) driver for Mink framework
MIT License
508 stars 163 forks source link

Current "key*" methods are just emulating JS events #139

Open aik099 opened 10 years ago

aik099 commented 10 years ago

Current "key*" methods are just emulating JS events instead of actually pressing corresponding keys. I recommend using dedicated WebDriver calls for that instead.

Though we need to add test to Mink to ensure that fired JS events are still fired as they should.

aik099 commented 10 years ago

For keyup and keydown events: http://stackoverflow.com/questions/11388327/how-to-write-a-keydown-and-keyup-for-webdriver .

For keypress event: http://grokbase.com/t/gg/webdriver/1261z3gp5n/key-press-for-sequence-keys-not-working-in-firefox (seems like Ctrl+ENTER does trigger it, not sure about Mac).

stof commented 7 years ago

keyup and keydown are hard to use right, because they are low-level actions, and must be applied in an order matching the behavior of a user action.

Btw, the W3C webdriver spec defines only 2 actions: keyDown and keyUp. There is a no keypress action here (browsers may trigger a keypress event when processing a keyDown action, if they dispatch such an event in normal usage, but it is not a separate action. So I don't know whether these methods are really usable as is in the Mink API

aik099 commented 7 years ago

Then we'll just update keyDown and keyUp methods we have to use WebDriver API and keep keyPress method intact.

usmonster commented 7 years ago

Hello! What's the status of this? It's very much needed.