Class: Appom::Section
- Inherits:
-
Object
- Object
- Appom::Section
- Includes:
- Appium, ElementContainer, ElementFinder, Helpers
- Defined in:
- lib/appom/section.rb
Overview
Base section class for Appom automation framework Represents a section of a page with its own elements
Instance Attribute Summary collapse
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#root_element ⇒ Object
readonly
Returns the value of attribute root_element.
Instance Method Summary collapse
-
#initialize(parent, root_element) ⇒ Section
constructor
A new instance of Section.
- #page ⇒ Object
- #parent_page ⇒ Object
Methods included from Helpers
Methods included from ElementFinder
#_all, #_check_has_element, #_find, included, #wait_until, #wait_until_get_not_empty
Methods included from Logging
level, level=, #log_debug, #log_element_action, #log_error, #log_info, #log_wait_end, #log_wait_start, #log_warn, #logger
Methods included from ElementContainer
included, #merge_args, #raise_if_block
Constructor Details
#initialize(parent, root_element) ⇒ Section
15 16 17 18 |
# File 'lib/appom/section.rb', line 15 def initialize(parent, root_element) @parent = parent @root_element = root_element end |
Instance Attribute Details
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
13 14 15 |
# File 'lib/appom/section.rb', line 13 def parent @parent end |
#root_element ⇒ Object (readonly)
Returns the value of attribute root_element.
13 14 15 |
# File 'lib/appom/section.rb', line 13 def root_element @root_element end |
Instance Method Details
#page ⇒ Object
20 21 22 23 24 |
# File 'lib/appom/section.rb', line 20 def page return root_element if root_element parent end |
#parent_page ⇒ Object
26 27 28 29 30 |
# File 'lib/appom/section.rb', line 26 def parent_page candidate_page = parent candidate_page = candidate_page.parent until candidate_page.is_a?(Appom::Page) candidate_page end |