Skip to content

Commit

Permalink
pin chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
mkorcy committed Oct 5, 2023
1 parent 15f9e0d commit bbbb6f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ jobs:
matrix:
ruby-version: ['2.7.5']
steps:
- name: Pin chrome
uses: abhi1693/[email protected]
with:
browser: chrome
version: 1036826
- name: Install OS packages
run: |
sudo apt-get update
Expand Down
3 changes: 3 additions & 0 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,15 @@
ip = IPSocket.getaddress(Socket.gethostname)
Capybara.app_host = "http://#{ip}:#{Capybara.server_port}"
else
Webdrivers::Chromedriver.required_version = '106.0.5249.21'
custom_chrome_path = '/opt/hostedtoolcache/chromium/1036826/x64/chrome'

# Adding chromedriver for js testing.
Capybara.register_driver :selenium_chrome_headless_sandboxless do |app|
browser_options = ::Selenium::WebDriver::Chrome::Options.new
browser_options.headless!
browser_options.args << '--window-size=1920,1080'
browser_options.binary = custom_chrome_path
browser_options.add_preference(:download, prompt_for_download: false, default_directory: DownloadHelpers::PATH.to_s)
Capybara::Selenium::Driver.new(app, browser: :chrome, options: browser_options)
end
Expand Down

0 comments on commit bbbb6f7

Please sign in to comment.