Merge pull request #13409 from filipefurtad0/sets_docker_no_sandbox_option_chrome

[Cuprite setup] Adds a DOCKER variable, to disable sandbox mode for system tests
This commit is contained in:
Maikel
2025-07-24 13:12:15 +10:00
committed by GitHub
2 changed files with 3 additions and 1 deletions

View File

@@ -5,6 +5,8 @@ Docker is intended to provide a common virtual environment available to all deve
## Limitations
1. The docker environment can't directly control your host system browser, which means that browser specs (under `/spec/system/`) and email previews will not work. You may be able to find a solution with [this article](https://evilmartians.com/chronicles/system-of-a-test-setting-up-end-to-end-rails-testing). If so, please contribute!
2. You can try circumventing this by setting the option `DOCKER=true` on the `.env.test.local` file, which will disable the `sandbox` mode for Chrome, used for system tests.
## Installing Docker
### Requirements
* You should have at least 2 GB free on your local machine to download Docker images and create Docker containers for this app.

View File

@@ -5,7 +5,7 @@ require "capybara/cuprite"
headless = ActiveModel::Type::Boolean.new.cast(ENV.fetch("HEADLESS", true))
browser_options = {}
browser_options["no-sandbox"] = nil if ENV['CI']
browser_options["no-sandbox"] = nil if ENV['CI'] || ENV['DOCKER']
Capybara.register_driver(:cuprite_ofn) do |app|
Capybara::Cuprite::Driver.new(