Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for running system specs on Ubuntu #5488

Open
gravitystorm opened this issue Jan 9, 2025 · 0 comments
Open

Add documentation for running system specs on Ubuntu #5488

gravitystorm opened this issue Jan 9, 2025 · 0 comments
Labels
dx Developer Experience

Comments

@gravitystorm
Copy link
Collaborator

Our system specs (and our teaspoon specs) don't work on Ubuntu, due to incompatibilities with firefox snap. We should document that they don't work, or we should document how to make them work, or (ideally) figure out if there's a way to get them to work automatically.

The root of the problem is that on Ubuntu, firefox is distributed as a snap package, and so the path returned by which firefox is not actually a firefox binary, it's just a bit of snap-related code.

My personal not-quite-working-workarounds are, in test/application_system_test_case.rb:

 class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
   driven_by :selenium, :using => :headless_firefox do |options|
     options.add_preference("intl.accept_languages", "en")
+    options.binary = "/snap/firefox/current/usr/lib/firefox/firefox"
   end

I've still found problems with some javascript stuff that I haven't yet resolved.

For /test/teaspoon_env.rb:

   config.driver_options = {
     :client_driver => :firefox,
     :selenium_options => {
-      :options => Selenium::WebDriver::Firefox::Options.new(:args => ["-headless"])
+      :options => Selenium::WebDriver::Firefox::Options.new(:args => ["-headless"], :binary => "/snap/firefox/current/usr/lib/firefox/firefox")
     }
   }

I'm not sure whether documenting that they don't work is easier than documenting the workarounds!

@gravitystorm gravitystorm added the dx Developer Experience label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dx Developer Experience
Projects
None yet
Development

No branches or pull requests

1 participant