Skip to content

Using Capybara Webkit

brysgo edited this page Nov 8, 2014 · 3 revisions

Teaspoon allows using Capybara Webkit when running specs from the rake task or command line interface. This allows for a quick alternative to phantomjs if you can't get it working reliably.

This page is dedicated to how to get setup and running.

Setup

You'll need to include the capybara-webkit gem in your Gemfile.

gem "capybara-webkit"

Configure Teaspoon to use the capybara_webkit driver.

spec/javascripts/teaspoon_env.rb

Teaspoon.configure do |config|
  config.driver = "capybara_webkit"
end

Now when you run rake teaspoon it should be using Capybara Webkit to run your specs. You can also override the driver using rake teaspoon DRIVER=capybara_webkit or bundle exec teaspoon --driver=capybara_webkit.

Travis CI

To get this running on Travis CI, you'll need to add a .travis.yml file that contains the following:

.travis.yml

before_script:
  - 'sh -e /etc/init.d/xvfb start'
env:
  - DISPLAY=":99.0"