Simplify the logic in the documentation.

This commit is contained in:
Rafael Mendonça França 2023-08-21 19:10:13 +00:00
parent 461ee94a0f
commit 7797681cb2
No known key found for this signature in database
GPG Key ID: FC23B6D0F1EEE948

@ -891,10 +891,12 @@ you have to add remote `url` and set `browser` as remote through `options`.
require "test_helper"
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
options = {
browser: ENV["SELENIUM_REMOTE_URL"].blank? ? :chrome : :remote,
url: ENV["SELENIUM_REMOTE_URL"].blank? ? nil : ENV["SELENIUM_REMOTE_URL"]
}
url = ENV.fetch("SELENIUM_REMOTE_URL", nil)
options = if url
{ browser: :remote, url }
else
{ browser: :chrome }
end
driven_by :selenium, using: :headless_chrome, options: options
end
```