cfme.web_ui.menu module

cfme.web_ui.menu.extend_nav(cls)[source]

A decorator, that when placed on a class will turn it to a nav tree extension.

Takes the original class and “compiles” it into the nav tree in form of lists/dicts that ui_navigate takes.

The classes in the structure are not instantiated during the scavenge process, they serve as a sort of static container of namespaced functions.

Example:

@extend_nav
class infra_vms(object):   # This will extend the node infra_vms
    class node_a(object):  # with node a
        def navigate(_):   # that can be reached this way from preceeding one
            pass

        def leaf_location(ctx):  # Leaf location, no other child locations
            pass

        class node_x(object):  # Or an another location that can contain locations
            def navigate(_):
                pass
Parameters:cls – Class to be decorated.
cfme.web_ui.menu.get_current_toplevel_name()[source]

Returns text of the currently selected top level menu item.

cfme.web_ui.menu.is_page_active(toplevel, secondlevel=None)[source]
cfme.web_ui.menu.nav_to_fn(toplevel, secondlevel=None, reset_action=None)[source]
cfme.web_ui.menu.reverse_lookup(toplevel_path, secondlevel_path=None)[source]

Reverse lookup for navigation destinations defined in this module, based on menu text

Usage:

# Returns 'clouds'
reverse_lookup('Clouds')

# Returns 'clouds_providers'
reverse_lookup('Clouds', 'Providers')

# Returns 'automate_import_export'
reverse_lookup('Automate', 'Import / Export')

Note

It may be tempting to use this when you don’t know the name of a page, e.g.:

go_to(reverse_lookup(‘Infrastructure’, ‘Providers’))

Don’t do that; use the nav tree name.

cfme.web_ui.menu.visible_pages()[source]

Return a list of all the menu pages currently visible top- and second-level pages

Mainly useful for RBAC testing

cfme.web_ui.menu.visible_toplevel_tabs()[source]