DEV: Bump selenium-webdriver version to fix system spec running (#23117)

We can no long user Webdriver - SeleniumHQ/selenium#11066. Bumping selenium-webdriver did the trick, as well as manually setting the user_agent for mobile system specs. Unsure what changed to make this necessary, but it is necessary to get the app to boot in mobile view.
This commit is contained in:
Mark VanLandingham 2023-08-16 15:07:03 -05:00 committed by Alan Guo Xiang Tan
parent 210f4ad3e7
commit 4290036c0c
4 changed files with 7 additions and 17 deletions

View File

@ -204,10 +204,6 @@ jobs:
if: matrix.build_type == 'system'
run: bin/ember-cli --build
- name: Setup Webdriver
if: matrix.build_type == 'system'
run: bin/rails runner "require 'webdrivers'; Webdrivers::Chromedriver.required_version='114.0.5735.90'; Webdrivers::Chromedriver.update"
- name: Core System Tests
if: matrix.build_type == 'system' && matrix.target == 'core'
run: RAILS_ENABLE_TEST_LOG=1 RAILS_TEST_LOG_LEVEL=error PARALLEL_TEST_PROCESSORS=4 bin/turbo_rspec --use-runtime-info --profile=50 --verbose --format documentation spec/system

View File

@ -141,9 +141,8 @@ group :test do
gem "fakeweb", require: false
gem "minitest", require: false
gem "simplecov", require: false
gem "selenium-webdriver", require: false
gem "selenium-webdriver", "~> 4.11", require: false
gem "test-prof"
gem "webdrivers", require: false
gem "rails-dom-testing", require: false
end

View File

@ -463,7 +463,7 @@ GEM
google-protobuf (~> 3.23)
sass-embedded (1.64.1-x86_64-linux-gnu)
google-protobuf (~> 3.23)
selenium-webdriver (4.10.0)
selenium-webdriver (4.11.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
@ -515,10 +515,6 @@ GEM
hkdf (~> 1.0)
jwt (~> 2.0)
openssl (~> 3.0)
webdrivers (5.3.1)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (~> 4.0, < 4.11)
webmock (3.18.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
@ -655,7 +651,7 @@ DEPENDENCIES
ruby-readability
rubyzip
sanitize
selenium-webdriver
selenium-webdriver (~> 4.11)
shoulda-matchers!
sidekiq
simplecov
@ -672,7 +668,6 @@ DEPENDENCIES
unf
unicorn
web-push
webdrivers
webmock
yaml-lint
yard

View File

@ -59,12 +59,9 @@ require "shoulda-matchers"
require "sidekiq/testing"
require "test_prof/recipes/rspec/let_it_be"
require "test_prof/before_all/adapters/active_record"
require "webdrivers"
require "selenium-webdriver"
require "capybara/rails"
Webdrivers::Chromedriver.required_version = "114.0.5735.90"
# The shoulda-matchers gem no longer detects the test framework
# you're using or mixes itself into that framework automatically.
Shoulda::Matchers.configure do |config|
@ -255,7 +252,7 @@ RSpec.configure do |config|
SiteSetting.provider = TestLocalProcessProvider.new
WebMock.disable_net_connect!(allow_localhost: true, allow: [Webdrivers::Chromedriver.base_url])
WebMock.disable_net_connect!(allow_localhost: true)
if ENV["CAPYBARA_DEFAULT_MAX_WAIT_TIME"].present?
Capybara.default_max_wait_time = ENV["CAPYBARA_DEFAULT_MAX_WAIT_TIME"].to_i
@ -310,6 +307,9 @@ RSpec.configure do |config|
.new(logging_prefs: { "browser" => browser_log_level, "driver" => "ALL" })
.tap do |options|
options.add_emulation(device_name: "iPhone 12 Pro")
options.add_argument(
'--user-agent="--user-agent="Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/36.0 Mobile/15E148 Safari/605.1.15"',
)
apply_base_chrome_options(options)
end