Module: Appom::ElementContainer

Includes:
Logging
Included in:
Page, Section
Defined in:
lib/appom/element_container.rb

Overview

Element container module for Appom automation framework Provides DSL methods for defining page elements, sections, and element collections

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Logging

level, level=, #log_debug, #log_element_action, #log_error, #log_info, #log_wait_end, #log_wait_start, #log_warn, #logger

Class Method Details

.included(klass) ⇒ Object



8
9
10
# File 'lib/appom/element_container.rb', line 8

def self.included(klass)
  klass.extend ClassMethods
end

Instance Method Details

#merge_args(find_args, runtime_args = {}) ⇒ Object

Options re-combiner. This takes the original inputs and combines them such that there is only one hash passed as a final argument to Appium.



24
25
26
27
28
29
# File 'lib/appom/element_container.rb', line 24

def merge_args(find_args, runtime_args = {})
  find_args = find_args.dup.flatten
  runtime_args = runtime_args.dup

  [*find_args, *runtime_args]
end

#raise_if_block(obj, name, has_block, type) ⇒ Object

Raise if contain a block



13
14
15
16
17
# File 'lib/appom/element_container.rb', line 13

def raise_if_block(obj, name, has_block, type)
  return unless has_block

  raise Appom::UnsupportedBlockError.new(name, "#{obj.class}##{type}")
end