From bbcdb6f0869d795cbde18c7f6610d6da69688aeb Mon Sep 17 00:00:00 2001 From: Dominik Peters Date: Mon, 27 Jan 2025 19:45:28 +0100 Subject: [PATCH] Add chromium-driver to Dockerfile In the documentation about using docker, it says: > System tests also work out of the box, although they might fail the > first time while the tool running the tests downloads the right > version of Chromedriver (which is needed to run them), and only > "headless" mode (with a browser running in the background) is > supported, which is the mode you'd probably use more than 95% of the > time anyway. For example, to run the tests for the homepage: > > POSTGRES_PASSWORD=password docker-compose run app bundle exec \ > rspec spec/system/welcome_spec.rb For me, as predicted, the tests fail the first time, but they continue to fail after. The errors are of form: ``` Failure/Error: example.run Selenium::WebDriver::Error::WebDriverError: unable to connect to /home/consul/.cache/selenium/chromedriver/linux64 /132.0.6834.110/chromedriver 127.0.0.1:9515 # /usr/local/bundle/gems/selenium-webdriver-4.25.0/lib/selenium # /webdriver/common/service_manager.rb:132:in `connect_until_stable' # ... omitted ... # ./spec/spec_helper.rb:41:in `block (3 levels) in ' # /usr/local/bundle/gems/i18n-1.14.6/lib/i18n.rb:353:in `with_locale' # ./spec/spec_helper.rb:40:in `block (2 levels) in ' ``` Installing chromium-driver in the Dockerfile fixed it for me. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index da0292ffe..0ed3d90f2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ RUN apt-get update -qq \ unzip # Install Chromium for E2E integration tests -RUN apt-get update -qq && apt-get install -y chromium +RUN apt-get update -qq && apt-get install -y chromium chromium-driver # Files created inside the container repect the ownership RUN adduser --shell /bin/bash --disabled-password --gecos "" consul \