Skip to content

Instantly share code, notes, and snippets.

@shekibobo
Created August 26, 2014 16:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shekibobo/4c101a8d5a787c6b7d03 to your computer and use it in GitHub Desktop.
Save shekibobo/4c101a8d5a787c6b7d03 to your computer and use it in GitHub Desktop.
Conditionally swapping to Selenium for tests with touchy javascript issues.
# spec/support/capybara.rb
require 'capybara/poltergeist'
Capybara.asset_host = 'http://localhost:3000'
Capybara.javascript_driver = :poltergeist
RSpec.configure do |config|
config.before(:each, touchy_js: true) do
Capybara.current_driver = :selenium
end
config.after(:each, touchy_js: true) do
Capybara.use_default_driver
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment