Search code examples
javascriptruby-on-railsjasminephantomjspoltergeist

Running jasmine specs headlessly with phantomjs


I have been using jasmine-headless-webkit to run my jasmine specs on my Rails 3.2 app, but I recently switched over to phantomjs/poltergeist to run my request specs, so I am needing to upgrade my jasmine tests to also run on phantom. I'd like to get away from using xvfb on my CI server.

Does anyone have any good way to run jasmine tests using phantom in the console? I'm finding surprisingly little info about it on the web.


Solution

  • The simplest solution which i found is setup guard-jasmine (Guard::Jasmine outside of Guard) and then add guard-jasmine -u http://localhost:3001/ to your build script. Works pretty well on my jenkins. Also you need to install phantomJS on the server. In my case i needed also node.js