Skip to content

Commit c4d03d5

Browse files
author
Steve Laing
committed
Increase default Selenium driver timeout
It's common for the first net http request to fail, supposedly due to the length of time asset compilation can take. Increase the default timeout to 90 seconds.
1 parent 7cae3e6 commit c4d03d5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/test_helper.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,17 @@
1515
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
1616
chromeOptions: { args: %w(headless disable-gpu no-sandbox) }
1717
)
18+
client = Selenium::WebDriver::Remote::Http::Default.new
19+
client.timeout = 90 # Asset compilation can result in a timeout on the first request hence the increase.
1820

1921
Capybara::Selenium::Driver.new(
2022
app,
2123
browser: :chrome,
22-
desired_capabilities: capabilities
24+
desired_capabilities: capabilities,
25+
http_client: client
2326
)
2427
end
28+
2529
Capybara.default_driver = :headless_chrome
2630
Capybara.javascript_driver = :headless_chrome
2731

0 commit comments

Comments
 (0)