Dead-simple way to make Capybara and Selenium play together
CapybaraSelenium is on its way towards 1.0.0. Please refer to issues for details.
Add this line to your application's Gemfile:
gem 'capybara-selenium'
And then execute:
$ bundle
Or install it yourself as:
$ gem install capybara-selenium
Supported application servers:
- Modular sinatra apps (through config.ru)
Supported selenium servers:
- Remote selenium server
# features/support/continous_integration.rb
APP_SERVER_HOST = ENV['CI_APP_SERVER_HOST'] || 'localhost'
APP_SERVER_PORT = ENV['CI_APP_SERVER_PORT'] || 8080
SELENIUM_SERVER_URL = ENV['CI_SELENIUM_SERVER_URL'] ||
'http://127.0.0.1:4444/wd/hub'
CapybaraSelenium.configure(:rack, :remote) do |config|
config.app_server.host = APP_SERVER_HOST
config.app_server.port = APP_SERVER_PORT
config.app_server.config_ru_path = File.expand_path(
File.join(__FILE__, '../web_app/config.ru'))
config.selenium_server.url = SELENIUM_SERVER_URL
config.selenium_server.capabilities = { browser_name: browser_name }
end
- Fork it ( https://github.com/dsaenztagarro/capybara_selenium/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request