Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
Make capybara drivers configurable via metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Luuk Veenis committed Nov 11, 2016
1 parent d0cffc1 commit d179a8c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ gem 'solidus_auth_devise', '~> 1.0'

group :development, :test do
gem "pry-rails"
gem "selenium-webdriver"
gem "chromedriver-helper"
end

gemspec
8 changes: 7 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
# Paypal requires TLS v1.2 for ssl connections
Capybara::Poltergeist::Driver.new(app, { phantomjs_options: ['--ssl-protocol=tlsv1.2'] })
end
Capybara.javascript_driver = :poltergeist
Capybara.register_driver :chrome do |app|
Capybara::Selenium::Driver.new(app, browser: :chrome)
end

VCR.configure do |c|
c.cassette_library_dir = "spec/fixtures/cassettes"
Expand Down Expand Up @@ -91,6 +93,10 @@ def create_gateway(opts = {})
config.include Spree::TestingSupport::UrlHelpers
config.include BraintreeHelpers

config.before(:each, type: :feature, js: true) do |ex|
Capybara.current_driver = ex.metadata[:driver] || :poltergeist
end

config.before :suite do
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with :truncation
Expand Down

0 comments on commit d179a8c

Please sign in to comment.