简体   繁体   中英

watir-webdriver phantomjs and ghostdriver

I currently have a rails app that uses rspec and watir-webdriver for my integration tests. I want to run my integration tests in a headless browser (for speed purposes). Since my development is done on a mac the headless gem won't work for me. I am looking to phantomjs as the solution. Whereas phantomjs works well with rspec/capybara (via poltergeist) and there are plenty of examples on how to make that work, I can't find much in the way of getting it to work well with watir-webdriver and ghostdriver.

I have built the "special" phantomjs that ghostdriver requires but I am lost after that. Has anyone used this setup before (rails/watir-webdriver/ghostdriver)?

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

Any help is greatly appreciated!

It is now fully supported by Watir-WebDriver and easy to get running:

Steps to get working on OSX

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM