Class: EDSL::PageObject::Section

Inherits:
ElementContainer
  • Object
show all
Includes:
AJAX, Population
Defined in:
lib/edsl/page_object/section.rb

Overview

This class represents a section of the dom contained within a root element.

Using this base class is not a requirement, however code in some modules may assume that methods in this class are available when they’re dealing with sections

This allows your object to serve as a proxy for the element and mirror it’s API.

Instance Method Summary collapse

Methods included from AJAX

#wait_for_ajax

Methods included from Population

#fixture_fetch, fixture_fetcher, fixture_fetcher=, #populate, #populate_key, #populate_with

Constructor Details

#initialize(element, parent) ⇒ Section

Create a new section



15
16
17
# File 'lib/edsl/page_object/section.rb', line 15

def initialize(element, parent)
  super(element, parent)
end

Instance Method Details

#_find_browser_via(container) ⇒ Object

Raises:

  • (ScriptError)


23
24
25
26
27
# File 'lib/edsl/page_object/section.rb', line 23

def _find_browser_via(container)
  raise ScriptError, "Could not locate a browser in #{self.class}." if container.nil?
  return container.browser if container.respond_to?(:browser)
  _find_browser_via(container.parent_container)
end

#browserObject



19
20
21
# File 'lib/edsl/page_object/section.rb', line 19

def browser
  @browser ||= _find_browser_via(parent_container)
end