Class: TestCentricity::MenuBar
- Inherits:
-
ScreenSection
- Object
- BaseScreenSectionObject
- ScreenSection
- TestCentricity::MenuBar
- Defined in:
- lib/testcentricity_apps/app_elements/menubar.rb
Instance Attribute Summary
Attributes inherited from ScreenSection
#context, #list_index, #locator, #name, #parent, #parent_list
Instance Method Summary collapse
-
#get_item_count ⇒ Integer
Return the number of menus in a MenuBar object.
-
#get_menubar_item(index) ⇒ String
(also: #get_list_item)
Return text caption of menu item at specified index.
-
#get_menubar_items ⇒ Array
(also: #get_list_items)
Return array of strings of all menus in a MenuBar object.
- #get_object_type ⇒ Object
-
#initialize(name, parent, locator, context) ⇒ MenuBar
constructor
A new instance of MenuBar.
Methods inherited from ScreenSection
button, buttons, checkbox, checkboxes, #click, define_section_element, #disabled?, #double_tap, element, elements, #enabled?, #exists?, #get_locator, #get_name, #height, #hidden?, #identifier, image, images, label, labels, list, lists, #long_press, menu, menus, radio, radios, #scroll_into_view, section, sections, selectlist, selectlists, #send_keys, #set_list_index, #set_parent, switch, switches, table, tables, #tap, textfield, textfields, #visible?, #wait_until_exists, #wait_until_gone, #wait_until_hidden, #wait_until_visible, #width, #x_loc, #y_loc
Methods inherited from BaseScreenSectionObject
#populate_data_fields, #swipe_gesture, trait, #verify_ui_states
Constructor Details
#initialize(name, parent, locator, context) ⇒ MenuBar
Returns a new instance of MenuBar.
9 10 11 12 13 14 15 |
# File 'lib/testcentricity_apps/app_elements/menubar.rb', line 9 def initialize(name, parent, locator, context) super @parent = nil # define the menu bar item element for the menu bar list object list_elements = { list_item: { xpath: '(//XCUIElementTypeMenuBarItem)' } } .define_list_elements(list_elements) end |
Instance Method Details
#get_item_count ⇒ Integer
Return the number of menus in a MenuBar object.
27 28 29 |
# File 'lib/testcentricity_apps/app_elements/menubar.rb', line 27 def get_item_count .get_item_count end |
#get_menubar_item(index) ⇒ String Also known as: get_list_item
Return text caption of menu item at specified index.
49 50 51 52 |
# File 'lib/testcentricity_apps/app_elements/menubar.rb', line 49 def (index) items = get_list_items items[index - 1] end |
#get_menubar_items ⇒ Array Also known as: get_list_items
Return array of strings of all menus in a MenuBar object.
37 38 39 |
# File 'lib/testcentricity_apps/app_elements/menubar.rb', line 37 def .get_list_items end |
#get_object_type ⇒ Object
17 18 19 |
# File 'lib/testcentricity_apps/app_elements/menubar.rb', line 17 def get_object_type :menubar end |