Skip to content

Instantly share code, notes, and snippets.

@masonicboom
Created February 8, 2011 00:29
Show Gist options
  • Select an option

  • Save masonicboom/815595 to your computer and use it in GitHub Desktop.

Select an option

Save masonicboom/815595 to your computer and use it in GitHub Desktop.
Example of how to run a set of tests against multiple browsers using Selenium, Capybara, and RSpec
require 'spec_helper'
require 'capybara/rspec'
Capybara.register_driver :selenium_chrome do |app|
Capybara::Driver::Selenium.new(app, :browser => :chrome)
end
SELENIUM_DRIVERS = [:selenium_chrome, :selenium]
SELENIUM_DRIVERS.each do |driver|
describe SomeController, :type => :acceptance do
render_views
before(:each) do
Capybara.current_driver = driver
end
it 'should do stuff' do
# do stuff...
end
it 'should do more stuff' do
# do more stuff...
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment