Reversed logic gate for incorrectly handled exception.

This commit is contained in:
Jack Walker
2020-05-15 13:09:09 +10:00
parent 0375acd7f8
commit a85f0d78d0
4 changed files with 5 additions and 4 deletions

View File

@@ -102,7 +102,7 @@ RSpec.describe 'AutoRunEngine Test', :run_on_browserstack => true do
begin
@hook_request = RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}"
@hooks = JSON.parse(@hook_request)
if @hooks['hooked-browsers']['online'].empty?
unless @hooks['hooked-browsers']['online'].empty?
@session = @hooks['hooked-browsers']['online']['0']['session']
else
print_info "Cannot find online session server-side"

View File

@@ -99,7 +99,7 @@ RSpec.describe 'Browser Details Handler', :run_on_browserstack => true do
begin
@hook_request = RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}"
@hooks = JSON.parse(@hook_request)
if @hooks['hooked-browsers']['online'].empty?
unless @hooks['hooked-browsers']['online'].empty?
@session = @hooks['hooked-browsers']['online']['0']['session']
else
print_info "Cannot find online session server-side."

View File

@@ -88,7 +88,7 @@ RSpec.describe 'Browser hooking with Websockets', :run_on_browserstack => true d
begin
@hook_request = RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}"
@hooks = JSON.parse(@hook_request)
if @hooks['hooked-browsers']['online'].empty?
unless @hooks['hooked-browsers']['online'].empty?
@session = @hooks['hooked-browsers']['online']['0']['session']
else
print_info "Cannot find online session server-side."

View File

@@ -98,7 +98,7 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
begin
@hook_request = RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}"
@hooks = JSON.parse(@hook_request)
if @hooks['hooked-browsers']['online'].empty?
unless @hooks['hooked-browsers']['online'].empty?
@session = @hooks['hooked-browsers']['online']['0']['session']
else
print_info "Cannot find online session server-side."
@@ -126,6 +126,7 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
rescue => exception
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
print_info "Error closing BrowserStack connection: #{exception}"
end