cfme.common package¶
Submodules¶
Module contents¶
-
class
cfme.common.
EditTagsFromDetails
(obj, navigate_obj)[source]¶ Bases:
cfme.utils.appliance.implementations.ui.CFMENavigateStep
-
VIEW
¶ alias of
TagPageView
-
prerequisite
¶ This is a helper descriptor for navigation destinations which are linked to the same class.
For instance, imagine you have an object that has a ‘ViewAll’, destination that needs to be visited before you can click on ‘New’. In this instance, you would need to make the ‘New’ destination use ‘ViewAll’ as a prerequisite. As this would need no other special input, we can use NavigateToSibling as a helper. This will set prerequisite to be a callable that will navigate to the prerequisite step.
-
-
class
cfme.common.
EditTagsFromListCollection
(obj, navigate_obj)[source]¶ Bases:
cfme.utils.appliance.implementations.ui.CFMENavigateStep
-
VIEW
¶ alias of
TagPageView
-
-
class
cfme.common.
ManagePolicies
(obj, navigate_obj)[source]¶ Bases:
cfme.utils.appliance.implementations.ui.CFMENavigateStep
-
VIEW
¶ alias of
ManagePoliciesView
-
prerequisite
¶ This is a helper descriptor for navigation destinations which are linked to the same class.
For instance, imagine you have an object that has a ‘ViewAll’, destination that needs to be visited before you can click on ‘New’. In this instance, you would need to make the ‘New’ destination use ‘ViewAll’ as a prerequisite. As this would need no other special input, we can use NavigateToSibling as a helper. This will set prerequisite to be a callable that will navigate to the prerequisite step.
-
-
class
cfme.common.
ManagePoliciesFromDetails
(obj, navigate_obj)[source]¶ Bases:
cfme.utils.appliance.implementations.ui.CFMENavigateStep
-
VIEW
¶ alias of
ManagePoliciesView
-
prerequisite
¶ This is a helper descriptor for navigation destinations which are linked to the same class.
For instance, imagine you have an object that has a ‘ViewAll’, destination that needs to be visited before you can click on ‘New’. In this instance, you would need to make the ‘New’ destination use ‘ViewAll’ as a prerequisite. As this would need no other special input, we can use NavigateToSibling as a helper. This will set prerequisite to be a callable that will navigate to the prerequisite step.
-
-
class
cfme.common.
ManagePoliciesView
(*args, **kwargs)[source]¶ Bases:
cfme.base.login.BaseLoggedInPage
Manage policies page
This class handles instantiating and caching of the widgets on view.
It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.
It also acts as a counter, so you can then order the widgets by their “creation” stamp.
-
cancel
¶ This class handles instantiating and caching of the widgets on view.
It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.
It also acts as a counter, so you can then order the widgets by their “creation” stamp.
-
entities
¶ This class handles instantiating and caching of the widgets on view.
It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.
It also acts as a counter, so you can then order the widgets by their “creation” stamp.
-
is_displayed
¶
-
policy_profiles
¶ This class handles instantiating and caching of the widgets on view.
It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.
It also acts as a counter, so you can then order the widgets by their “creation” stamp.
-
reset
¶ This class handles instantiating and caching of the widgets on view.
It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.
It also acts as a counter, so you can then order the widgets by their “creation” stamp.
-
save
¶ This class handles instantiating and caching of the widgets on view.
It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.
It also acts as a counter, so you can then order the widgets by their “creation” stamp.
-
class
cfme.common.
PolicyProfileAssignable
[source]¶ Bases:
object
This class can be inherited by anything that provider load_details method.
It provides functionality to assign and unassign Policy Profiles
-
assign_policy_profiles
(*policy_profile_names)[source]¶ Assign Policy Profiles to this object.
Parameters: policy_profile_names – str
with Policy Profile names. After Control/Explorer coverage goes in, PolicyProfile objects will be also passable.
-
assigned_policy_profiles
¶
-
-
class
cfme.common.
TagPageView
(*args, **kwargs)[source]¶ Bases:
cfme.base.login.BaseLoggedInPage
Class represents common tag page in CFME UI
-
form
¶ This class handles instantiating and caching of the widgets on view.
It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.
It also acts as a counter, so you can then order the widgets by their “creation” stamp.
-
is_displayed
¶
-
table_title
¶ This class handles instantiating and caching of the widgets on view.
It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.
It also acts as a counter, so you can then order the widgets by their “creation” stamp.
-
title
¶ This class handles instantiating and caching of the widgets on view.
It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.
It also acts as a counter, so you can then order the widgets by their “creation” stamp.
-
-
class
cfme.common.
TopologyMixin
[source]¶ Bases:
object
Use this mixin to have simple access to the Topology page. To use this TopologyMixin you have to implement load_topology_page function, which should take to topology page
Sample usage:
# You can retrieve the elements details as it is in the UI topology.elements # => 'hostname' # You can do actions on topology page topology.display_names.enable() topology.display_names.disable() topology.display_names.is_enabled # You can do actions on topology search box topology.search_box.text(text='hello') topology.search_box.text(text='hello', submit=False) topology.search_box.submit() topology.search_box.clear() # You can get legends and can perform actions topology.legends topology.pod.name topology.pod.is_active topology.pod.set_active() # You can get elements, element parents and children topology.elements topology.elements[0].parents topology.elements[0].children topology.elements[0].double_click() topology.elements[0].is_displayed()
-
class
cfme.common.
UtilizationMixin
[source]¶ Bases:
object
Use this mixin to have simple access to the Utilization information of an object.
Requires that the class(page) has
load_details(refresh)
method andtaggable_type
should be defined.All the chart names from the UI are “attributized”.
Sample usage: .. code-block:: python
# You can list available charts page.utilization.charts # => ‘[ ‘jvm_heap_usage_bytes’,’web_sessions’,’transactions’]’ # You can get the data from chart page.utilization.jvm_heap_usage_bytes.list_data_chart() # => returns data as list # You can get the data from table provider.utilization.jvm_heap_usage_bytes.list_data_table() # => returns data as list # You can get the data from wrapanapi page.utilization.jvm_heap_usage_bytes.list_data_mgmt() # => returns data as list # You can change chart option page.utilization.jvm_non_heap_usage_bytes.option.set_by_visible_text(op_interval=’Daily’) # You can list available ledgends page.utilization.jvm_non_heap_usage_bytes.legends # You can enable/disable legends page.utilization.jvm_non_heap_usage_bytes.committed.set_active(active=False) # => Disables page.utilization.jvm_non_heap_usage_bytes.committed.set_active(active=True) # => Enables
-
class
cfme.common.
Validatable
[source]¶ Bases:
object
Mixin for various validations. Requires the class to be also
Taggable
.- :var
property_tuples
: Tuples which first value is the provider class’s attribute - name, the second value is provider’s UI summary page field key. Should have values in child classes.
-
property_tuples
= []¶
-
validate_properties
()[source]¶ Validation method which checks whether class attributes, which were used during creation of provider, are correctly displayed in Properties section of provider UI.
The maps between class attribute and UI property is done via ‘property_tuples’ variable.
Fails if some property does not match.
Validation method which check tagging between UI and provided reference_tags.
To use this method, self/caller should be extended with Taggable class
Parameters: reference_tags – If you want to compare user input with UI, pass user input as reference_tags
- :var
-
class
cfme.common.
WidgetasticTaggable
[source]¶ Bases:
object
This class can be inherited by any class that honors tagging. Class should have following
- ‘Details’ navigation
- ‘Details’ view should have entities.smart_management SummaryTable widget
- ‘EditTags’ navigation
- ‘EditTags’ view should have nested ‘form’ view with ‘tags’ table widget
- Suggest using class cfme.common.TagPageView as view for ‘EditTags’ nav
This class provides functionality to assign and unassigned tags for page models with standardized widgetastic views
-
add_tag
(category=None, tag=None, cancel=False, reset=False, details=True)[source]¶ Add tag to tested item
Parameters: - category – category(str)
- tag – tag(str) or Tag object
- cancel – set True to cancel tag assigment
- reset – set True to reset already set up tag
- details (bool) – set False if tag should be added for list selection, default is details page
Add multiple tags
Parameters: tags – pass dict with category name as key, and tag as value, or pass list with tag objects
Get list of tags assigned to item.
Details entities should have smart_management widget For vm, providers, and other like pages ‘SummaryTable’ widget should be used, for user, group like pages(no tables on details page) use ‘SummaryForm’
Parameters: tenant – string, tags tenant, default is “My Company Tags” Returns:
list
List of Tag objects
-
remove_tag
(category=None, tag=None, cancel=False, reset=False, details=True)[source]¶ Remove tag of tested item
Parameters: - category – category(str)
- tag – tag(str) or Tag object
- cancel – set True to cancel tag deletion
- reset – set True to reset tag changes
- details (bool) – set False if tag should be added for list selection, default is details page
Remove multiple of tags
Parameters: tags – pass dict with category name as key, and tag as value, or pass list with tag objects