Added additional logic to handle inconsistencies in test results

This commit is contained in:
Jack Walker
2020-04-30 09:50:13 +10:00
parent b397c2f5d5
commit 8ff669c9fc
3 changed files with 3 additions and 3 deletions

View File

@@ -98,7 +98,7 @@ RSpec.describe 'AutoRunEngine Test', :run_on_browserstack => true do
wait = Selenium::WebDriver::Wait.new(:timeout => 30) # seconds
sleep 1 until wait.until { @driver.execute_script("return window.beef.session.get_hook_session_id().length") > 0}
if RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}".code != 200
if RestClient.get("#{RESTAPI_HOOKS}?token=#{@token}").code != 200
@session = @driver.execute_script("return window.beef.session.get_hook_session_id()")
else
@hooks = JSON.parse(RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}")

View File

@@ -95,7 +95,7 @@ RSpec.describe 'Browser Details Handler', :run_on_browserstack => true do
wait = Selenium::WebDriver::Wait.new(:timeout => 30) # seconds
sleep 1 until wait.until { @driver.execute_script("return window.beef.session.get_hook_session_id().length") > 0}
if RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}".code != 200
if RestClient.get("#{RESTAPI_HOOKS}?token=#{@token}").code != 200
@session = @driver.execute_script("return window.beef.session.get_hook_session_id()")
else
@hooks = JSON.parse(RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}")

View File

@@ -94,7 +94,7 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
wait = Selenium::WebDriver::Wait.new(:timeout => 30) # seconds
sleep 1 until wait.until { @driver.execute_script("return window.beef.session.get_hook_session_id().length") > 0}
if RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}".code != 200
if RestClient.get("#{RESTAPI_HOOKS}?token=#{@token}").code != 200
@session = @driver.execute_script("return window.beef.session.get_hook_session_id()")
else
@hooks = JSON.parse(RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}")