Module: Cello::PageObjects::LogHelper

Defined in:
lib/cello/pageobjects/html_elements/logger.rb

Instance Method Summary collapse

Instance Method Details

#logger(name, method, type, params = nil) ⇒ Object


7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/cello/pageobjects/html_elements/logger.rb', line 7

def logger(name, method, type, params=nil)
    ts = Time.now
   # wait_element_helper name
    left = yield
    params = "NONE" if params.nil?
    #binding.pry
    puts  "
   Element: #{name}
      Type: #{type} 
      Method: #{method} 
      Left #{left}
      Params: #{params}
      Code: #{yield} 
      => #{(Time.now - ts).round 4} seconds"
   left
end

#wait_element_helper(name) ⇒ Object


24
25
26
27
28
29
30
# File 'lib/cello/pageobjects/html_elements/logger.rb', line 24

def wait_element_helper(name)
  timeout = 1
  while !send("#{name}_exit_wait?") && time < timeout do
    sleep 0.1
    time += 0.1
  end
end