Is your feature request related to a problem? Please describe.
When I run rails new and don't skip tests, system tests, or Docker, it creates a Docker container for Selenium and installs this in test/application_system_test_case.rb:
require "test_helper"
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
if ENV["CAPYBARA_SERVER_PORT"]
served_by host: "rails-app", port: ENV["CAPYBARA_SERVER_PORT"]
driven_by :selenium, using: :headless_chrome, screen_size: [ 1400, 1400 ], options: {
browser: :remote,
url: "http://#{ENV["SELENIUM_HOST"]}:4444"
}
else
driven_by :selenium, using: :headless_chrome, screen_size: [ 1400, 1400 ]
end
end
rails g rspec:install doesn't do anything to set Selenium up, and getting system tests working is a nightmare as a result.
Describe the solution you'd like
It should be possible to pass the container name to the install generator, using syntax along the lines of rails g rspec:install --selenium-container=selenium and the generator should then provide a basic setup similar to the one rails new does for minitest.
Describe alternatives you've considered
Right now I'm considering just using Playwright for system tests, because I know I can get that working.
Additional context
Is your feature request related to a problem? Please describe.
When I run
rails newand don't skip tests, system tests, or Docker, it creates a Docker container for Selenium and installs this intest/application_system_test_case.rb:rails g rspec:installdoesn't do anything to set Selenium up, and getting system tests working is a nightmare as a result.Describe the solution you'd like
It should be possible to pass the container name to the install generator, using syntax along the lines of
rails g rspec:install --selenium-container=seleniumand the generator should then provide a basic setup similar to the onerails newdoes for minitest.Describe alternatives you've considered
Right now I'm considering just using Playwright for system tests, because I know I can get that working.
Additional context