datasift/storyplayer — pull request #45 by stuartherbert (2013-08-13 12:09:07+00:00)
Title: New: support for more web browsers

This PR adds initial support for using web browsers other than Chrome. Chrome remains the default web browser, for backwards-compatibility reasons.

* New: environments.defaults.webbrowser config setting (tested with: chrome, firefox, phantomjs, safair)
* New: --web-browser switch for play-story command (tested with: chrome, firefox, phantomjs, safari)
* Updated: relies on datasift/webdriver 1.4.1 or later

Tested with Chrome, Firefox, PhantomJS, and Safari on OSX. Hasn't been tested on Linux yet.

PhantomJS support has the following caveats:

* You have to start vendor/bin/selenium-server-hub.sh, NOT selenium-server.sh, and once selenium has bootstrapped (time varies on how quick your machine is), then run vendor/bin/phantomjs.sh
* At the moment, PhantomJS sessions persist between stories. This appears to be a bug in PhantomJS / GhostDriver. Makes it utterly useless for testing with (for now).
* At the moment, we're not detecting the capabilities of Selenium, which makes our code less robust than it should be. We need to poke through Selenium's API and find a way to ask it which browsers it supports, so that we can provide much better feedback to the user. This can be done as a separate PR in the future.

This PR is a (small) step towards supporting SauceLabs (which is our long-term goal).