Skip to content

Commit

Permalink
Merge pull request #1402 from alphagov/chromedriver
Browse files Browse the repository at this point in the history
Use govuk_test
  • Loading branch information
kevindew authored Jul 2, 2019
2 parents 10b2123 + 6cf2a41 commit 88cf865
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 21 deletions.
4 changes: 1 addition & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,9 @@ end

group :test do
gem 'capybara'
gem 'chromedriver-helper'
gem 'govuk_test'
gem 'faker'
gem 'minitest-reporters'
gem 'mocha'
gem 'puma'
gem 'selenium-webdriver'
gem 'webmock', '~> 3.6.0', require: false
end
13 changes: 10 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ GEM
sassc-rails (>= 2.0.1)
govuk_schemas (3.2.0)
json-schema (~> 2.8.0)
govuk_test (1.0.0)
capybara
puma
selenium-webdriver (>= 3.142)
webdrivers
hashdiff (0.4.0)
htmlentities (4.3.4)
http-cookie (1.0.3)
Expand Down Expand Up @@ -353,6 +358,10 @@ GEM
unicorn (5.4.1)
kgio (~> 2.6)
raindrops (~> 0.7)
webdrivers (4.0.1)
nokogiri (~> 1.6)
rubyzip (~> 1.0)
selenium-webdriver (>= 3.0, < 4.0)
webmock (3.6.0)
addressable (>= 2.3.6)
crack (>= 0.3.2)
Expand Down Expand Up @@ -382,7 +391,6 @@ DEPENDENCIES
better_errors
binding_of_caller
capybara
chromedriver-helper
dalli
faker
gds-api-adapters (~> 59.5)
Expand All @@ -392,20 +400,19 @@ DEPENDENCIES
govuk_frontend_toolkit (~> 8.2.0)
govuk_publishing_components (~> 17.11.0)
govuk_schemas (~> 3.2)
govuk_test
htmlentities (~> 4.3)
jasmine-rails
minitest-reporters
mocha
plek (~> 3.0)
pry-byebug
puma
rack_strip_client_ip (~> 0.0.2)
rails (~> 5.2.3)
rails-controller-testing (~> 1.0)
rails-i18n (>= 4.0.4)
rails_translation_manager (~> 0.1.0)
sass-rails (~> 5.0)
selenium-webdriver
slimmer (~> 13.1)
uglifier (>= 1.3.0)
webmock (~> 3.6.0)
Expand Down
16 changes: 1 addition & 15 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,9 @@

Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new

Capybara.register_driver :headless_chrome do |app|
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
chromeOptions: { args: %w(headless disable-gpu no-sandbox) }
)
client = Selenium::WebDriver::Remote::Http::Default.new
client.read_timeout = 120 # Asset compilation can result in a timeout on the first request hence the increase.

Capybara::Selenium::Driver.new(
app,
browser: :chrome,
desired_capabilities: capabilities,
http_client: client
)
end
GovukTest.configure

Capybara.default_driver = :headless_chrome
Capybara.javascript_driver = :headless_chrome

GovukAbTesting.configure do |config|
config.acceptance_test_framework = :active_support
Expand Down

0 comments on commit 88cf865

Please sign in to comment.