diff --git a/spec/beef/core/main/autorun_engine/autorun_engine_spec.rb b/spec/beef/core/main/autorun_engine/autorun_engine_spec.rb index 4cdae24e9..af530515a 100644 --- a/spec/beef/core/main/autorun_engine/autorun_engine_spec.rb +++ b/spec/beef/core/main/autorun_engine/autorun_engine_spec.rb @@ -92,9 +92,13 @@ RSpec.describe 'AutoRunEngine Test', :run_on_browserstack => true do print_info 'Hooking a new victim, waiting a few seconds...' @driver.navigate.to "#{VICTIM_URL}" + sleep 20 + # Give time for browser hook to occur wait = Selenium::WebDriver::Wait.new(:timeout => 30) # seconds - sleep 15 until wait.until { @driver.execute_script("return window.beef.session.get_hook_session_id().length") > 0} + wait.until { @driver.execute_script("return window.beef.session.get_hook_session_id().length") > 0} + + sleep 20 @hooks = JSON.parse(RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}") if @hooks['hooked-browsers']['online'].empty? diff --git a/spec/beef/core/main/handlers/browser_details_handler_spec.rb b/spec/beef/core/main/handlers/browser_details_handler_spec.rb index e54fb1baf..24c366d02 100644 --- a/spec/beef/core/main/handlers/browser_details_handler_spec.rb +++ b/spec/beef/core/main/handlers/browser_details_handler_spec.rb @@ -89,9 +89,13 @@ RSpec.describe 'Browser Details Handler', :run_on_browserstack => true do print_info 'Hooking a new victim, waiting a few seconds...' @driver.navigate.to "#{VICTIM_URL}" + sleep 20 + # Give time for browser hook to occur wait = Selenium::WebDriver::Wait.new(:timeout => 30) # seconds - sleep 15 until wait.until { @driver.execute_script("return window.beef.session.get_hook_session_id().length") > 0} + wait.until { @driver.execute_script("return window.beef.session.get_hook_session_id().length") > 0} + + sleep 20 @hooks = JSON.parse(RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}") if @hooks['hooked-browsers']['online'].empty? diff --git a/spec/beef/modules/debug/test_beef_debugs_spec.rb b/spec/beef/modules/debug/test_beef_debugs_spec.rb index 6322fc70b..e2094284b 100644 --- a/spec/beef/modules/debug/test_beef_debugs_spec.rb +++ b/spec/beef/modules/debug/test_beef_debugs_spec.rb @@ -91,9 +91,13 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do print_info 'Hooking a new victim, waiting a few seconds...' @driver.navigate.to "#{VICTIM_URL}" + sleep 20 + # Give time for browser hook to occur wait = Selenium::WebDriver::Wait.new(:timeout => 30) # seconds - sleep 15 until wait.until { @driver.execute_script("return window.beef.session.get_hook_session_id().length") > 0} + wait.until { @driver.execute_script("return window.beef.session.get_hook_session_id().length") > 0} + + sleep 20 @hooks = JSON.parse(RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}") if @hooks['hooked-browsers']['online'].empty?