http://ariya.ofilabs.com/2012/03/phantomjs-and-travis-ci.html the document shared by @arian will help too