TravisCI seems to be unable to start PhantomJS to run my Karma/Jasmine tests. Here is the error log:
INFO [karma]: Karma v0.12.16 server started at http://localhost:9876/
INFO [launcher]: Starting browser PhantomJS
WARN [watcher]: Pattern "/home/travis/build/fender/dmeapp/config.js" does not match any file.
ERROR [launcher]: Cannot start PhantomJS
INFO [launcher]: Trying to start PhantomJS again (1/2).
ERROR [launcher]: Cannot start PhantomJS
INFO [launcher]: Trying to start PhantomJS again (2/2).
ERROR [launcher]: Cannot start PhantomJS
ERROR [launcher]: PhantomJS failed 2 times (cannot start). Giving up.
Warning: Task "karma:continuous" failed. Use --force to continue.
The full build can be seen here: https://travis-ci.org/fender/dmeapp/builds/29499011 The repository is available here: https://github.com/fender/dmeapp
I am able to run the tests locally. Perhaps there is some extra step I need to take for PhantomJS to be available on the TravisCI instance?
You just have to install the karma-phantomjs-launcher and PhantomJS will work on Travis. However, if you use Firefox as the testing browser, then you have to include these two lines:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
In summary, this is what you have to include in your .travis.yml file:
language: node_js
node_js:
- "0.11"
- "0.10"
before_script:
- npm install -g grunt-cli
- npm install -g bower
- npm install -g karma
- npm install karma-phantomjs-launcher -save-dev
- bower install
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With