[openstreetmap/openstreetmap-website] Use rack by default for system tests (PR #6878)

Andy Allan notifications at github.com
Wed Mar 18 11:41:20 UTC 2026


@gravitystorm commented on this pull request.



> +    end
+
+    driver_name
+  end
+
+  # Define a test that uses a full browser via Selenium, for use in test
+  # classes that default to rack_test but have individual tests needing
+  # JavaScript. Note: js_test blocks get a separate browser session, so
+  # you must call sign_in_as within the block if authentication is needed.
+  #
+  # Pass driver_opts to customize the Selenium driver, e.g. to set
+  # browser language preferences:
+  #   js_test "name", :driver => "de", :preferences => { "intl.accept_languages" => "de" }
+  def self.js_test(name, driver_opts = {}, &block)
+    config_name = driver_opts.delete(:driver) || "default"
+    driver = register_selenium_driver(config_name, driver_opts)

I would need to check what happens if we try re-registering a driver using the same name at

```ruby
Capybara.register_driver driver_name do |app|
```

I think there's a risk that capybara will re-use the existing firefox instance with language prefs etc cached. I can investigate.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6878#discussion_r2952811503
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/6878/review/3967124387 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260318/1ed86263/attachment-0001.htm>


More information about the rails-dev mailing list