Skip to content

Instantly share code, notes, and snippets.

@suhrawardi
Created September 22, 2010 18:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save suhrawardi/592281 to your computer and use it in GitHub Desktop.
Save suhrawardi/592281 to your computer and use it in GitHub Desktop.
$: << File.expand_path(File.dirname(__FILE__) + "/../support")
#$DEBUG = true
$ROOT_PATH = File.expand_path(File.dirname(__FILE__))
require 'capybara'
require 'capybara/cucumber'
require 'spec'
# Remove this line if you don't want Cucumber Unicode support
require 'cucumber/formatter/unicode'
Capybara.run_server = false
Capybara.app_host = 'http://some.domain'
require 'selenium-webdriver'
Selenium::WebDriver.for :firefox
Capybara.default_driver = :selenium
# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
# order to ease the transition to Capybara we set the default here. If you'd
# prefer to use XPath just remove this line and adjust any selectors in your
# steps to use the XPath syntax.
Capybara.default_selector = :css
@andrewhavens
Copy link

This can be done a lot more simply now because Capybara bundles selenium-webdriver. It also default to using Firefox:

require 'capybara/cucumber'
Capybara.default_driver = :selenium
Capybara.app_host = 'http://my.app'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment