Class: TestViewHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/webconsole/logger/test/lib/test_view_helper.rb

Instance Method Summary collapse

Constructor Details

#initialize(window_id, view_id) ⇒ TestViewHelper

Returns a new instance of TestViewHelper.



5
6
7
8
9
# File 'lib/webconsole/logger/test/lib/test_view_helper.rb', line 5

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

Instance Method Details

#last_log_classObject



23
24
25
# File 'lib/webconsole/logger/test/lib/test_view_helper.rb', line 23

def last_log_class
  @view.do_javascript(TEST_CLASS_JAVASCRIPT)
end

#last_log_messageObject



19
20
21
# File 'lib/webconsole/logger/test/lib/test_view_helper.rb', line 19

def last_log_message
  @view.do_javascript(TEST_MESSAGE_JAVASCRIPT)
end

#log_message_at_index(index) ⇒ Object



11
12
13
# File 'lib/webconsole/logger/test/lib/test_view_helper.rb', line 11

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

#number_of_log_messagesObject



15
16
17
# File 'lib/webconsole/logger/test/lib/test_view_helper.rb', line 15

def number_of_log_messages
  @view.do_javascript(TEST_MESSAGE_COUNT_JAVASCRIPT)
end