nathanboktae / mocha-phantomjs

:coffee: :ghost: Run client-side mocha tests in the command line through phantomjs
MIT License
954 stars 112 forks source link

Adding sendEvent to the callPhantom callback #176

Closed docmarionum1 closed 9 years ago

docmarionum1 commented 9 years ago

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.

nathanboktae commented 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?

docmarionum1 commented 9 years ago

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.

nathanboktae commented 9 years ago

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.