diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d556deac..daa993b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,6 +38,11 @@ jobs: matrix: ruby-version: ['2.7.5'] steps: + - name: Pin chrome + uses: abhi1693/setup-browser@v0.3.4 + with: + browser: chrome + version: 1036826 - name: Install OS packages run: | sudo apt-get update diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index cc93b326..5222f422 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -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