Skip to content

Commit

Permalink
Merge pull request #2026 from tf/selenium-4-15
Browse files Browse the repository at this point in the history
Replace webdrivers with selenium-webdriver 4.15
  • Loading branch information
tf authored Nov 14, 2023
2 parents 56f026f + 77b6f4b commit 79d55d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pageflow.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'puma', '~> 3.12'

# Chrome Headless browser testing
s.add_development_dependency 'webdrivers', '= 5.3.0'
s.add_development_dependency 'selenium-webdriver', '~> 4.15'

# View abstraction fro integration testing
s.add_development_dependency 'domino', '~> 0.7.0'
Expand Down
19 changes: 7 additions & 12 deletions spec/support/pageflow/support/config/capybara.rb
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
require 'capybara/rspec'
require 'selenium-webdriver'
require 'capybara/chromedriver/logger'
require 'webdrivers/chromedriver'

Capybara.register_driver :selenium_chrome_headless_no_sandbox do |app|
browser_options = ::Selenium::WebDriver::Chrome::Options.new
browser_options.args << '--headless'
browser_options.args << '--disable-gpu'
# Required for chrome to work in container based Travis environment
# (see https://docs.travis-ci.com/user/chrome)
browser_options.args << '--no-sandbox'

capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
# see https://github.com/SeleniumHQ/selenium/issues/3738
'goog:loggingPrefs': {browser: 'ALL'}
options = Selenium::WebDriver::Options.chrome(
logging_prefs: {browser: 'ALL'}
)

options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument('--disable-gpu') if Gem.win_platform?

Capybara::Selenium::Driver.new(app,
browser: :chrome,
capabilities: [browser_options, capabilities])
options: options)
end

Capybara.javascript_driver = :selenium_chrome_headless_no_sandbox
Expand Down

0 comments on commit 79d55d4

Please sign in to comment.