cfme.web_ui.toolbar module

A set of functions for dealing with the toolbar buttons

The main CFME toolbar is accessed by using the Root and Sub titles of the buttons.

Usage:

tb = web_ui.toolbar
tb.select('Configuration', 'Add a New Host')
cfme.web_ui.toolbar.exists(root, sub=None, and_is_not_greyed=False)[source]

Checks presence and usability of toolbar buttons.

By default it checks whether the button is available, not caring whether it is greyed or not. You can optionally enable check for greyedness.

Parameters:
  • root – Button name.
  • sub – Item name (optional)
  • and_is_not_greyed – Check if the button is available to click.
cfme.web_ui.toolbar.is_active(root)[source]

Checks if a button is currently depressed

Parameters:root – The root button’s name as a string.

Returns: True if the button is depressed, False if not.

cfme.web_ui.toolbar.is_greyed(root, sub=None)[source]

Checks if a button is greyed out.

Parameters:root – The root button’s name as a string.

Returns: True if the button is greyed, False if not.

cfme.web_ui.toolbar.old_select(root, sub=None, invokes_alert=False)[source]

Clicks on a button by calling the dhtmlx toolbar callEvent.

Parameters:
  • root – The root button’s name as a string.
  • sub – The sub button’s name as a string. (optional)
  • invokes_alert – If True, then the behaviour is little bit different. After the last click, no ajax wait and no move away is done to be able to operate the alert that appears after click afterwards. Defaults to False.

Returns: True if everything went smoothly Raises: cfme.exceptions.ToolbarOptionGreyedOrUnavailable

cfme.web_ui.toolbar.pf_select(root, sub=None, invokes_alert=False)[source]

Clicks on a button by calling the click event with the jquery trigger.

Parameters:
  • root – The root button’s name as a string.
  • sub – The sub button’s name as a string. (optional)
  • invokes_alert – If True, then the behaviour is little bit different. After the last click, no ajax wait and no move away is done to be able to operate the alert that appears after click afterwards. Defaults to False.

Returns: True if everything went smoothly Raises: cfme.exceptions.ToolbarOptionGreyedOrUnavailable

cfme.web_ui.toolbar.refresh()[source]

Refreshes page, attempts to use cfme refresh button otherwise falls back to browser refresh.

cfme.web_ui.toolbar.root_loc(root)[source]

Returns the locator of the root button

Parameters:root – The string name of the button.

Returns: A locator for the root button.

cfme.web_ui.toolbar.select(*args, **kwargs)[source]
cfme.web_ui.toolbar.select_n_move(el)[source]

Clicks an element and then moves the mouse away

This is required because if the button is active and we clicked it, the CSS class doesn’t change until the mouse is moved away.

Parameters:el – The element to click on.

Returns: None

cfme.web_ui.toolbar.sub_loc(sub)[source]

Returns the locator of the sub button

Parameters:sub – The string name of the button.

Returns: A locator for the sub button.

cfme.web_ui.toolbar.xpath_quote(x)[source]

Putting strings in xpath requires unescape also