Class: Appom::Section

Inherits:
Object
  • Object
show all
Includes:
Appium, ElementContainer, ElementFinder
Defined in:
lib/appom/section.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ElementFinder

#_all, #_check_has_element, #_find, #wait_until, #wait_until_get_not_empty

Methods included from ElementContainer

included, #merge_args, #raise_if_block

Constructor Details

#initialize(parent, root_element) ⇒ Section

Returns a new instance of Section.



9
10
11
12
# File 'lib/appom/section.rb', line 9

def initialize(parent, root_element)
  @parent = parent
  @root_element = root_element
end

Instance Attribute Details

#parentObject (readonly)

Returns the value of attribute parent.



7
8
9
# File 'lib/appom/section.rb', line 7

def parent
  @parent
end

#root_elementObject (readonly)

Returns the value of attribute root_element.



7
8
9
# File 'lib/appom/section.rb', line 7

def root_element
  @root_element
end

Instance Method Details

#pageObject



14
15
16
# File 'lib/appom/section.rb', line 14

def page
  root_element || super
end

#parent_pageObject



18
19
20
21
22
23
24
# File 'lib/appom/section.rb', line 18

def parent_page
  candidate_page = parent
  until candidate_page.is_a?(Appom::Page)
    candidate_page = candidate_page.parent
  end
  candidate_page
end