Skip to content

Commit

Permalink
Switch to using chrome for system tests
Browse files Browse the repository at this point in the history
Firefox in Ubuntu 22.04 is now only available as a snap and the
snap version does not currently include geckodriver so can't be
used with Selenium for testing.

Chrome in headless mode doesn't support using preferences to set
the language so we have to modify the environment instead.
  • Loading branch information
tomhughes committed Jul 27, 2022
1 parent a106bfe commit cd04337
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Expand Up @@ -9,7 +9,7 @@ RUN apt-get update \
curl \
default-jre-headless \
file \
firefox-geckodriver \
chromium-chromedriver \
libarchive-dev \
libffi-dev \
libgd-dev \
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Expand Up @@ -33,7 +33,7 @@ These can be installed on Ubuntu 20.04 or later with:
sudo apt-get update
sudo apt-get install ruby2.7 libruby2.7 ruby2.7-dev \
libvips-dev libxml2-dev libxslt1-dev nodejs \
apache2 apache2-dev build-essential git-core firefox-geckodriver \
apache2 apache2-dev build-essential git-core chromium-chromedriver \
postgresql postgresql-contrib libpq-dev libsasl2-dev \
libffi-dev libgd-dev libarchive-dev libbz2-dev yarnpkg
sudo gem2.7 install bundler
Expand Down
2 changes: 1 addition & 1 deletion script/vagrant/setup/provision.sh
Expand Up @@ -18,7 +18,7 @@ apt-get upgrade -y
# install packages as explained in INSTALL.md
apt-get install -y ruby2.7 libruby2.7 ruby2.7-dev \
libxml2-dev libxslt1-dev nodejs yarnpkg \
apache2 apache2-dev build-essential git-core firefox-geckodriver \
apache2 apache2-dev build-essential git-core chromium-chromedriver \
postgresql postgresql-contrib libpq-dev libvips-dev \
libsasl2-dev libffi-dev libgd-dev libarchive-dev libbz2-dev
gem2.7 install rake
Expand Down
6 changes: 3 additions & 3 deletions test/application_system_test_case.rb
Expand Up @@ -2,12 +2,12 @@

ENV.delete("http_proxy")

ENV["LANG"] = "en_US.UTF-8"

ActiveSupport.on_load(:action_dispatch_system_test_case) do
ActionDispatch::SystemTesting::Server.silence_puma = true
end

class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
driven_by :selenium, :using => :headless_firefox do |options|
options.add_preference("intl.accept_languages", "en")
end
driven_by :selenium, :using => :headless_chrome
end

0 comments on commit cd04337

Please sign in to comment.