Tightened up some of the test cases.
This commit is contained in:
@@ -123,11 +123,7 @@ RSpec.describe 'AutoRunEngine Test', :run_on_browserstack => true do
|
||||
|
||||
it 'AutoRunEngine is working' do
|
||||
begin
|
||||
if @hooks['hooked-browsers']['online'].empty?
|
||||
expect(BeEF::Filters.is_valid_hook_session_id?(@driver.execute_script("return window.beef.session.get_hook_session_id()"))).to eq true
|
||||
else
|
||||
expect(@hooks['hooked-browsers']['online']).not_to be_empty
|
||||
end
|
||||
expect(@hooks['hooked-browsers']['online']).not_to be_empty
|
||||
rescue => exception
|
||||
print_info "Exception: #{exception}"
|
||||
print_info "Exception Class: #{exception.class}"
|
||||
@@ -136,7 +132,7 @@ RSpec.describe 'AutoRunEngine Test', :run_on_browserstack => true do
|
||||
exception.class == NoMethodError
|
||||
exit 1
|
||||
else
|
||||
exit 0
|
||||
expect(BeEF::Filters.is_valid_hook_session_id?(@driver.execute_script("return window.beef.session.get_hook_session_id()"))).to eq true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -100,7 +100,7 @@ RSpec.describe 'Browser Details Handler', :run_on_browserstack => true do
|
||||
@hook_request = RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}"
|
||||
@hooks = JSON.parse(@hook_request)
|
||||
@session = @hooks['hooked-browsers']['online'][0]['session']
|
||||
|
||||
|
||||
rescue => exception
|
||||
print_info "Exception: #{exception}"
|
||||
print_info "Exception Class: #{exception.class}"
|
||||
@@ -120,11 +120,7 @@ RSpec.describe 'Browser Details Handler', :run_on_browserstack => true do
|
||||
|
||||
it 'can successfully hook a browser' do
|
||||
begin
|
||||
if @hooks['hooked-browsers']['online'].empty?
|
||||
expect(BeEF::Filters.is_valid_hook_session_id?(@driver.execute_script("return window.beef.session.get_hook_session_id()"))).to eq true
|
||||
else
|
||||
expect(@hooks['hooked-browsers']['online']).not_to be_empty
|
||||
end
|
||||
expect(@hooks['hooked-browsers']['online']).not_to be_empty
|
||||
rescue => exception
|
||||
print_info "Exception: #{exception}"
|
||||
print_info "Exception Class: #{exception.class}"
|
||||
@@ -133,7 +129,7 @@ RSpec.describe 'Browser Details Handler', :run_on_browserstack => true do
|
||||
exception.class == NoMethodError
|
||||
exit 1
|
||||
else
|
||||
exit 0
|
||||
expect(BeEF::Filters.is_valid_hook_session_id?(@driver.execute_script("return window.beef.session.get_hook_session_id()"))).to eq true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -120,11 +120,7 @@ RSpec.describe 'Browser hooking with Websockets', :run_on_browserstack => true d
|
||||
|
||||
it 'can successfully hook a browser' do
|
||||
begin
|
||||
if @hooks['hooked-browsers']['online'].empty?
|
||||
expect(BeEF::Filters.is_valid_hook_session_id?(@driver.execute_script("return window.beef.session.get_hook_session_id()"))).to eq true
|
||||
else
|
||||
expect(@hooks['hooked-browsers']['online']).not_to be_empty
|
||||
end
|
||||
expect(@hooks['hooked-browsers']['online']).not_to be_empty
|
||||
rescue => exception
|
||||
print_info "Exception: #{exception}"
|
||||
print_info "Exception Class: #{exception.class}"
|
||||
@@ -133,7 +129,7 @@ RSpec.describe 'Browser hooking with Websockets', :run_on_browserstack => true d
|
||||
exception.class == NoMethodError
|
||||
exit 1
|
||||
else
|
||||
exit 0
|
||||
expect(BeEF::Filters.is_valid_hook_session_id?(@driver.execute_script("return window.beef.session.get_hook_session_id()"))).to eq true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -278,7 +278,7 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
|
||||
exception.class == NoMethodError
|
||||
exit 1
|
||||
else
|
||||
exit 0
|
||||
true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user