Module: Appom::ElementValidation
- Defined in:
- lib/appom/element_validation.rb
Overview
Element validation module for Appom automation framework Provides validation for element definitions and arguments
Constant Summary collapse
- BOOLEAN_VALUES =
Boolean values for validation
[true, false].freeze
- VALID_LOCATOR_STRATEGIES =
Valid Appium locator strategies
[ :accessibility_id, :android_uiautomator, :android_viewtag, :android_data_matcher, :android_view_matcher, :ios_predicate, :ios_uiautomation, :ios_class_chain, :class_name, :class, # Alias for class_name :css, :id, :name, :link_text, :partial_link_text, :tag_name, :xpath, ].freeze
Class Method Summary collapse
-
.validate_element_args(name, *find_args) ⇒ Object
Validate element definition arguments.
-
.validate_section_args(name, *args) ⇒ Object
Validate section definition arguments.
Class Method Details
.validate_element_args(name, *find_args) ⇒ Object
Validate element definition arguments
32 33 34 35 |
# File 'lib/appom/element_validation.rb', line 32 def validate_element_args(name, *find_args) validate_element_name(name) validate_find_arguments(find_args) end |
.validate_section_args(name, *args) ⇒ Object
Validate section definition arguments
38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/appom/element_validation.rb', line 38 def validate_section_args(name, *args) validate_element_name(name) # Extract section class and find args find_args = args.dup if find_args.first.is_a?(Class) section_class = find_args.shift validate_section_class(section_class) end validate_find_arguments(find_args) unless find_args.empty? end |