Reputation: 4237
I am looking for some ideas on how can I run my jasmine spec on travis-ci in a headless mode. I am looking to use chrome for the headless browser. I followed this blog post to set up my travis builds with chrome to start and I think chrome is running except it has nothing to do.
So I have some serious doubts regarding that:
If I can launch chrome in a headless mode, I can pretty much do anything thats possible to do in chrome normally. So say I want this headless chrome to navigate to google.com, or open up a html
file from my repo, how can I do that? Theres so much about starting it, nothing to do after that.
In the blog post there is a mention about the jasmine spec being run, but nothing about getting it to run. As in how to run.
I also looked up the travis-ci documentation for gui headless testing. Theres a small example related to running jasmine specs, but I cannot figure out anything from it.
So as of now, I have looked quite extensively but with no results. Can someone please guide me a little?
Upvotes: 4
Views: 984
Reputation: 2638
In jasmine 2.0 the default runner is now phantom js which is headless webkit. It's not chrome, but it will run headless and should be pretty similar. If you really want to use chrome, you should be able to use jasmine selenium runner and configure it to run with chrome. All you should need to do in your travis.yml is add export DISPLAY=:99.0
before your suite starts.
Alternatively, the jasmine selenium runner gem also supports running specs in sauce if you have an account with them, and that will let you run across whatever browsers you want. This is what jasmine uses to test itself on travis.
Upvotes: 2