Simplify the logic in the documentation.
This commit is contained in:
parent
461ee94a0f
commit
7797681cb2
@ -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
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user