Class: RUTL::Interface::Null

Inherits:
Base
  • Object
show all
Defined in:
lib/rutl/interface/null.rb

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

#camera, #driver, #pages

Instance Method Summary collapse

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

#initializeNull

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_pageObject



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