Skip to content

Commit

Permalink
Simplify the logic in the documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelfranca committed Aug 21, 2023
1 parent 461ee94 commit 7797681
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions guides/source/testing.md
Expand Up @@ -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
```
Expand Down

0 comments on commit 7797681

Please sign in to comment.