Skip to content

Commit 6111bf4

Browse files
committed
Add more chrome flags
Found in ref: teamcapybara/capybara#2796
1 parent 204c40b commit 6111bf4

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

lib/solidus_dev_support/rspec/capybara.rb

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,20 @@
2121
opts.add_argument("--no-sandbox")
2222
opts.add_argument("--window-size=#{CAPYBARA_WINDOW_SIZE}")
2323
opts.add_argument("--disable-search-engine-choice-screen")
24-
opts.add_argument("--disable-backgrounding-occluded-windows")
24+
25+
# From https://github.com/teamcapybara/capybara/issues/2796
26+
# Chrome flags found from:
27+
# - https://peter.sh/experiments/chromium-command-line-switches/
28+
# - https://github.com/GoogleChrome/chrome-launcher/blob/main/docs/chrome-flags-for-tools.md
29+
#
30+
# Disable timers being throttled in background pages/tabs. Useful for parallel test runs.
31+
opts.add_argument("disable-background-timer-throttling")
32+
# Normally, Chrome will treat a "foreground" tab instead as backgrounded if the surrounding window is occluded (aka
33+
# visually covered) by another window. This flag disables that. Useful for parallel test runs.
34+
opts.add_argument("disable-backgrounding-occluded-windows")
35+
# This disables non-foreground tabs from getting a lower process priority. Useful for parallel test runs.
36+
opts.add_argument("disable-renderer-backgrounding")
37+
2538
opts.browser_version = CAPYBARA_JAVASCRIPT_DRIVER_VERSION
2639
end
2740
Capybara::Selenium::Driver.new(app, browser: :chrome, options: browser_options)

0 commit comments

Comments
 (0)