Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #894 from alphagov/dependabot/bundler/selenium-web…
Browse files Browse the repository at this point in the history
…driver-4.1.0

Bump selenium-webdriver from 3.142.7 to 4.1.0
  • Loading branch information
KludgeKML authored May 17, 2022
2 parents e1f9825 + 998bc68 commit 333bcaa
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gem "nokogiri", "~> 1"
gem "plek", "~> 4"
gem "rest-client", "~> 2"
gem "rspec", "~> 3"
gem "selenium-webdriver", "~> 3"
gem "selenium-webdriver", "~> 4"

group :development do
gem "pry-byebug", "~> 3"
Expand Down
15 changes: 8 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ GEM
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
childprocess (0.9.0)
ffi (~> 1.0, >= 1.0.11)
childprocess (4.1.0)
coderay (1.1.2)
concurrent-ruby (1.1.8)
cucumber (5.3.0)
Expand Down Expand Up @@ -57,7 +56,7 @@ GEM
diff-lcs (1.4.4)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
ffi (1.14.2)
ffi (1.15.5)
http-accept (1.7.0)
http-cookie (1.0.3)
domain_name (~> 0.5)
Expand Down Expand Up @@ -99,6 +98,7 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.2.5)
rspec (3.11.0)
rspec-core (~> 3.11.0)
rspec-expectations (~> 3.11.0)
Expand All @@ -112,9 +112,10 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-support (3.11.0)
rubyzip (2.3.0)
selenium-webdriver (3.142.7)
childprocess (>= 0.5, < 4.0)
rubyzip (2.3.2)
selenium-webdriver (4.1.0)
childprocess (>= 0.5, < 5.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2)
sys-uname (1.2.2)
ffi (~> 1.1)
Expand All @@ -141,7 +142,7 @@ DEPENDENCIES
pry-byebug (~> 3)
rest-client (~> 2)
rspec (~> 3)
selenium-webdriver (~> 3)
selenium-webdriver (~> 4)

BUNDLED WITH
2.1.4
2 changes: 1 addition & 1 deletion features/step_definitions/datagovuk_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
end

And /^I don't get any s3 CSP errors$/ do
messages = Capybara.current_session.driver.browser.manage.logs.get(:browser).map(&:message)
messages = Capybara.current_session.driver.browser.logs.get(:browser).map(&:message)
regex = /Refused to connect to 'https:\/\/s3.*because it violates the following Content Security Policy directive: "connect-src/
messages.each do |message|
expect(message).to_not match(regex)
Expand Down
2 changes: 1 addition & 1 deletion features/support/browser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def browser_has_request_containing
#
# https://github.com/dbalatero/capybara-chromedriver-logger/blob/e972c9865ac1955529649566704d5878205f909c/lib/capybara/chromedriver/logger/collector.rb#L49
@logs += Capybara.current_session.driver
.browser.manage.logs.get(:performance)
.browser.logs.get(:performance)
.map { |log| JSON.load(log.message)['message'] }

# The "messages" we're interested in look like this:
Expand Down
11 changes: 5 additions & 6 deletions features/support/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
# Set up basic URLs
Capybara.app_host = ENV["GOVUK_WEBSITE_ROOT"]

# Use Chrome in headless mode
Capybara.register_driver :headless_chrome do |app|
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
acceptInsecureCerts: true,
Expand All @@ -38,12 +37,12 @@
options.add_argument("--user-agent=Smokey\ Test\ \/\ Ruby")
options.add_argument("--no-sandbox") if ENV.key?("NO_SANDBOX")

Capybara::Selenium::Driver.new(
app,
browser_options = {
browser: :chrome,
options: options,
desired_capabilities: capabilities
)
capabilities: [capabilities, options]
}

Capybara::Selenium::Driver.new(app, browser_options)
end

Capybara.default_driver = :headless_chrome
Expand Down
1 change: 0 additions & 1 deletion features/support/hooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def browser_logs(type)
Capybara
.current_session
.driver.browser
.manage
.logs
.get(type)
end

0 comments on commit 333bcaa

Please sign in to comment.