Closed docmarionum1 closed 9 years ago
Why? Why would you not just send an event to window
? Why would you make a test depdendent on being run in mocha-phantomjs
?
No, it's not ideal, but there are several outstanding bugs in webkit related to simulating keyboard events.
At least:
https://bugs.webkit.org/show_bug.cgi?id=16735 https://bugs.webkit.org/show_bug.cgi?id=13368
Simulating the event from outside the page (i.e. from phantom) seems to be the best option.
Closing as I think this is a bad idea. If you're fighting phantomjs this much you should test in real browsers (try Firefox + xvbf, perhaps with slimerjs or karma). Also mocha-phantomjs
supports PhantomJS 2 if you bring your own binary via -p
.
I needed to be able to request events be sent to the phantom web page from inside my tests, so I added it as an option in the callPhantom callback.