cfme.intelligence.reports.ui_elements module

This file contains element definitions of elements that are common in reports.

class cfme.intelligence.reports.ui_elements.ColumnHeaderFormatTable(table_locator, header_offset=0, body_offset=0)[source]

Bases: cfme.web_ui.Table

Used to fill the table with header names and value formatting.

The value expected for filling is a dict where keys are names of the columns (leftmost cells in the table) and values are dict , str or list. In case of dictionary, the header and format fields are required, they correspond to the table columns. If a string is specified, it is considered a header. If a list is specified, then first item in it is considered a header, second one a format (if present).

    header: Test1
    format: Boolean (T/F)
    header: Such busy
    format: Boolean (Yes/No)
asdf: fghj
- thisisheader
- thisisformat
class cfme.intelligence.reports.ui_elements.ColumnStyleTable(div_id)[source]

Bases: utils.pretty.Pretty

We cannot inherit Table because it does too much WebElement chaining. This avoids that with using xpath-only locating making it much more reliable.

This is the kind of table that is used in Styling tab. The fill value is expected to be a dict. Keys of the dictionary are names of the columns (leftmost table cell). The values of the dictionary are lists up to 3 fields long. First element of each of the lists is the Style to be selected in the same-named table column. Second one is the operation (=, IS NULL, ...) to happen. If the operation has some operand, it is the third (and last) element of the list. If any of the lists has operation set as Default, no other lists cannot follow after them.

     - Blue Text
     - "="
     - asdf
     - Yellow Background
     - IS NULL
     - Red Background
     - IS NOT NULL
Parameters:div_idid of div where the table is located in.
get_if_input(name, id=0)[source]

Return the input element with value selection.

  • name – Text written in leftmost column of the wanted row.
  • id – Sequential id in the sub-row, 0..2.

Returns: str with locator.

get_if_select(name, id=0)[source]

Return Select element with operator selection.

  • name – Text written in leftmost column of the wanted row.
  • id – Sequential id in the sub-row, 0..2.

Returns: cfme.web_ui.Select.

get_style_select(name, id=0)[source]

Return Select element with selected style.

  • name – Text written in leftmost column of the wanted row.
  • id – Sequential id in the sub-row, 0..2.

Returns: cfme.web_ui.Select.

pretty_attrs = ['_div_id']
class cfme.intelligence.reports.ui_elements.DashboardWidgetSelector(root_loc="//div[@id='form_widgets_div']")[source]

Bases: utils.pretty.Pretty

This object encapsulates the selector of widgets that will appear on a dashboard.

It cannot move them around, just add and remove them.

The filling of this element expects a list of strings (or just str itself). The strings are names of the widgets.

pretty_attrs = ['_root_loc']
class cfme.intelligence.reports.ui_elements.ExternalRSSFeed[source]

Bases: object

This element encapsulates selection of an external RSS source either from canned selection or custom one.

It expects a str filling object. If the string is not found in the dropdown, it is considered to be custom url, so it selects custom URL option in the dropdown and fills the text input with the URL. If the option is available in the dropdown, then it is selected.

form = <cfme.web_ui.Region title=None>
class cfme.intelligence.reports.ui_elements.FolderManager(root)[source]

Bases: utils.pretty.Pretty

Class used in Reports/Edit Reports menus.

classmethod bail_out()[source]

If something gets wrong, you can use this method to cancel editing of the items in the context manager.

Raises: FolderManager._BailOut exception


Returns all fields’ text values


Returns if the field is present.

Parameters:field – Field to check.
pretty_attrs = ['root']

Select field by text.

Parameters:field – Field text.

Return selected field’s text.

Returns: str if field is selected, else None


Return selected field’s element.

Returns: WebElement if field is selected, else None

class cfme.intelligence.reports.ui_elements.MenuShortcuts(select_name)[source]

Bases: utils.pretty.Pretty

This class operates the web ui object that handles adding new menus and shortcuts for widgets

The expected object for filling is one of dict, list or str. If dict, then the keys are menu item names and their values are their aliases. If you don’t want to specify an alias for such particular menu item, use None. str behaves same as single element list. If list, then it is the same as it would be with dict but you cannot specify aliases, just menu names.

Parameters:select_name – Name of the select
add(menu, alias=None)[source]

Add a new shortcut.

  • menu – What menu item to select.
  • alias – Optional alias for this menu item.

Clear the selection.


Determine mapping Menu item => menu item id.

Needed because the boxes with shortcuts are accessible only via ids. Need to close boxes because boxes displayed are not in the Select.

This attribute is lazily evaluated and cached.


Return ids of all opened boxes.

pretty_attrs = ['_select_name']
set_text_of(id, text)[source]
class cfme.intelligence.reports.ui_elements.NewerDashboardWidgetSelector(root_loc="//div[@id='form_widgets_div']")[source]

Bases: cfme.intelligence.reports.ui_elements.DashboardWidgetSelector

Dashboard widget selector from 5.5 onwards.

exception cfme.intelligence.reports.ui_elements.NotDisplayedException[source]

Bases: exceptions.Exception

class cfme.intelligence.reports.ui_elements.PivotCalcSelect(root_el_id)[source]

Bases: utils.pretty.Pretty

This class encapsulates those JS pseudo-selects in Edit Report/Consolidation

classmethod all()[source]

For debugging purposes

classmethod close_all_boxes()[source]

No other solution as the boxes have no ID

pretty_attrs = ['_id']
class cfme.intelligence.reports.ui_elements.RecordGrouper(table_loc)[source]

Bases: utils.pretty.Pretty

This class encapsulates the grouping editing in Edit Report/Consolidation in the table at the bottom

Filling this element expects a dict. The key of the dictionary is the name of the column (leftmost table cell). The value of the dictionary is a list of values that will get selected in the dropdown (Minimum, Average, ...)

CPU - % Overallocated:
  - Maximum
  - Minimum
  - Average
pretty_attrs = ['_table_loc']
class cfme.intelligence.reports.ui_elements.Timer[source]

Bases: object

form = <cfme.web_ui.Form fields=[('run', Select("//select[@id='timer_typ']", multi=False)), ('hours', Select("//select[@id='timer_hours']", multi=False)), ('days', Select("//select[@id='timer_days']", multi=False)), ('weeks', Select("//select[@id='timer_weeks']", multi=False)), ('months', Select("//select[@id='timer_months']", multi=False)), ('time_zone', Select("//select[@id='time_zone']", multi=False)), ('start_date', <cfme.web_ui.Calendar >), ('start_hour', Select("//select[@id='start_hour']", multi=False)), ('start_min', Select("//select[@id='start_min']", multi=False))]>