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"
|
require "test_helper"
|
||||||
|
|
||||||
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
|
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
|
||||||
options = {
|
url = ENV.fetch("SELENIUM_REMOTE_URL", nil)
|
||||||
browser: ENV["SELENIUM_REMOTE_URL"].blank? ? :chrome : :remote,
|
options = if url
|
||||||
url: ENV["SELENIUM_REMOTE_URL"].blank? ? nil : ENV["SELENIUM_REMOTE_URL"]
|
{ browser: :remote, url }
|
||||||
}
|
else
|
||||||
|
{ browser: :chrome }
|
||||||
|
end
|
||||||
driven_by :selenium, using: :headless_chrome, options: options
|
driven_by :selenium, using: :headless_chrome, options: options
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user