Skip to content

Commit

Permalink
Backport 3.5.x: Remove webdrivers dependency and adjust spec_helper
Browse files Browse the repository at this point in the history
  • Loading branch information
marlo-longley committed Jan 24, 2024
1 parent 9b9f7cf commit 4463ec8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
1 change: 0 additions & 1 deletion blacklight-spotlight.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,5 @@ these collections.)
s.add_development_dependency 'sitemap_generator'
s.add_development_dependency 'solr_wrapper'
s.add_development_dependency 'sqlite3'
s.add_development_dependency 'webdrivers'
s.add_development_dependency 'webmock'
end
22 changes: 5 additions & 17 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
require 'engine_cart'
EngineCart.load_application!

Internal::Application.config.active_job.queue_adapter = :inline
ActiveJob::Base.queue_adapter = :test

require 'rails-controller-testing'
require 'rspec/collection_matchers'
Expand All @@ -16,23 +16,11 @@
require 'paper_trail/frameworks/rspec'

require 'selenium-webdriver'
require 'webdrivers'
require 'webmock/rspec'

Capybara.javascript_driver = :headless_chrome
Capybara.javascript_driver = :selenium_chrome_headless

Capybara.register_driver :headless_chrome do |app|
Capybara::Selenium::Driver.load_selenium
browser_options = ::Selenium::WebDriver::Chrome::Options.new.tap do |opts|
opts.args << '--headless'
opts.args << '--disable-gpu'
opts.args << '--no-sandbox'
opts.args << '--window-size=1280,1696'
end
Capybara::Selenium::Driver.new(app, browser: :chrome, capabilities: [browser_options])
end
require 'webmock/rspec'
allowed_sites = ['chromedriver.storage.googleapis.com', 'googlechromelabs.github.io', 'edgedl.me.gvt1.com']
allowed_sites = ['chromedriver.storage.googleapis.com']

WebMock.disable_net_connect!(net_http_connect_on_start: true, allow_localhost: true, allow: allowed_sites)

Expand Down Expand Up @@ -83,8 +71,8 @@
config.after(:each, type: :feature) { Warden.test_reset! }
config.include Controllers::EngineHelpers, type: :controller
config.include Capybara::DSL
config.include ::Rails.application.routes.url_helpers
config.include ::Rails.application.routes.mounted_helpers
config.include Rails.application.routes.url_helpers
config.include Rails.application.routes.mounted_helpers
config.include Spotlight::TestFeaturesHelpers, type: :feature
config.include CapybaraDefaultMaxWaitMetadataHelper, type: :feature

Expand Down

0 comments on commit 4463ec8

Please sign in to comment.