diff --git a/lib/capybara/spec/test_app.rb b/lib/capybara/spec/test_app.rb index b29a1523c..3b9a50a94 100644 --- a/lib/capybara/spec/test_app.rb +++ b/lib/capybara/spec/test_app.rb @@ -31,6 +31,10 @@ def initialize(string1, msg) 'Another World' end + get '/slow_resources' do + '' + end + get '/redirect' do redirect '/redirect_again' end diff --git a/spec/selenium_spec_chrome.rb b/spec/selenium_spec_chrome.rb index cde0d65dd..c42cd96c1 100644 --- a/spec/selenium_spec_chrome.rb +++ b/spec/selenium_spec_chrome.rb @@ -149,6 +149,12 @@ module TestSessions it 'sets the http client read timeout' do expect(TestSessions::Chrome.driver.browser.send(:bridge).http.read_timeout).to eq 30 end + + it 'does NOT block on slow resources' do + expect { + TestSessions::Chrome.visit('/slow_resources') + }.to raise_error(Net::ReadTimeout) + end end describe 'filling in Chrome-specific date and time fields with keystrokes' do diff --git a/spec/selenium_spec_firefox.rb b/spec/selenium_spec_firefox.rb index 4881b510e..784294556 100644 --- a/spec/selenium_spec_firefox.rb +++ b/spec/selenium_spec_firefox.rb @@ -206,6 +206,12 @@ module TestSessions it 'sets the http client read timeout' do expect(TestSessions::SeleniumFirefox.driver.browser.send(:bridge).http.read_timeout).to eq 31 end + + it 'does NOT block on slow resources' do + expect { + TestSessions::SeleniumFirefox.visit('/slow_resources') + }.to raise_error(Net::ReadTimeout) + end end end diff --git a/spec/selenium_spec_safari.rb b/spec/selenium_spec_safari.rb index ed83861f6..5808c5e6b 100644 --- a/spec/selenium_spec_safari.rb +++ b/spec/selenium_spec_safari.rb @@ -128,6 +128,12 @@ module TestSessions it 'sets the http client read timeout' do expect(TestSessions::Safari.driver.browser.send(:bridge).http.read_timeout).to eq 30 end + + it 'does NOT block on slow resources' do + expect { + TestSessions::Safari.visit('/slow_resources') + }.to raise_error(Net::ReadTimeout) + end end describe 'filling in Safari-specific date and time fields with keystrokes' do