Last active
December 26, 2018 20:18
-
-
Save alex-ross/5974eabf01ee319630f1652556235271 to your computer and use it in GitHub Desktop.
Nanobox + Capybara + Rails + RSpec
This file contains 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
# boxfile.yaml | |
# ... | |
data.chrome: | |
image: selenium/standalone-chrome | |
local_only: true | |
# ... |
This file contains 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
# Gemfile | |
group :development, :test do | |
gem 'rspec-rails' | |
gem "capybara" | |
gem "selenium-webdriver" | |
end |
This file contains 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
# spec/rails_helper.rb | |
# ... | |
Capybara.register_driver :remote_chrome do |driver| | |
Capybara::Selenium::Driver.new(driver, | |
browser: :remote, | |
desired_capabilities: :chrome, | |
url: "http://#{ENV["DATA_CHROME_HOST"]}:4444/wd/hub") | |
end | |
Capybara.server_host = ENV["HOSTNAME"] | |
Capybara.javascript_driver = :remote_chrome | |
Capybara.default_driver = :remote_chrome | |
# And if you have VCR as well you can comment out this | |
###################################################### | |
#VCR.configure do |config| | |
# ignore_hosts = %w[localhost 127.0.0.1] | |
# ignore_hosts << ENV["DATA_CHROME_HOST"] if ENV["DATA_CHROME_HOST"].present? | |
# ignore_hosts << ENV["HOSTNAME"] if ENV["HOSTNAME"].present? | |
# config.ignore_hosts(*ignore_hosts) | |
#end | |
# ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment