Fixed BrowserStack timeout error handling.

This commit is contained in:
Jack Walker
2020-05-15 11:26:30 +10:00
parent 0c429a8d43
commit 45f6595bda
4 changed files with 4 additions and 4 deletions

View File

@@ -120,7 +120,7 @@ RSpec.describe 'AutoRunEngine Test', :run_on_browserstack => true do
begin
@driver.quit
rescue => exception
if exception.include?('Failed to open TCP connection')
if exception.class == NoMethodError && exception.message.include?('Failed to open TCP connection')
print_info "Encountered possible false negative timeout error checking exception."
expect(exception).to include('hub-cloud.browserstack.com:80')
else

View File

@@ -117,7 +117,7 @@ RSpec.describe 'Browser Details Handler', :run_on_browserstack => true do
begin
@driver.quit
rescue => exception
if exception.include?('Failed to open TCP connection')
if exception.class == NoMethodError && exception.message.include?('Failed to open TCP connection')
print_info "Encountered possible false negative timeout error checking exception."
expect(exception).to include('hub-cloud.browserstack.com:80')
else

View File

@@ -106,7 +106,7 @@ RSpec.describe 'Browser hooking with Websockets', :run_on_browserstack => true d
begin
@driver.quit
rescue => exception
if exception.include?('Failed to open TCP connection')
if exception.class == NoMethodError && exception.message.include?('Failed to open TCP connection')
print_info "Encountered possible false negative timeout error checking exception."
expect(exception).to include('hub-cloud.browserstack.com:80')
else

View File

@@ -124,7 +124,7 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
begin
@driver.quit
rescue => exception
if exception.include?('Failed to open TCP connection')
if exception.class == NoMethodError && exception.message.include?('Failed to open TCP connection')
print_info "Encountered possible false negative timeout error checking exception."
expect(exception).to include('hub-cloud.browserstack.com:80')
else