File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828 image : selenium/standalone-chrome:latest
2929 ports :
3030 - 4444:4444
31+ options : >-
32+ --add-host=host.docker.internal:host-gateway
33+ --shm-size=2g
3134
3235 env :
3336 RAILS_ENV : test
Original file line number Diff line number Diff line change @@ -21,11 +21,12 @@ class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
2121
2222 setup do
2323 if ENV [ "GITHUB_ACTIONS" ] == "true"
24- # CI: Rails runs on the runner, so point Chrome at localhost
25- Capybara . server_host = "127.0.0.1"
26- Capybara . app_host = "http://127.0.0.1:#{ Capybara . server_port } "
24+ # CI: Rails runs on the runner, Chrome runs in a container.
25+ # Bind Rails to all interfaces, and have Chrome reach the runner via host gateway.
26+ Capybara . server_host = "0.0.0.0"
27+ Capybara . app_host = "http://host.docker.internal:#{ Capybara . server_port } "
2728 else
28- # Docker Compose: expose the server and use the service name on the docker network
29+ # Docker Compose: both services on the same docker network
2930 Capybara . server_host = "0.0.0.0"
3031 Capybara . app_host = "http://web:#{ Capybara . server_port } "
3132 end
You can’t perform that action at this time.
0 commit comments