Class: RUTL::Interface::Null
Overview
Interface-level code for fake browser.
Constant Summary
Constants included from Utilities
Utilities::DEFAULT_TIMEOUT, Utilities::POLL_SLEEP_TIME
Instance Attribute Summary collapse
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize ⇒ Null
constructor
A new instance of Null.
- #wait_for_transition(destinations) ⇒ Object
Methods inherited from Base
#find_page, #find_state, #goto, #method_missing, #quit, #respond_to_missing?
Methods included from Utilities
#await, #class_info, #location, #page?
Constructor Details
#initialize ⇒ Null
Returns a new instance of Null.
9 10 11 12 13 14 15 |
# File 'lib/rutl/interface/null.rb', line 9 def initialize context = RUTL::Element::ElementContext.new(destinations: nil, interface: self, selectors: []) @driver = NullDriver.new(context) super end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class RUTL::Interface::Base
Instance Attribute Details
#current_page ⇒ Object
21 22 23 24 25 |
# File 'lib/rutl/interface/null.rb', line 21 def current_page # Default to @pages.first if not set? # A browser can always check its current URL but the null driver can't. @current_page ||= @pages.first end |
Instance Method Details
#wait_for_transition(destinations) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/rutl/interface/null.rb', line 27 def wait_for_transition(destinations) # TODO: Setting @current page didn't do it beacause that set # context.interface.current_page and we wanted this in the browser. @current_page = destinations.first.new(self) $browser.current_page = @current_page end |