Class: TestCentricity::List
- Defined in:
- lib/testcentricity_web/elements/list.rb
Instance Attribute Summary collapse
-
#list_item ⇒ Object
Returns the value of attribute list_item.
Attributes inherited from UIElement
#alt_locator, #context, #locator, #parent, #type
Instance Method Summary collapse
-
#define_list_elements(element_spec) ⇒ Object
-
#get_list_items(element_spec = nil) ⇒ Object
-
#initialize(parent, locator, context) ⇒ List
constructor
A new instance of List.
Methods inherited from UIElement
#clear_alt_locator, #click, #click_at, #disabled?, #double_click, #drag_by, #enabled?, #exists?, #get_attribute, #get_locator, #get_native_attribute, #get_object_type, #get_siebel_object_type, #get_value, #hidden?, #hover, #invoke_siebel_dialog, #send_keys, #set, #set_alt_locator, #verify_value, #visible?, #wait_until_exists, #wait_until_gone, #wait_until_value_changes, #wait_until_value_is, #wait_until_visible
Constructor Details
#initialize(parent, locator, context) ⇒ List
Returns a new instance of List.
5 6 7 8 9 10 11 12 13 |
# File 'lib/testcentricity_web/elements/list.rb', line 5 def initialize(parent, locator, context) @parent = parent @locator = locator @context = context @type = :list @alt_locator = nil list_spec = { :list_item => 'li' } define_list_elements(list_spec) end |
Instance Attribute Details
#list_item ⇒ Object
Returns the value of attribute list_item.
3 4 5 |
# File 'lib/testcentricity_web/elements/list.rb', line 3 def list_item @list_item end |
Instance Method Details
#define_list_elements(element_spec) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/testcentricity_web/elements/list.rb', line 15 def define_list_elements(element_spec) element_spec.each do | element, value | case element when :list_item @list_item = value end end end |
#get_list_items(element_spec = nil) ⇒ Object
24 25 26 27 28 29 |
# File 'lib/testcentricity_web/elements/list.rb', line 24 def get_list_items(element_spec = nil) define_list_elements(element_spec) unless element_spec.nil? obj, _ = find_element object_not_found_exception(obj, nil) obj.all(@list_item).collect(&:text) end |