Class: TestSteps::Handlers::PingTest

Inherits:
Base
  • Object
show all
Defined in:
lib/functions/handlers/ping_test.rb

Instance Method Summary collapse

Methods inherited from Base

#login_button, #login_check, #login_process, #mem_word_check, #open_url_process, perform, #portal_mem_word, register

Instance Method Details

#perform(step_attributes) ⇒ Object

TODO: retry every ‘x’ until timeout reached.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/functions/handlers/ping_test.rb', line 9

def perform(step_attributes)
  url = step_attributes[:testvalue]

  check = Net::Ping::HTTP.new(url)

  check.ping?
  sleep 5
  if check.ping?
    MyLog.log.info("pinged: #{url}")
    return true
  else
    MyLog.log.warn("Failed to ping: #{url}")
    return false
  end
end