Merge pull request #9543 from filipefurtad0/remove_selenium_webdriver

Removes selenium-webdriver and webdriver gems; updates spec_helper
This commit is contained in:
Maikel
2022-08-15 17:34:46 +10:00
committed by GitHub
4 changed files with 3 additions and 36 deletions

View File

@@ -152,10 +152,8 @@ group :test, :development do
gem 'rspec-rails', ">= 3.5.2"
gem 'rspec-retry'
gem 'rswag-specs'
gem 'selenium-webdriver'
gem 'shoulda-matchers'
gem 'timecop'
gem 'webdrivers'
gem 'debug', '>= 1.0.0'
end

View File

@@ -581,11 +581,6 @@ GEM
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
sd_notify (0.1.1)
selenium-webdriver (4.3.0)
childprocess (>= 0.5, < 5.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
semantic_range (3.0.0)
shoulda-matchers (5.1.0)
activesupport (>= 5.2.0)
@@ -658,10 +653,6 @@ GEM
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webdrivers (5.0.0)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (~> 4.0)
webmock (3.17.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
@@ -794,7 +785,6 @@ DEPENDENCIES
rubocop-rails
sd_notify
select2-rails!
selenium-webdriver
shoulda-matchers
sidekiq
sidekiq-scheduler
@@ -814,7 +804,6 @@ DEPENDENCIES
view_component_storybook
web!
web-console
webdrivers
webmock
webpacker (~> 5)
whenever
@@ -825,4 +814,4 @@ RUBY VERSION
ruby 3.0.3p157
BUNDLED WITH
2.1.4
2.1.4

View File

@@ -3,8 +3,6 @@
require 'base_spec_helper'
require 'database_cleaner'
require 'webdrivers'
require 'selenium-webdriver'
require 'view_component/test_helpers'
# This spec_helper.rb is being used by the custom engines in engines/. The engines are not set up to
@@ -15,17 +13,6 @@ unless ENV['DISABLE_KNAPSACK']
Knapsack::Adapters::RSpecAdapter.bind
end
Capybara.register_driver :chrome do |app|
options = Selenium::WebDriver::Chrome::Options.new(
args: %w[headless disable-gpu no-sandbox window-size=1280,768]
)
options.add_preference(:download, default_directory: DownloadsHelper.path.to_s)
Capybara::Selenium::Driver
.new(app, browser: :chrome, options: options)
.tap { |driver| driver.browser.download_path = DownloadsHelper.path.to_s }
end
Capybara.javascript_driver = :chrome
Capybara.default_max_wait_time = 30
Capybara.disable_animation = true
@@ -45,13 +32,6 @@ RSpec.configure do |config|
config.before(:each) { DatabaseCleaner.start }
config.after(:each) { DatabaseCleaner.clean }
def restart_driver
Capybara.send('session_pool').values
.select { |s| s.driver.is_a?(Capybara::Selenium::Driver) }
.each { |s| s.driver.reset! }
end
config.before(:all) { restart_driver }
config.after(:each, js: true) do
Capybara.reset_sessions!
end

View File

@@ -1,8 +1,8 @@
# frozen_string_literal: true
require 'spec_helper'
require 'system_helper'
feature "Cookies", js: true do
describe "Cookies", js: true do
describe "banner" do
# keeps banner toggle config unchanged
around do |example|