From 0cdfa1332c600d69d8b153ba72c8f6c7c67d4736 Mon Sep 17 00:00:00 2001 From: Daniel Schmidt Date: Tue, 16 Apr 2024 11:03:05 -0700 Subject: [PATCH] Updated Chrome settings - Adds `--headless` - Removes shared-memory related settings and disables shm After doing this, I'm able to run the feature tests. Before adding the headless option I still had trouble with frequent Selenium Chrome crashes, but not since. In any case, those are "resolved" by running `docker compose restart selenium` and re-running the tests. --- docker-compose.yml | 1 - spec/rails_helper.rb | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 9f89ee7..c899612 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -50,7 +50,6 @@ services: - 4444:4444 - 7900:7900 platform: linux/amd64 - shm_size: 3g networks: default: aliases: diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index bb5b8eb..9bcc999 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -16,13 +16,15 @@ Capybara.register_driver(:remote) do |app| chrome_args = %w[ - --window-size=2560,1344 + --disable-dev-shm-usage --disable-smooth-scrolling + --headless + --window-size=2560,1344 ] chrome_prefs = { 'download.prompt_for_download' => false, - 'download.default_directory' => '/tmp', + 'download.default_directory' => '/tmp' } chrome_options = ::Selenium::WebDriver::Chrome::Options.new(args: chrome_args, prefs: chrome_prefs).tap do |options|