Exemplo n.º 1
0
def go_to_default_func(_):
    """This can change, because the title of the default dashboard is mutable. However, we can xpath
    there quite reliable, so we use it that way we extract the name from the tree directly.
    """
    t = "//li[@id='db_xx-1' or @id='dashboards_xx-1']/span/a"
    accordion.click("Dashboards")
    accordion.tree("Dashboards", "All Dashboards", sel.text(t).encode("utf-8"))
Exemplo n.º 2
0
    def step(self, *args, **kwargs):
        self.prerequisite_view.navigation.select('Compute', 'Clouds',
                                                 'Instances')

        # use accordion
        accordion.tree('Images by Provider', 'Images by Provider',
                       self.obj.provider.name)
Exemplo n.º 3
0
 def step(self):
     accordion.tree(
         "Access Control",
         self.obj.appliance.server.zone.region.settings_string,
         "Users",
         self.obj.name
     )
Exemplo n.º 4
0
 def step(self):
     accordion.tree(
         "Access Control",
         self.obj.appliance.server.zone.region.settings_string,
         "Users",
         self.obj.name
     )
Exemplo n.º 5
0
def go_to_default_func(_):
    """This can change, because the title of the default dashboard is mutable. However, we can xpath
    there quite reliable, so we use it that way we extract the name from the tree directly.
    """
    t = "//li[@id='db_xx-1' or @id='dashboards_xx-1']/span/a"
    accordion.click("Dashboards")
    accordion.tree("Dashboards", "All Dashboards", sel.text(t).encode("utf-8"))
Exemplo n.º 6
0
def navigate_accordions(accordions, page_name, ui_bench_pg_limit,
                        ui_worker_pid, prod_tail, soft_assert):
    pages = []
    for acc_tree in accordions:
        pages.extend(
            analyze_page_stat(
                perf_click(ui_worker_pid, prod_tail, True, accordion.click,
                           acc_tree), soft_assert))

        logger.info('Starting to read tree: {}'.format(acc_tree))
        tree_contents, sel_time = perf_bench_read_tree(
            accordion.tree(acc_tree))
        logger.info('{} tree read in {}ms'.format(acc_tree, sel_time))

        pages.extend(
            analyze_page_stat(
                perf_click(ui_worker_pid, prod_tail, False, None),
                soft_assert))

        nav_limit = 0
        count = -1
        if accordions[acc_tree] in ui_bench_pg_limit:
            nav_limit = ui_bench_pg_limit[accordions[acc_tree]]
            count = 0

        paths = []
        generate_tree_paths(tree_contents, [], paths)
        logger.info('Found {} tree paths'.format(len(paths)))
        for path in paths:
            logger.info('Navigating to: {}, {}'.format(acc_tree, path[-1]))
            try:
                pages.extend(
                    analyze_page_stat(
                        perf_click(ui_worker_pid, prod_tail, True,
                                   accordion.tree(acc_tree).click_path, *path),
                        soft_assert))
                count += 1
                # Navigate out of the page every 4th click
                if (count % 4) == 0:
                    pages.extend(
                        analyze_page_stat(
                            perf_click(ui_worker_pid, prod_tail, False,
                                       sel.force_navigate, 'dashboard'),
                            soft_assert))
                    pages.extend(
                        analyze_page_stat(
                            perf_click(ui_worker_pid, prod_tail, False,
                                       sel.force_navigate, page_name),
                            soft_assert))
            except CandidateNotFound:
                logger.info('Could not navigate to: '.format(path[-1]))
            except UnexpectedAlertPresentException:
                logger.warning(
                    'UnexpectedAlertPresentException - page_name: {}, accordion: {},'
                    ' path: {}'.format(page_name, acc_tree, path[-1]))
                browser().switch_to_alert().dismiss()
            if not nav_limit == 0 and count >= nav_limit:
                break
    return pages
 def step(self, *args, **kwargs):
     if 'provider' in kwargs:
         provider = kwargs['provider'].name
     elif self.obj.provider:
         provider = self.obj.provider.name
     else:
         raise DestinationNotFound("the destination isn't found")
     accordion.tree('VMs & Templates', 'All VMs & Templates', provider)
 def step(self, *args, **kwargs):
     if 'provider' in kwargs:
         provider = kwargs['provider'].name
     elif self.obj.provider:
         provider = self.obj.provider.name
     else:
         raise DestinationNotFound("the destination isn't found")
     accordion.tree('VMs & Templates', 'All VMs & Templates', provider)
Exemplo n.º 9
0
 def step(self):
     """This can change, because the title of the default dashboard is mutable. However, we can
     xpath there quite reliable, so we use it that way we extract the name from the tree directly
     """''
     t = version.pick({
         "5.6": "//li[@id='db_xx-1' or @id='dashboards_xx-1']/span/a",
         "5.7": "//li[@data-nodeid='0.0.0' and @class = 'list-group-item node-db_treebox']"})
     accordion.tree("Dashboards", "All Dashboards", sel.text(t).encode("utf-8"))
Exemplo n.º 10
0
 def _nav_disabled(self):
     path = self.nav_path
     path[-1] = path[-1] + " (Disabled)"  # Try the Locked version
     try:
         accordion.tree('Datastore', *path)
         return True, None
     except exceptions.CandidateNotFound as e:
         return False, e
Exemplo n.º 11
0
    def step(self, *args, **kwargs):
        self.parent_view.navigation.select('Compute', 'Clouds', 'Instances')

        # use accordion
        # If a filter was applied, it will persist through navigation and needs to be cleared
        if sel.is_displayed(search_box.clear_advanced_search):
            logger.debug('Clearing advanced search filter')
            sel.click(search_box.clear_advanced_search)
        accordion.tree('Instances by Provider', 'Instances by Provider', self.obj.provider.name)
Exemplo n.º 12
0
 def resetter(self):
     accordion.tree('Containers', version.pick({
         version.LOWEST: 'All Containers',
         '5.7': 'All Containers (by Pods)',
     }))
     tb.select('List View')
     if paginator.page_controls_exist():
         sel.check(paginator.check_all())
         sel.uncheck(paginator.check_all())
Exemplo n.º 13
0
    def step(self):
        self.prerequisite_view.navigation.select('Compute', 'Clouds',
                                                 'Instances')

        # use accordion
        # If a filter was applied, it will persist through navigation and needs to be cleared
        if sel.is_displayed(search_box.clear_advanced_search):
            logger.debug('Clearing advanced search filter')
            sel.click(search_box.clear_advanced_search)
        accordion.tree('Instances', 'All Instances')
Exemplo n.º 14
0
    def step(self, *args, **kwargs):
        from cfme.web_ui.menu import nav
        nav._nav_to_fn('Compute', 'Clouds', 'Instances')(None)

        # use accordion
        # If a filter was applied, it will persist through navigation and needs to be cleared
        if sel.is_displayed(search_box.clear_advanced_search):
            logger.debug('Clearing advanced search filter')
            sel.click(search_box.clear_advanced_search)
        accordion.tree('Images', 'All Images')
Exemplo n.º 15
0
 def get_all_saved_reports_by_name(cls, name):
     navigate_to(cls, "All")
     accordion.tree("Saved Reports", "All Saved Reports", name)
     dates = []
     try:
         for row in reports_table.rows():
             dates.append(sel.text(row.queued_at).encode("utf-8").strip())
     except sel.NoSuchElementException:
         pass
     return dates
Exemplo n.º 16
0
 def get_all_saved_reports_by_name(cls, name):
     navigate_to(cls, 'All')
     accordion.tree("Saved Reports", "All Saved Reports", name)
     dates = []
     try:
         for row in reports_table.rows():
             dates.append(sel.text(row.queued_at).encode("utf-8").strip())
     except sel.NoSuchElementException:
         pass
     return dates
Exemplo n.º 17
0
 def resetter(self):
     # Reset view and selection
     if version.current_version() >= '5.7':
         accordion.tree('Datastores', 'All Datastores')
     else:
         # todo: there is unsupported accordion in 5.6.3.3. currently it isn't necessary
         # for existing tests
         pass
     tb.select("Grid View")
     sel.check(paginator.check_all())
     sel.uncheck(paginator.check_all())
Exemplo n.º 18
0
 def resetter(self):
     accordion.tree(
         'Containers',
         version.pick({
             version.LOWEST: 'All Containers',
             '5.7': 'All Containers (by Pods)',
         }))
     tb.select('List View')
     if paginator.page_controls_exist():
         sel.check(paginator.check_all())
         sel.uncheck(paginator.check_all())
Exemplo n.º 19
0
 def step(self):
     """This can change, because the title of the default dashboard is mutable. However, we can
     xpath there quite reliable, so we use it that way we extract the name from the tree directly
     """ ''
     t = version.pick({
         "5.6":
         "//li[@id='db_xx-1' or @id='dashboards_xx-1']/span/a",
         "5.7":
         "//li[@data-nodeid='0.0.0' and @class = 'list-group-item node-db_treebox']"
     })
     accordion.tree("Dashboards", "All Dashboards",
                    sel.text(t).encode("utf-8"))
Exemplo n.º 20
0
 def resetter(self):
     # Reset view and selection
     if self.obj.appliance.version >= '5.7':
         accordion.tree('Datastores', 'All Datastores')
     else:
         # todo: there is unsupported accordion in 5.6.3.3. currently it isn't necessary
         # for existing tests
         pass
     tb.select("Grid View")
     if paginator.page_controls_exist():
         sel.check(paginator.check_all())
         sel.uncheck(paginator.check_all())
Exemplo n.º 21
0
 def cfg_tenant_project_create(context):
     tenant = context["tenant"]
     if tenant._default:
         raise ValueError("Cannot create the root tenant {}".format(tenant.name))
     accordion.tree("Access Control", server_region_string(), "Tenants", *tenant.parent_path)
     if type(tenant) is Tenant:
         tb_select("Add child Tenant to this Tenant")
     elif type(tenant) is Project:
         tb_select("Add Project to this Tenant")
     else:
         raise TypeError(
             'You must pass either Tenant or Project class but not {}'.format(
                 type(tenant).__name__))
Exemplo n.º 22
0
 def cfg_tenant_project_create(context):
     tenant = context["tenant"]
     if tenant._default:
         raise ValueError("Cannot create the root tenant {}".format(tenant.name))
     accordion.tree("Access Control", server_region_string(), "Tenants", *tenant.parent_path)
     if type(tenant) is Tenant:
         tb_select("Add child Tenant to this Tenant")
     elif type(tenant) is Project:
         tb_select("Add Project to this Tenant")
     else:
         raise TypeError(
             'You must pass either Tenant or Project class but not {}'.format(
                 type(tenant).__name__))
Exemplo n.º 23
0
def go_to_default_func(_):
    """This can change, because the title of the default dashboard is mutable. However, we can xpath
    there quite reliable, so we use it that way we extract the name from the tree directly.
    """
    t = {
        "5.3": "//div[@id='db_treebox']/ul/li[@id='db_root']/ul/li/"
               "span[contains(@class, 'dynatree-node') and img[contains(@src, 'dashboard')]]/a",
        version.LOWEST: "//div[@id='db_treebox']/div/table/tbody/tr/td/table/"
                        "tbody[tr[@title='All Dashboards']]/tr/td/table/tbody/"
                        "tr[td/img[contains(@src, 'dashboard')]]/td/span",
    }
    accordion.click("Dashboards")
    accordion.tree("Dashboards", "All Dashboards", sel.text(t).encode("utf-8"))
Exemplo n.º 24
0
def go_to_default_func(_):
    """This can change, because the title of the default dashboard is mutable. However, we can xpath
    there quite reliable, so we use it that way we extract the name from the tree directly.
    """
    t = {
        "5.3":
        "//div[@id='db_treebox']/ul/li[@id='db_root']/ul/li/"
        "span[contains(@class, 'dynatree-node') and img[contains(@src, 'dashboard')]]/a",
        version.LOWEST:
        "//div[@id='db_treebox']/div/table/tbody/tr/td/table/"
        "tbody[tr[@title='All Dashboards']]/tr/td/table/tbody/"
        "tr[td/img[contains(@src, 'dashboard')]]/td/span",
    }
    accordion.click("Dashboards")
    accordion.tree("Dashboards", "All Dashboards", sel.text(t).encode("utf-8"))
Exemplo n.º 25
0
 def step(self, *args, **kwargs):
     if ('provider' in kwargs or self.obj.provider) and \
        ('datacenter_name' in kwargs or self.obj.datacenter):
         # todo: to obtain datacenter from db (ems_folders)
         # currently, it's unclear how it is tied up with vms
         try:
             provider = kwargs['provider'].name
         except KeyError:
             provider = self.obj.provider.name
         try:
             datacenter = kwargs['datacenter_name']
         except KeyError:
             datacenter = self.obj.datacenter
     else:
         raise DestinationNotFound("the destination isn't found")
     accordion.tree('VMs & Templates', 'All VMs & Templates', provider, datacenter)
Exemplo n.º 26
0
 def step(self, *args, **kwargs):
     if ('provider' in kwargs or self.obj.provider) and \
        ('datacenter_name' in kwargs or self.obj.datacenter):
         # todo: to obtain datacenter from db (ems_folders)
         # currently, it's unclear how it is tied up with vms
         try:
             provider = kwargs['provider'].name
         except KeyError:
             provider = self.obj.provider.name
         try:
             datacenter = kwargs['datacenter_name']
         except KeyError:
             datacenter = self.obj.datacenter
     else:
         raise DestinationNotFound("the destination isn't found")
     accordion.tree('VMs & Templates', 'All VMs & Templates', provider, datacenter)
Exemplo n.º 27
0
def navigate_accordions(accordions, page_name, ui_bench_pg_limit, ui_worker_pid, prod_tail,
        soft_assert):
    pages = []
    for acc_tree in accordions:
        pages.extend(analyze_page_stat(perf_click(ui_worker_pid, prod_tail, True, accordion.click,
            acc_tree), soft_assert))

        logger.info('Starting to read tree: {}'.format(acc_tree))
        tree_contents, sel_time = perf_bench_read_tree(accordion.tree(acc_tree))
        logger.info('{} tree read in {}ms'.format(acc_tree, sel_time))

        pages.extend(analyze_page_stat(perf_click(ui_worker_pid, prod_tail, False, None),
            soft_assert))

        nav_limit = 0
        count = -1
        if accordions[acc_tree] in ui_bench_pg_limit:
            nav_limit = ui_bench_pg_limit[accordions[acc_tree]]
            count = 0

        paths = []
        generate_tree_paths(tree_contents, [], paths)
        logger.info('Found {} tree paths'.format(len(paths)))
        for path in paths:
            logger.info('Navigating to: {}, {}'.format(acc_tree, path[-1]))
            try:
                pages.extend(analyze_page_stat(perf_click(ui_worker_pid, prod_tail, True,
                    accordion.tree(acc_tree).click_path, *path), soft_assert))
                count += 1
                # Navigate out of the page every 4th click
                if (count % 4) == 0:
                    pages.extend(analyze_page_stat(perf_click(ui_worker_pid, prod_tail, False,
                        sel.force_navigate, 'dashboard'), soft_assert))
                    pages.extend(analyze_page_stat(perf_click(ui_worker_pid, prod_tail, False,
                        sel.force_navigate, page_name), soft_assert))
            except CandidateNotFound:
                logger.info('Could not navigate to: '.format(path[-1]))
            except UnexpectedAlertPresentException:
                logger.warning('UnexpectedAlertPresentException - page_name: {}, accordion: {},'
                    ' path: {}'.format(page_name, acc_tree, path[-1]))
                browser().switch_to_alert().dismiss()
            if not nav_limit == 0 and count >= nav_limit:
                break
    return pages
Exemplo n.º 28
0
def test_shuffle_first_level(group, on_finish_default):
    # Find a folder
    pytest.sel.force_navigate("reports")
    tree = accordion.tree("Reports").read_contents()
    folders = Tree.browse(tree, "All Reports")
    # Select some folder that has at least 3 children
    folders = map(lambda item: item[0],
                filter(lambda item: isinstance(item[1], list) and len(item[1]) >= 3, folders))
    selected_folder = random.choice(folders)
    # Shuffle the order
    with menus.manage_folder(group, selected_folder) as folder:
        order = shuffle(folder.fields)
        for item in reversed(order):
            folder.move_first(item)
    # Now go and read the tree
    pytest.sel.force_navigate("reports")
    tree = accordion.tree("Reports").read_contents()
    checked = Tree.flatten_level(Tree.browse(tree, "All Reports", selected_folder))
    assert checked == order, "The order differs!"
Exemplo n.º 29
0
def test_shuffle_top_level(group, on_finish_default):
    # Shuffle the order
    with menus.manage_folder(group) as folder:
        order = shuffle(folder.fields)
        for item in reversed(order):
            folder.move_first(item)
    # Now go and read the tree
    pytest.sel.force_navigate("reports")
    tree = accordion.tree("Reports").read_contents()
    checked = Tree.flatten_level(Tree.browse(tree, "All Reports"))
    assert checked == order, "The order differs!"
Exemplo n.º 30
0
def ac_tree(*path):
    """DRY function to access the shared level of the accordion tree.

    Args:
        *path: Path to click in the tree that follows the '[cfme] region xyz' node
    """
    path = version.pick({
        # "9.9.9.9": ["CFME Region: Region %d [%d]" % server_region_pair()] + list(path),
        "default": path,
    })
    return accordion.tree("Access Control", *path)
Exemplo n.º 31
0
 def reorder_elements(self, tab, box, *element_data):
     navigate_to(self, 'Edit')
     tree = accordion.tree("Dialog")
     tree.click_path(self.label, tab, box)
     list_ele = []
     for each_element in element_data:
         list_ele.append(each_element.get("ele_label"))
     ele_1 = self.element(list_ele[0])
     ele_2 = self.element(list_ele[1])
     sel.drag_and_drop(ele_1, ele_2)
     sel.click(form_buttons.save)
     flash.assert_no_errors()
Exemplo n.º 32
0
 def reorder_elements(self, tab, box, *element_data):
     navigate_to(self, 'Edit')
     tree = accordion.tree("Dialog")
     tree.click_path(self.label, tab, box)
     list_ele = []
     for each_element in element_data:
         list_ele.append(each_element.get("ele_label"))
     ele_1 = self.element(list_ele[0])
     ele_2 = self.element(list_ele[1])
     sel.drag_and_drop(ele_1, ele_2)
     sel.click(form_buttons.save)
     flash.assert_no_errors()
Exemplo n.º 33
0
def ac_tree(*path):
    """DRY function to access the shared level of the accordion tree.

    Args:
        *path: Path to click in the tree that follows the '[cfme] region xyz' node
    """
    path = version.pick(
        {
            # "9.9.9.9": ["CFME Region: Region %d [%d]" % server_region_pair()] + list(path),
            "default": path
        }
    )
    return accordion.tree("Access Control", *path)
Exemplo n.º 34
0
 def reorder_elements(self, tab, box, *element_data):
     sel.force_navigate('service_dialog_edit', context={'dialog': self})
     if version.current_version() > "5.5":
         tree = accordion.tree("Dialog")
     else:
         tree = Tree("dialog_edit_treebox")
     tree.click_path(self.label, tab, box)
     list_ele = []
     for each_element in element_data:
         list_ele.append(each_element.get("ele_label"))
     ele_1 = self.element(list_ele[0])
     ele_2 = self.element(list_ele[1])
     sel.drag_and_drop(ele_1, ele_2)
     sel.click(form_buttons.save)
     flash.assert_no_errors()
Exemplo n.º 35
0
def test_clear_datastore_filter_results(provider):
    """ Test for clearing filter results for datastores."""

    if version.current_version() >= 5.6:
        expected_page_title = "All Datastores"
        datastore_select = lambda: accordion.tree("Datastores", "All Datastores", "Global Filters", "Store Type / VMFS")
    else:
        expected_page_title = "Datastores"
        datastore_select = lambda: list_acc.select("Filters", "Store Type / VMFS", by_title=False)

    pytest.sel.force_navigate("infrastructure_datastores")
    datastore_select()
    pytest.sel.click(search_box.clear_advanced_search)
    page_title = pytest.sel.text(datastore.page_title_loc)
    assert page_title == expected_page_title, "Clear filter results failed"
Exemplo n.º 36
0
 def reorder_elements(self, tab, box, *element_data):
     sel.force_navigate('service_dialog_edit', context={'dialog': self})
     if version.current_version() > "5.5":
         tree = accordion.tree("Dialog")
     else:
         tree = Tree("dialog_edit_treebox")
     tree.click_path(self.label, tab, box)
     list_ele = []
     for each_element in element_data:
         list_ele.append(each_element.get("ele_label"))
     ele_1 = self.element(list_ele[0])
     ele_2 = self.element(list_ele[1])
     sel.drag_and_drop(ele_1, ele_2)
     sel.click(form_buttons.save)
     flash.assert_no_errors()
Exemplo n.º 37
0
 def update_element(self, second_element, element_data):
     navigate_to(self, 'Edit')
     if self.appliance.version > "5.5":
         tree = accordion.tree("Dialog")
     else:
         tree = Tree("dialog_edit_treebox")
     tree.click_path(self.label, self.tab_label, self.box_label)
     self.add_element(second_element)
     list_ele = []
     list_ele.append(element_data.get("ele_label"))
     list_ele.append(second_element.get("ele_label"))
     tree.click_path(self.label, self.tab_label, self.box_label)
     ele_1 = self.element(list_ele[0])
     ele_2 = self.element(list_ele[1])
     sel.drag_and_drop(ele_1, ele_2)
     sel.click(form_buttons.save)
     flash.assert_no_errors()
Exemplo n.º 38
0
 def update_element(self, second_element, element_data):
     sel.force_navigate('service_dialog_edit', context={'dialog': self})
     if version.current_version() > "5.5":
         tree = accordion.tree("Dialog")
     else:
         tree = Tree("dialog_edit_treebox")
     tree.click_path(self.label, self.tab_label, self.box_label)
     self.add_element(second_element)
     list_ele = []
     list_ele.append(element_data.get("ele_label"))
     list_ele.append(second_element.get("ele_label"))
     tree.click_path(self.label, self.tab_label, self.box_label)
     ele_1 = self.element(list_ele[0])
     ele_2 = self.element(list_ele[1])
     sel.drag_and_drop(ele_1, ele_2)
     sel.click(form_buttons.save)
     flash.assert_no_errors()
Exemplo n.º 39
0
 def update_element(self, second_element, element_data):
     navigate_to(self, 'Edit')
     if version.current_version() > "5.5":
         tree = accordion.tree("Dialog")
     else:
         tree = Tree("dialog_edit_treebox")
     tree.click_path(self.label, self.tab_label, self.box_label)
     self.add_element(second_element)
     list_ele = []
     list_ele.append(element_data.get("ele_label"))
     list_ele.append(second_element.get("ele_label"))
     tree.click_path(self.label, self.tab_label, self.box_label)
     ele_1 = self.element(list_ele[0])
     ele_2 = self.element(list_ele[1])
     sel.drag_and_drop(ele_1, ele_2)
     sel.click(form_buttons.save)
     flash.assert_no_errors()
Exemplo n.º 40
0
def test_clear_datastore_filter_results(provider):
    """ Test for clearing filter results for datastores."""

    if version.current_version() >= 5.6:
        expected_page_title = 'All Datastores'
        datastore_select = lambda: accordion.tree(
            'Datastores', 'All Datastores', 'Global Filters',
            'Store Type / VMFS')
    else:
        expected_page_title = 'Datastores'
        datastore_select = lambda: list_acc.select(
            'Filters', 'Store Type / VMFS', by_title=False)

    pytest.sel.force_navigate('infrastructure_datastores')
    datastore_select()
    pytest.sel.click(search_box.clear_advanced_search)
    page_title = pytest.sel.text(datastore.page_title_loc)
    assert page_title == expected_page_title, 'Clear filter results failed'
Exemplo n.º 41
0
pol_btn = partial(tb.select, "Policy")

edit_tags_form = Form(fields=[(
    "select_tag",
    Select("select#tag_cat")), ("select_value", Select("select#tag_add"))])

tag_table = Table("//div[@id='assignments_div']//table")

group_order_selector = UpDownSelect("select#seq_fields",
                                    "//img[@alt='Move selected fields up']",
                                    "//img[@alt='Move selected fields down']")

nav.add_branch(
    'configuration', {
        'cfg_accesscontrol_users': [
            lambda d: accordion.tree("Access Control", server_region_string(),
                                     "Users"), {
                                         'cfg_accesscontrol_user_add':
                                         lambda d: tb_select("Add a new User")
                                     }
        ],
        'cfg_accesscontrol_user_ed': [
            lambda ctx: accordion.tree("Access Control", server_region_string(
            ), "Users", ctx.user.name), {
                'cfg_accesscontrol_user_edit':
                lambda d: tb_select('Edit this User')
            }
        ],
        'cfg_accesscontrol_groups': [
            lambda d: accordion.tree("Access Control", server_region_string(
            ), "Groups"), {
                'cfg_accesscontrol_group_add':
Exemplo n.º 42
0
 def step(self):
     accordion.tree("Saved Reports", "All Saved Reports", self.obj.name,
                    self.obj.timestamp)
Exemplo n.º 43
0
 def f():
     accordion.tree(*args)
     toolbar.select('Grid View')
Exemplo n.º 44
0
 def step(self):
     accordion.tree('Service Dialogs', "All Dialogs", self.obj.label)
Exemplo n.º 45
0
 def resetter(self):
     accordion.tree("Service Dialogs", "All Dialogs")
Exemplo n.º 46
0
def _all_catalogitems_add_new(context):
    accordion.tree('Catalog Items', 'All Catalog Items')
    tb_select('Add a New Catalog Item')
    provider_type = context['provider_type']
    sel.select("//select[@id='st_prov_type']", provider_type)
Exemplo n.º 47
0
 def step(self):
     self.parent_view.navigation.select('Services', 'Catalogs')
     tree = accordion.tree('Catalog Items')
     tree.click_path('All Catalog Items')
Exemplo n.º 48
0
def reload_view():
    """Reloads and keeps on the current tabstrip page"""
    current = tabstrip.get_selected_tab()
    toolbar.select("Reload current display")
    tabstrip.select_tab(current)


cfg_btn = partial(toolbar.select, "Configuration")

nav.add_branch(
    "reports",
    {
        "reports_all":
        [
            lambda ctx: accordion.tree("Reports", "All Reports"),
            {
                "report_add":
                lambda ctx: cfg_btn("Add a new Report"),
            }
        ],

        "report_canned":
        [
            lambda ctx: accordion.tree("Reports", "All Reports", *ctx["path"]),
            {
                "report_canned_info":
                [
                    lambda ctx: tabstrip.select_tab("Report Info"),
                    {
                        # Empty for now
Exemplo n.º 49
0
 def resetter(self):
     accordion.tree('Configured Systems', 'All Configured Systems')
     tb.select('Grid View')
Exemplo n.º 50
0
 def resetter(self):
     if self.obj.appliance.version >= '5.8':
         accordion.tree('Providers', 'All Ansible Tower Providers')
     else:
         accordion.tree('Providers', 'All Configuration Manager Providers')
     tb.select('Grid View')
Exemplo n.º 51
0
 def step(self):
     accordion.tree("Provisioning Dialogs", "All Dialogs", self.obj.type_tree_nav,
         self.obj.description)
Exemplo n.º 52
0
 def step(self):
     accordion.tree("Provisioning Dialogs", "All Dialogs", self.obj.type_tree_nav)
     cfg_btn("Add a new Dialog")
Exemplo n.º 53
0
 def navigate(context):
     tenant = context["tenant"]
     accordion.tree("Access Control", server_region_string(), "Tenants",
                    *tenant.tree_path)
Exemplo n.º 54
0
    accordion.tree('Catalog Items', 'All Catalog Items')
    tb_select('Add a New Catalog Item')
    provider_type = context['provider_type']
    sel.select("//select[@id='st_prov_type']", provider_type)


def _all_catalogbundle_add_new(context):
    sel.click("//div[@id='sandt_tree_div']//td[normalize-space(.)='All Catalog Items']")
    tb_select('Add a New Catalog Bundle')


nav.add_branch(
    'services_catalogs',
    {'catalog_items': [nav.partial(accordion.click, 'Catalog Items'),
        {'catalog_item_new': _all_catalogitems_add_new,
         'catalog_item': [lambda ctx: accordion.tree('Catalog Items', 'All Catalog Items',
                                ctx['catalog'], ctx['catalog_item'].name),
                          {'catalog_item_edit': nav.partial(tb_select,
                                                            "Edit this Item")}]}]})


class Template(Pretty):
    pretty_attrs = ['name']

    def __init__(self, name):
        self.name = name


class Instance(Updateable, Pretty):
    pretty_attrs = ['name', 'item_type', 'catalog', 'vm_name', 'instance_type', 'availability_zone']

    def __init__(self, item_type=None, name=None, description=None,
Exemplo n.º 55
0
list_table = SplitTable(
    header_data=("//div[@id='list_grid']/div[@class='xhdr']/table/tbody", 1),
    body_data=("//div[@id='list_grid']/div[@class='objbox']/table/tbody", 1),
)

add_manager_btn = form_buttons.FormButton('Add')
edit_manager_btn = form_buttons.FormButton('Save changes')
cfg_btn = partial(tb.select, 'Configuration')

nav.add_branch(
    'infrastructure_config_management', {
        'infrastructure_config_managers': [
            lambda _: (accordion.tree(
                'Providers',
                version.pick({
                    version.LOWEST: 'All Red Hat Satellite Providers',
                    version.UPSTREAM: 'All Foreman Providers'
                })), tb.select('Grid View')),
            {
                'infrastructure_config_manager_new':
                lambda _: cfg_btn('Add a new Provider'),
                'infrastructure_config_manager': [
                    lambda ctx: sel.check(
                        Quadicon(
                            '{} Configuration Manager'.
                            format(ctx['manager'].name), None).checkbox), {
                                'infrastructure_config_manager_edit':
                                lambda _: cfg_btn('Edit Selected item'),
                                'infrastructure_config_manager_refresh':
                                lambda _: cfg_btn(
                                    'Refresh Relationships and Power states',
Exemplo n.º 56
0
def get_sch_name(sch):
    """Enables us using both string and schedule object"""
    if isinstance(sch, basestring):
        return sch
    elif isinstance(sch, Schedule):
        return sch.name
    else:
        return str(sch)

nav.add_branch(
    "reports",
    {
        "schedules":
        [
            lambda ctx: accordion.tree("Schedules", "All Schedules"),
            {
                "schedule_add": lambda ctx: cfg_btn("Add a new Schedule")
            }
        ],

        "schedule":
        [
            lambda ctx: accordion.tree("Schedules", "All Schedules", get_sch_name(ctx["schedule"])),
            {
                "schedule_edit": lambda ctx: cfg_btn("Edit this Schedule")
            }
        ],
    }
)
Exemplo n.º 57
0
# -*- coding: utf-8 -*-

from cfme import web_ui as ui
from cfme.fixtures import pytest_selenium as sel
from cfme.web_ui import Region, accordion, fill, flash, form_buttons
from cfme.web_ui.menu import nav

nav.add_branch(
    "reports", {
        "import_export":
        lambda ctx: accordion.tree("Import/Export", "Import / Export"),
    })

form = Region(locators=dict(
    export_select=ui.Select("//select[@id='choices_chosen']", multi=True),
    export_button=form_buttons.FormButton("Download Report to YAML"),
    import_overwrite=ui.Input('overwrite'),
    import_file=ui.Input('upload_file'),
    import_submit=ui.Input('upload_atags')))

export_select = ui.Select("//select[@id='choices_chosen']", multi=True)
export_button = form_buttons.FormButton("Download Report to YAML")


def export_reports(*custom_report_names):
    sel.force_navigate("import_export")
    fill(form.export_select, custom_report_names)
    sel.click(form.export_button)


def import_reports(filename, overwrite=False):