Phantomjs and ghostdriver for watir-webdriver

I currently have a rails application that uses rspec and watir-webdriver for my integration tests. I want to run my integration tests in a browser without a browser (for speed). Since my development is done on mac, a headless stone will not work for me. I view phantomjs as a solution. While phantomjs works well with rspec / capybara (via poltergeist), and there are many examples of how to make this work, I cannot find much to make it work with watir-webdriver and ghostdriver.

I built the โ€œspecialโ€ phantoms that a ghost ghost requires, but after that I got lost. Has anyone used this setting before (rails / watir-webdriver / ghostdriver)?

My main goal is to speed up my integration tests. Therefore, if someone has a better suggestion than what I described here, I am flexible :)

Any help is much appreciated!

+7
source share
1 answer

Now it is fully supported by Watir-WebDriver and is easily accessible:

OSX Steps

  • First make sure you have homebrew installed
  • brew update
  • brew install phantomjs
  • Launch 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" 

More on this blog post: http://watirmelon.com/2013/02/05/watir-webdriver-with-ghostdriver-on-osx-headless-browser-testing/

+21
source

All Articles