Question

I've been trying to test a pusher app with Poltergeist. So far I've only had success with capybara-webkit. I've created a minimal example app which demonstrates this in a spec. The spec passes with capybara-webkit but fails with Poltergeist.

Am I missing something or is this type of Pusher (WebSocket) testing not possible with Poltergeist at the moment ?

Thanks in advance.

Was it helpful?

Solution

Update your Pusher javascript library to 2.1.5 (or higher) and it should work (assuming you are also using PhantomJS 1.9 or higher).

Poltergeist automates PhantomJS. PhantomJS does support WebSockets, however it's an older version (until PhantomJS 2.0 comes out, see https://github.com/ariya/phantomjs/issues/11018). The Pusher javascript library also supports various versions of WebSockets so in theory they should work together.

In practice I had trouble getting it to work when using version 2.1.3 of the Pusher JS library (and from the date of this question I imagine you were using an even older version). As of 2.1.5 my poltergeist tests are successfully testing Pusher functionality.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top