Update browser_details_handler_spec.rb

This commit is contained in:
jcrew99
2020-04-29 15:45:38 +10:00
committed by GitHub
parent 944e4e1372
commit f4370bcf6f

View File

@@ -15,12 +15,14 @@ RSpec.describe 'Browser Details Handler', :run_on_browserstack => true do
@config.set('beef.credentials.user', "beef") @config.set('beef.credentials.user', "beef")
@config.set('beef.credentials.passwd', "beef") @config.set('beef.credentials.passwd', "beef")
@username = @config.get('beef.credentials.user') @username = @config.get('beef.credentials.user')
@password = @config.get('beef.credentials.passwd') @password = @config.get('beef.credentials.passwd')
# Load BeEF extensions and modules # Load BeEF extensions and modules
# Always load Extensions, as previous changes to the config from other tests may affect # Always load Extensions, as previous changes to the config from other tests may affect
# whether or not this test passes. # whether or not this test passes.
print_info "Loading in BeEF::Extensions" print_info "Loading in BeEF::Extensions"
BeEF::Extensions.load BeEF::Extensions.load
sleep 2 sleep 2
# Check if modules already loaded. No need to reload. # Check if modules already loaded. No need to reload.
@@ -83,7 +85,6 @@ RSpec.describe 'Browser Details Handler', :run_on_browserstack => true do
:url => "http://#{CONFIG['user']}:#{CONFIG['key']}@#{CONFIG['server']}/wd/hub", :url => "http://#{CONFIG['user']}:#{CONFIG['key']}@#{CONFIG['server']}/wd/hub",
:desired_capabilities => @caps) :desired_capabilities => @caps)
# Hook new victim # Hook new victim
print_info 'Hooking a new victim, waiting a few seconds...' print_info 'Hooking a new victim, waiting a few seconds...'
@driver.navigate.to "#{VICTIM_URL}" @driver.navigate.to "#{VICTIM_URL}"
@@ -108,7 +109,6 @@ RSpec.describe 'Browser Details Handler', :run_on_browserstack => true do
it 'browser details handler working' do it 'browser details handler working' do
print_info "Getting browser details" print_info "Getting browser details"
response = RestClient.get "#{RESTAPI_HOOKS}/#{@session}?token=#{@token}" response = RestClient.get "#{RESTAPI_HOOKS}/#{@session}?token=#{@token}"
details = JSON.parse(response.body) details = JSON.parse(response.body)
expect(@driver.browser.to_s.downcase).to eq(details['browser.name.friendly'].downcase).or eq('internet_explorer').or eq('msedge') expect(@driver.browser.to_s.downcase).to eq(details['browser.name.friendly'].downcase).or eq('internet_explorer').or eq('msedge')