jamesshore / quixote

CSS unit and integration testing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add PhantomJS 2.x to test suite

jamesshore opened this issue · comments

Add PhantomJS to the list of supported browsers.

Blocked by Medium/phantomjs#288.

PhantomJS 1.9.x does not work with Quixote because PhantomJS uses an old version of WebKit that doesn't support "load" events on <link> tags. (See ariya/phantomjs#11721.) The load event is needed for stylesheets, which we use heavily in our tests.

The new 2.0 version of PhantomJS will hopefully fix this problem. We're waiting for the PhantomJS npm module to come out before supporting it, as it makes our build automation cleaner.

The PhantomJS npm module is blocked on Medium/phantomjs#288. When this issue is fixed, we should be able to support PhantomJS.

nice to see :)
awesome that you picked it up so fast

I assume it's still possible to test against PhantomJS 2.0 if the binary is already installed? From my understanding, the npm module just downloads it from the website.

Definitely. This is just about adding it to our test suite and ensuring any cross-browser incompatibilities are addressed.

Right now, PhantomJS 2.0 should work (even 1.x works for some people's needs) but it hasn't gone through our test suite.

Great! I'll be sure to give it a try later today.

It looks like the phantomjs installer we were waiting on has been forked, so it may be possible to implement this now.

  • phantomjs2 supports installing on Mac
  • phantomjs2.0 (a fork of phantomjs2) supports installing on Mac and Linux

It seems like the original phantomjs installer is still waiting on Windows binary support, but double-check Medium/phantomjs#288 before implementing.

To do this, we need a way for PhantomJS to fit into our workflow. That probably means having a way of starting and stopping PhantomJS from the Jakefile.

This isn't very high on my priority list, so I'm looking for someone who wants this to submit a pull request.

I've decided to stop officially supporting headless browsers as a general rule. The purpose of Quixote is to check how sites display to users on their actual browsers, so testing against a headless browser defeats the purpose. With tools like Karma, it isn't necessary to use a headless browser.

That said, we do test against Safari, which uses WebKit just like PhantomJS does. It's likely that PhantomJS will work just fine. If it doesn't, it's probably a bug in PhantomJS (or an outdated version of WebKit).