cfme.web_ui.form_buttons module

This module unifies working with CRUD form buttons.

Whenever you use Add, Save, Cancel, Reset button, use this module. You can use it also for the other buttons with same shape like those CRUD ones.

class cfme.web_ui.form_buttons.FormButton(alt, dimmed_alt=None, force_click=False, partial_alt=False, ng_click=None, classes=None)[source]

Bases: cfme.utils.pretty.Pretty

This class represents the buttons usually located in forms or CRUD.

  • alt – The text from alt field of the image.
  • dimmed_alt – In case the alt param is different in the dimmed variant of the button.
  • force_click – Click always, even if it is dimmed. (Causes an error if not visible)
  • partial_alt – Whether the alt matching should be only partial (in).
  • ng_click – To match the angular buttons, you can use this to specify the contents of ng-click attributeh.
class Button[source]

Holds pieces of the XPath to be assembled.

DIMMED = "(contains(@class, 'dimmed') or contains(@class, 'disabled') or contains(@class, 'btn-disabled'))"
IS_DISPLAYED = "not(ancestor::*[contains(@style, 'display:none') or contains(@style, 'display: none')])"
NOT_DIMMED = "not(contains(@class, 'dimmed') or contains(@class, 'disabled') or contains(@class, 'btn-disabled'))"
ON_CURRENT_TAB = "not(ancestor::div[contains(@class, 'tab-pane') and not(contains(@class, 'active'))])"
TAG_TYPES = '//a | //button | //img | //input'
TYPE_CONDITION = "(contains(@class, 'button') or contains(@class, 'btn') or contains(@src, 'button'))"
FormButton.PRIMARY = 'btn-primary'
FormButton.__call__(*args, **kwargs)[source]

For maintaining backward compatibility


Whether the button is displayed, therefore clickable.

FormButton.pretty_attrs = ['_alt', '_dimmed_alt', '_force', '_partial', '_ng_click']