Class: Appom::Section

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Methods included from Helpers

included, performance_module

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

#parentObject (readonly)

Returns the value of attribute parent.



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

def parent
  @parent
end

#root_elementObject (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

#pageObject



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

def page
  return root_element if root_element

  parent
end

#parent_pageObject



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