GhostDriver has been released which means it is now easy to run reliable headless WebDriver tests on Mac OSX.
Steps to get working on OSX
- First make sure you have homebrew installed
brew install phantomjs
which should install PhantomJS 1.8.1 or newer
- Run irb and start using GhostDriver!
require 'watir-webdriver' b = Watir::Browser.new :phantomjs b.goto "www.google.com" b.url #"http://www.google.com.au/" b.title #"Google"
And yes, in case you’re wondering, it does screenshots!