Created
February 3, 2016 05:44
-
-
Save shekibobo/9394a93d89690dd64be1 to your computer and use it in GitHub Desktop.
Capybara to toggle poltergeist/selenium in RSpec features
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "capybara/poltergeist" | |
Capybara.asset_host = "http://localhost:3000" | |
Capybara.register_driver :poltergeist do |app| | |
Capybara::Poltergeist::Driver.new app, js_errors: true | |
end | |
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