[openstreetmap/openstreetmap-website] WIP: Reduce use of Selenium in favour of rack-test (PR #6497)

Pablo Brasero notifications at github.com
Fri Jan 30 11:07:59 UTC 2026


pablobm left a comment (openstreetmap/openstreetmap-website#6497)

I had another pass at this, converting a few tests for comparison. At the moment I'm seeing the combination of Selenium+rack-test running in ~2/3 of the time it takes to run with Selenium only. For example: in my machine I ran a handful of converted tests (see `tests.yml` here) 10 times. The Selenium+rack-test strategy ran in ~11min, compared to ~16min for running them with Selenium only.

The DX story is not great at the moment. For each test class, the individual tests need to be grouped as follows:

```ruby
class AccountDeletionTest < ApplicationSystemTestCase
  class JsTest < AccountDeletionTest
    driven_by_selenium
    
    test "this requires selenium" do
      # ...
    end
  end

  # These need to go into its own subclass. Otherwise
  # JsTest above will also run the "html tests",
  # because as a subclass it will contain them
  # in addition to its own "js tests".
  class HtmlTest < AccountDeletionTest
    # `driven_by :rack_test` is already default
    
    test "this will work with just rack-test" do
      # ...
    end
  end
  
  # And in addition this will run three times: two
  # with rack-test and one with Selenium, because
  # minitest detects the superclass and both subclasses
  # as containining it.
  test "some test" do
    # ...
  end
end
```

Not a huge deal, we could come up with something more ergonomic. For example we could have `test "a rack-test test"` and `js_test "a selenium test"` or something like that. But before spending more time here, I want to check that this is looking compelling enough to the maintainers.

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

Message ID: <openstreetmap/openstreetmap-website/pull/6497/c3823147896 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260130/9f79f43a/attachment.htm>


More information about the rails-dev mailing list