Search code examples
ruby-on-railsseleniumcucumberguard

Possible to have selenium do its tests closed using Guard in Ruby on Rails?


I am currently using the guard-cucumber gem so it is running cucumber tests constantly in the background while I am developing in Ruby on Rails. Some of those tests are cucumber tests that open up a browser to run selenium tests. Is it possible to have these tests done closed but still with selenium?

rails 3.0.3
guard 1.0.2
guard-cucumber 0.7.5

Thanks!


Solution

  • I don't think that is possible with the Selenium driver. From their README:

    At the moment, Capybara supports Selenium 2.0 (Webdriver), not Selenium RC. Provided Firefox is installed, everything is set up for you, and you should be able to start using Selenium right away.

    You should really try capybara-webkit (https://github.com/thoughtbot/capybara-webkit):

    The capybara-webkit driver is for true headless testing. It uses QtWebKit to start a rendering engine process. It can execute JavaScript as well. It is significantly faster than drivers like Selenium since it does not load an entire browser.

    It's all running in the terminal which is super awesome.