Added more descriptive exception CLI output for BrowserStack tests.
This commit is contained in:
@@ -104,8 +104,9 @@ RSpec.describe 'AutoRunEngine Test', :run_on_browserstack => true do
|
||||
@hooks = JSON.parse(@hook_request)
|
||||
if @hooks['hooked-browsers']['online'].empty?
|
||||
@session = @hooks['hooked-browsers']['online']['0']['session']
|
||||
els e
|
||||
print_info "Cannot find online session server-side continuing to grab Session ID from client"
|
||||
else
|
||||
print_info "Cannot find online session server-side"
|
||||
print_info "Continuing to grab Session ID from client"
|
||||
@session = @driver.execute_script("return window.beef.session.get_hook_session_id()")
|
||||
end
|
||||
rescue => exception
|
||||
@@ -135,9 +136,9 @@ RSpec.describe 'AutoRunEngine Test', :run_on_browserstack => true do
|
||||
expect(@hooks['hooked-browsers']['online']).not_to be_empty
|
||||
end
|
||||
rescue => exception
|
||||
if exception.include?('ETIMEDOUT')
|
||||
print_info "Encountered possible false negative timeout error checking exception."
|
||||
expect(exception).to include('Failed to open TCP connection to hub-cloud.browserstack.com:80')
|
||||
if exception.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')
|
||||
elsif exception.include?('401 Unauthorized')
|
||||
print_info "Encountered possible false negative un-auth exception due to a failed hook."
|
||||
expect(@hook_request.code).to eq (401)
|
||||
|
||||
@@ -102,7 +102,8 @@ RSpec.describe 'Browser Details Handler', :run_on_browserstack => true do
|
||||
if @hooks['hooked-browsers']['online'].empty?
|
||||
@session = @hooks['hooked-browsers']['online']['0']['session']
|
||||
else
|
||||
print_info "Cannot find online session server-side continuing to grab Session ID from client"
|
||||
print_info "Cannot find online session server-side."
|
||||
print_info "Continuing to grab Session ID from client."
|
||||
@session = @driver.execute_script("return window.beef.session.get_hook_session_id()")
|
||||
end
|
||||
rescue => exception
|
||||
@@ -132,9 +133,9 @@ RSpec.describe 'Browser Details Handler', :run_on_browserstack => true do
|
||||
expect(@hooks['hooked-browsers']['online']).not_to be_empty
|
||||
end
|
||||
rescue => exception
|
||||
if exception.include?('ETIMEDOUT')
|
||||
if exception.include?('Failed to open TCP connection')
|
||||
print_info "Encountered possible false negative timeout error checking exception."
|
||||
expect(exception).to include('Failed to open TCP connection to hub-cloud.browserstack.com:80')
|
||||
expect(exception).to include('hub-cloud.browserstack.com:80')
|
||||
elsif exception.include?('401 Unauthorized')
|
||||
print_info "Encountered possible false negative un-auth exception due to a failed hook."
|
||||
expect(@hook_request.code).to eq (401)
|
||||
|
||||
@@ -91,7 +91,8 @@ RSpec.describe 'Browser hooking with Websockets', :run_on_browserstack => true d
|
||||
if @hooks['hooked-browsers']['online'].empty?
|
||||
@session = @hooks['hooked-browsers']['online']['0']['session']
|
||||
else
|
||||
print_info "Cannot find online session server-side continuing to grab Session ID from client"
|
||||
print_info "Cannot find online session server-side."
|
||||
print_info "Continuing to grab Session ID from client"
|
||||
@session = @driver.execute_script("return window.beef.session.get_hook_session_id()")
|
||||
end
|
||||
rescue => exception
|
||||
@@ -131,15 +132,15 @@ RSpec.describe 'Browser hooking with Websockets', :run_on_browserstack => true d
|
||||
expect(@hooks['hooked-browsers']['online']).not_to be_empty
|
||||
end
|
||||
rescue => exception
|
||||
if exception.include?('ETIMEDOUT')
|
||||
print_info "Encountered possible false negative timeout error checking exception."
|
||||
expect(exception).to include('Failed to open TCP connection to hub-cloud.browserstack.com:80')
|
||||
if exception.include?('Failed to open TCP connection')
|
||||
print_info "Encountered possible false negative BrowserStack timeout error. Checking exception."
|
||||
expect(exception).to include('hub-cloud.browserstack.com:80')
|
||||
elsif exception.include?('401 Unauthorized')
|
||||
print_info "Encountered possible false negative un-auth exception due to a failed hook."
|
||||
expect(@hook_request.code).to eq (401)
|
||||
else
|
||||
print_info "Encountered Exception: #{exception}"
|
||||
print_info "Issue retrieving hooked browser information - checking instead that client session ID exists"
|
||||
print_info "Issue retrieving hooked browser information. Checking instead that client session ID exists"
|
||||
expect(@session).not_to be_empty
|
||||
end
|
||||
end
|
||||
|
||||
@@ -101,7 +101,8 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
|
||||
if @hooks['hooked-browsers']['online'].empty?
|
||||
@session = @hooks['hooked-browsers']['online']['0']['session']
|
||||
else
|
||||
print_info "Cannot find online session server-side continuing to grab Session ID from client"
|
||||
print_info "Cannot find online session server-side."
|
||||
print_info "Continuing to grab Session ID from client."
|
||||
@session = @driver.execute_script("return window.beef.session.get_hook_session_id()")
|
||||
end
|
||||
rescue => exception
|
||||
@@ -140,9 +141,9 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
|
||||
result_data = JSON.parse(response.body)
|
||||
expect(result_data['success']).to eq "true"
|
||||
rescue => exception
|
||||
if exception.include?('ETIMEDOUT')
|
||||
if exception.include?('Failed to open TCP connection')
|
||||
print_info "Encountered possible false negative timeout error checking exception."
|
||||
expect(exception).to include('Failed to open TCP connection to hub-cloud.browserstack.com:80')
|
||||
expect(exception).to include('hub-cloud.browserstack.com:80')
|
||||
elsif exception.include?('401 Unauthorized')
|
||||
print_info "Encountered possible false negative un-auth exception due to a failed hook."
|
||||
expect(@hook_request.code).to eq (401)
|
||||
@@ -163,9 +164,9 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
|
||||
result_data = JSON.parse(response.body)
|
||||
expect(result_data['success']).to eq "true"
|
||||
rescue => exception
|
||||
if exception.include?('ETIMEDOUT')
|
||||
if exception.include?('Failed to open TCP connection')
|
||||
print_info "Encountered possible false negative timeout error checking exception."
|
||||
expect(exception).to include('Failed to open TCP connection to hub-cloud.browserstack.com:80')
|
||||
expect(exception).to include('hub-cloud.browserstack.com:80')
|
||||
elsif exception.include?('401 Unauthorized')
|
||||
print_info "Encountered possible false negative un-auth exception due to a failed hook."
|
||||
expect(@hook_request.code).to eq (401)
|
||||
@@ -186,9 +187,9 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
|
||||
result_data = JSON.parse(response.body)
|
||||
expect(result_data['success']).to eq "true"
|
||||
rescue => exception
|
||||
if exception.include?('ETIMEDOUT')
|
||||
if exception.include?('Failed to open TCP connection')
|
||||
print_info "Encountered possible false negative timeout error checking exception."
|
||||
expect(exception).to include('Failed to open TCP connection to hub-cloud.browserstack.com:80')
|
||||
expect(exception).to include('hub-cloud.browserstack.com:80')
|
||||
elsif exception.include?('401 Unauthorized')
|
||||
print_info "Encountered possible false negative un-auth exception due to a failed hook."
|
||||
expect(@hook_request.code).to eq (401)
|
||||
@@ -210,9 +211,9 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
|
||||
result_data = JSON.parse(response.body)
|
||||
expect(result_data['success']).to eq "true"
|
||||
rescue => exception
|
||||
if exception.include?('ETIMEDOUT')
|
||||
if exception.include?('Failed to open TCP connection')
|
||||
print_info "Encountered possible false negative timeout error checking exception."
|
||||
expect(exception).to include('Failed to open TCP connection to hub-cloud.browserstack.com:80')
|
||||
expect(exception).to include('hub-cloud.browserstack.com:80')
|
||||
elsif exception.include?('401 Unauthorized')
|
||||
print_info "Encountered possible false negative un-auth exception due to a failed hook."
|
||||
expect(@hook_request.code).to eq (401)
|
||||
@@ -234,9 +235,9 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
|
||||
result_data = JSON.parse(response.body)
|
||||
expect(result_data['success']).to eq "true"
|
||||
rescue => exception
|
||||
if exception.include?('ETIMEDOUT')
|
||||
if exception.include?('Failed to open TCP connection')
|
||||
print_info "Encountered possible false negative timeout error checking exception."
|
||||
expect(exception).to include('Failed to open TCP connection to hub-cloud.browserstack.com:80')
|
||||
expect(exception).to include('hub-cloud.browserstack.com:80')
|
||||
elsif exception.include?('401 Unauthorized')
|
||||
print_info "Encountered possible false negative un-auth exception due to a failed hook."
|
||||
expect(@hook_request.code).to eq (401)
|
||||
@@ -265,9 +266,9 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
|
||||
result_data = JSON.parse(response.body)
|
||||
expect(result_data['success']).to eq "true"
|
||||
rescue => exception
|
||||
if exception.include?('ETIMEDOUT')
|
||||
if exception.include?('Failed to open TCP connection')
|
||||
print_info "Encountered possible false negative timeout error checking exception."
|
||||
expect(exception).to include('Failed to open TCP connection to hub-cloud.browserstack.com:80')
|
||||
expect(exception).to include('hub-cloud.browserstack.com:80')
|
||||
elsif exception.include?('401 Unauthorized')
|
||||
print_info "Encountered possible false negative un-auth exception due to a failed hook."
|
||||
expect(@hook_request.code).to eq (401)
|
||||
@@ -289,9 +290,9 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
|
||||
result_data = JSON.parse(response.body)
|
||||
expect(result_data['success']).to eq "true"
|
||||
rescue => exception
|
||||
if exception.include?('ETIMEDOUT')
|
||||
if exception.include?('Failed to open TCP connection')
|
||||
print_info "Encountered possible false negative timeout error checking exception."
|
||||
expect(exception).to include('Failed to open TCP connection to hub-cloud.browserstack.com:80')
|
||||
expect(exception).to include('hub-cloud.browserstack.com:80')
|
||||
elsif exception.include?('401 Unauthorized')
|
||||
print_info "Encountered possible false negative un-auth exception due to a failed hook."
|
||||
expect(@hook_request.code).to eq (401)
|
||||
|
||||
Reference in New Issue
Block a user