diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 43e06217e4..09d55abe26 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -26,6 +26,8 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Build run: docker-compose build + - name: bundle install + run: docker-compose run web bundle install - name: db:reset run: docker-compose run web rails db:reset - name: docker UP diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index 177d3d2af6..9a1eecd3b1 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -13,20 +13,19 @@ # used in docker Capybara.register_driver :selenium_chrome_headless_in_container do |app| - browser_options = ::Selenium::WebDriver::Chrome::Options.new.tap do |opts| - opts.args << "--headless" - opts.args << "--disable-gpu" - opts.args << "--disable-site-isolation-trials" - opts.args << "--window-size=1280,900" - end - browser_options.add_preference(:download, prompt_for_download: false, default_directory: DownloadHelpers::PATH.to_s) - - browser_options.add_preference(:browser, set_download_behavior: {behavior: "allow"}) - Capybara::Selenium::Driver.new app, browser: :remote, url: "http://selenium_chrome:4444/wd/hub", - options: browser_options + capabilities: [Selenium::WebDriver::Remote::Capabilities.chrome( + "goog:chromeOptions" => { + "args" => %w[headless disable-gpu window-size=1280,900], + "prefs" => { + "download.prompt_for_download" => false, + "download.default_directory" => "/home/seluser/Downloads", + "browser.set_download_behavior" => { "behavior" => "allow" } + } + } + )] end # used without docker @@ -52,7 +51,7 @@ config.include DownloadHelpers clear_downloads if ENV["DOCKER"] - driven_by :selenium_chrome_in_container + driven_by :selenium_chrome_headless_in_container Capybara.server_host = "0.0.0.0" Capybara.server_port = 4000 Capybara.app_host = "http://web:4000"