Collective Idea

Collective Idea Logo

Eric Milford

Install your own PhantomJS on Travis CI

By Eric Milford on October 17, 2012 in phantom-js and travis-ci

On a current project, we switched our javascript driver to Poltergeist, a driver for Capybara that allows you to run your tests in a headless browser provided by PhantomJS. Happy days and green dots locally, but our build server on Travis CI had a different opinion.

Failure/Error: And I am logged in as user "member@company.com"
  Capybara::Poltergeist::PhantomJSTooOld:
    PhantomJS version 1.6.1 is too old. You must use at least version 1.7.0

Fortunately Travis CI has made it easy and convenient to install any software you like on the virtual machine. So until the default is bumped to the required version of PhantomJS, add the following lines to your .travis.yml and you will be off and running with Poltergeist in no time.

before_install:                                                                                                                                                                                                                               
  - wget http://phantomjs.googlecode.com/files/phantomjs-1.7.0-linux-i686.tar.bz2                                                                                                                                                             
  - tar -xf phantomjs-1.7.0-linux-i686.tar.bz2                                                                                                                                                                                                
  - sudo rm -rf /usr/local/phantomjs                                                                                                                                                                                                          
  - sudo mv phantomjs-1.7.0-linux-i686 /usr/local/phantomjs
By Eric Milford on October 17, 2012 in phantom-js and travis-ci

1 Comment

  1. test website

    test website March 17, 2013 http://testdomain.com

    I believe this web site has got some really fantastic info for everyone . “I like work it fascinates me. I can sit and look at it for hours.” by Jerome K. Jerome.

Post a Comment

Contact Us

Find us on Google Maps
Collective Idea
44 East 8th Street, Suite 410
Holland, Michigan 49423 USA 42.790334-86.105251

Follow us on the Interwebs

We are currently available for medium and long term projects. Please get in touch if we can be of service.