Sha256: 9523364999946c02866e16e0ceb449887130e937f9dd88939f82aae0d3651c16

Contents?: true

Size: 754 Bytes

Versions: 13

Compression:

Stored size: 754 Bytes

Contents

#require 'sourcify'

module Cello
  module PageObjects
    module LogHelper
      
      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
      
      def wait_element_helper(name)
        timeout = 1
        while !send("#{name}_exit_wait?") && time < timeout do
          sleep 0.1
          time += 0.1
        end
      end      

    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
cello-0.0.35 lib/cello/pageobjects/html_elements/logger.rb
cello-0.0.34 lib/cello/pageobjects/html_elements/logger.rb
cello-0.0.33 lib/cello/pageobjects/html_elements/logger.rb
cello-0.0.32 lib/cello/pageobjects/html_elements/logger.rb
cello-0.0.31 lib/cello/pageobjects/html_elements/logger.rb
cello-0.0.30 lib/cello/pageobjects/html_elements/logger.rb
cello-0.0.29 lib/cello/pageobjects/html_elements/logger.rb
cello-0.0.28 lib/cello/pageobjects/html_elements/logger.rb
cello-0.0.27 lib/cello/pageobjects/html_elements/logger.rb
cello-0.0.26 lib/cello/pageobjects/html_elements/logger.rb
cello-0.0.25 lib/cello/pageobjects/html_elements/logger.rb
cello-0.0.23 lib/cello/pageobjects/html_elements/logger.rb
cello-0.0.21 lib/cello/pageobjects/html_elements/logger.rb