Module: AutomationObject::BluePrint::Composite::ElementHelper
- Included in:
- Element, ElementArray, ElementHash
- Defined in:
- lib/automation_object/blue_print/composite/helpers/element_helper.rb
Overview
Helper module for Element composite classes
Instance Method Summary collapse
-
#changes ⇒ Array<Symbol>
Get possible changes.
-
#default_input ⇒ String?
Text input for automatic screen/modal change if needed.
-
#in_iframe ⇒ Symbol?
Element name of iframe element is in or nil if not.
-
#in_iframe? ⇒ Boolean
Whether or not element is in iframe.
- #method_hook?(name) ⇒ Boolean
-
#method_hooks ⇒ Hash<AutomationObject::BluePrint::Composite::Hook>
Hash of Hook that are defined under the element.
-
#method_to_container(name) ⇒ Symbol
Method name.
-
#selector_params ⇒ Array<Symbol, String>?
Params as an array for driver find_element args.
Instance Method Details
#changes ⇒ Array<Symbol>
Get possible changes
39 40 41 42 43 44 45 46 |
# File 'lib/automation_object/blue_print/composite/helpers/element_helper.rb', line 39 def changes changes = [] method_hooks.each_value do |hook| changes += hook.changes end changes.uniq.compact end |
#default_input ⇒ String?
Returns text input for automatic screen/modal change if needed
9 10 11 |
# File 'lib/automation_object/blue_print/composite/helpers/element_helper.rb', line 9 def default_input adapter.default_input end |
#in_iframe ⇒ Symbol?
Returns element name of iframe element is in or nil if not
19 20 21 |
# File 'lib/automation_object/blue_print/composite/helpers/element_helper.rb', line 19 def in_iframe adapter.in_iframe end |
#in_iframe? ⇒ Boolean
Returns whether or not element is in iframe
24 25 26 |
# File 'lib/automation_object/blue_print/composite/helpers/element_helper.rb', line 24 def in_iframe? adapter.in_iframe? end |
#method_hook?(name) ⇒ Boolean
28 29 30 |
# File 'lib/automation_object/blue_print/composite/helpers/element_helper.rb', line 28 def method_hook?(name) adapter.method_hook?(name) end |
#method_hooks ⇒ Hash<AutomationObject::BluePrint::Composite::Hook>
Returns hash of Hook that are defined under the element
33 34 35 |
# File 'lib/automation_object/blue_print/composite/helpers/element_helper.rb', line 33 def method_hooks adapter.method_hooks end |
#method_to_container(name) ⇒ Symbol
Returns method name
50 51 52 53 54 55 56 57 58 |
# File 'lib/automation_object/blue_print/composite/helpers/element_helper.rb', line 50 def method_to_container(name) method_hooks.each do |method_name, hook| next unless hook.changes.include?(name) return method_name end nil end |
#selector_params ⇒ Array<Symbol, String>?
Returns params as an array for driver find_element args
14 15 16 |
# File 'lib/automation_object/blue_print/composite/helpers/element_helper.rb', line 14 def selector_params adapter.selector_params end |