cfme.web_ui.tabstrip module¶
The tab strip manipulation which appears in Configure / Configuration and possibly other pages.
Usage:
import cfme.web_ui.tabstrip as tabs
tabs.select_tab("Authentication")
print(is_tab_selected("Authentication"))
print(get_selected_tab())
-
class
cfme.web_ui.tabstrip.
TabStripForm
(fields=None, tab_fields=None, identifying_loc=None, order=None, fields_end=None)[source]¶ Bases:
cfme.web_ui.Form
A class for interacting with tabstrip-contained Form elements on pages.
This behaves exactly like a
Form
, but is able to deal with form elements being broken up into tabs, accessible via a tab strip.Parameters: - fields – A list of field name/locator tuples (same as Form implementation)
- tab_fields – A dict with tab names as keys, and each key’s value being a list of
field name/locator tuples. The ordering of fields within a tab is guaranteed
(as it is with the normal Form) but the ordering of tabs is not guaranteed by default.
If such ordering is needed, tab_fields can be a
collections.OrderedDict
. - identifying_loc – A locator which should be present if the form is visible.
- order – If specified, specifies order of the tabs. Can be lower number than number of tabs, remaining values will be complemented.
- fields_end – Same as fields, but these are appended at the end of generated fields instead.
Usage:
provisioning_form = web_ui.TabStripForm( tab_fields={ 'Request': [ ('email', Input("requester__owner_email")), ('first_name', Input("requester__owner_first_name")), ('last_name', Input("requester__owner_last_name")), ('notes', '//textarea[@id="requester__request_notes"]'), ], 'Catalog': [ ('instance_name', Input("service__vm_name")), ('instance_description', '//textarea[@id="service__vm_description"]'), ] } )
Each tab’s fields will be exposed by their name on the resulting instance just like fields on a Form. Don’t use duplicate field names in the
tab_fields
dict.Forms can then be filled in like so:
request_info = { 'email': 'your@email.com', 'first_name': 'First', 'last_name': 'Last', 'notes': 'Notes about this request', 'instance_name': 'An instance name', 'instance_description': 'This is my instance!', } web_ui.fill(provisioning_form, request_info)
-
cfme.web_ui.tabstrip.
get_all_tabs
()[source]¶ Return list of all tabs present.
Returns:
list
ofstr
Displayed names.
-
cfme.web_ui.tabstrip.
get_clickable_tab
(ident_string)[source]¶ Returns the relevant tab element that can be clicked on.
Parameters: ident_string – The text diplayed on the tab.
-
cfme.web_ui.tabstrip.
get_selected_tab
()[source]¶ Return currently selected tab.
Returns:
str
Displayed name
-
cfme.web_ui.tabstrip.
is_tab_element_selected
(element)[source]¶ Determine whether the passed element is selected.
This function takes the element, climbs to its parent and looks whether the aria-selected attribute contains true. If yes, element is selected.
Parameters: element – WebElement with the link (a) Returns:
bool