Sha256: 1f5ae8478b2dec565bf5090398f769e772eabb30e1407063e590d5c52b796d6b

Contents?: true

Size: 737 Bytes

Versions: 3

Compression:

Stored size: 737 Bytes

Contents

require_relative 'test_constants'

class TestViewHelper

    def initialize(window_id, view_id)
      @view = WebConsole::View.new(window_id, view_id)
      javascript = File.read(TEST_JAVASCRIPT_FILE)
      @view.do_javascript(javascript)
    end

    def log_message_at_index(index)
      return @view.do_javascript_function('innerTextOfBodyChildAtIndex', [index])
    end

    def number_of_log_messages
      # TODO: Do JavaScript should coerce types
      return @view.do_javascript(TEST_MESSAGE_COUNT_JAVASCRIPT).chomp.to_i
    end

    def last_log_message
      return @view.do_javascript(TEST_MESSAGE_JAVASCRIPT).chomp
    end
  
    def last_log_class
      return @view.do_javascript(TEST_CLASS_JAVASCRIPT).chomp
    end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
webconsole-0.1.16 lib/webconsole/logger/test/lib/test_view_helper.rb
webconsole-0.1.15 lib/webconsole/logger/test/lib/test_view_helper.rb
webconsole-0.1.14 lib/webconsole/logger/test/lib/test_view_helper.rb