Class: TestViewHelper
- Inherits:
-
Object
- Object
- TestViewHelper
- Defined in:
- lib/webconsole/logger/test/lib/test_view_helper.rb
Instance Method Summary collapse
-
#initialize(window_id, view_id) ⇒ TestViewHelper
constructor
A new instance of TestViewHelper.
- #last_log_class ⇒ Object
- #last_log_message ⇒ Object
- #log_message_at_index(index) ⇒ Object
- #number_of_log_messages ⇒ Object
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_class ⇒ Object
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_message ⇒ Object
19 20 21 |
# File 'lib/webconsole/logger/test/lib/test_view_helper.rb', line 19 def @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 (index) @view.do_javascript_function('innerTextOfBodyChildAtIndex', [index]) end |
#number_of_log_messages ⇒ Object
15 16 17 |
# File 'lib/webconsole/logger/test/lib/test_view_helper.rb', line 15 def @view.do_javascript(TEST_MESSAGE_COUNT_JAVASCRIPT) end |