Skip to content

Commit

Permalink
Updated Chrome settings
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
danschmidt5189 committed Apr 16, 2024
1 parent 1a4e03c commit 0cdfa13
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ services:
- 4444:4444
- 7900:7900
platform: linux/amd64
shm_size: 3g
networks:
default:
aliases:
Expand Down
6 changes: 4 additions & 2 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down

0 comments on commit 0cdfa13

Please sign in to comment.