def test_nodes_views():
    navigate_to(NodeCollection, 'All')
    tb.select('Grid View')
    assert tb.is_active('Grid View'), "Nodes grid view setting failed"
    tb.select('Tile View')
    assert tb.is_active('Tile View'), "Nodes tile view setting failed"
    tb.select('List View')
    assert tb.is_active('List View'), "Nodes list view setting failed"
def test_pods_views():
    navigate_to(Pod, 'All')
    tb.select('Grid View')
    assert tb.is_active('Grid View'), "Pods grid view setting failed"
    tb.select('Tile View')
    assert tb.is_active('Tile View'), "Pods tile view setting failed"
    tb.select('List View')
    assert tb.is_active('List View'), "Pods list view setting failed"
def test_containers_views():
    navigate_to(Container, 'All')
    tb.select('Grid View')
    assert tb.is_active('Grid View'), "Containers grid view setting failed"
    tb.select('Tile View')
    assert tb.is_active('Tile View'), "Containers tile view setting failed"
    tb.select('List View')
    assert tb.is_active('List View'), "Containers list view setting failed"
def test_replicators_views():
    sel.force_navigate('containers_replicators')
    tb.select('Grid View')
    assert tb.is_active('Grid View'), "Replicators grid view setting failed"
    tb.select('Tile View')
    assert tb.is_active('Tile View'), "Replicators tile view setting failed"
    tb.select('List View')
    assert tb.is_active('List View'), "Replicators list view setting failed"
def test_images_views():
    sel.force_navigate('containers_images')
    tb.select('Grid View')
    assert tb.is_active('Grid View'), "Images grid view setting failed"
    tb.select('Tile View')
    assert tb.is_active('Tile View'), "Images tile view setting failed"
    tb.select('List View')
    assert tb.is_active('List View'), "Images list view setting failed"
def test_replicators_views():
    sel.force_navigate('containers_replicators')
    tb.select('Grid View')
    assert tb.is_active('Grid View'), "Replicators grid view setting failed"
    tb.select('Tile View')
    assert tb.is_active('Tile View'), "Replicators tile view setting failed"
    tb.select('List View')
    assert tb.is_active('List View'), "Replicators list view setting failed"
def test_images_views():
    navigate_to(Image, 'All')
    tb.select('Grid View')
    assert tb.is_active('Grid View'), "Images grid view setting failed"
    tb.select('Tile View')
    assert tb.is_active('Tile View'), "Images tile view setting failed"
    tb.select('List View')
    assert tb.is_active('List View'), "Images list view setting failed"
def test_images_views():
    sel.force_navigate('containers_images')
    tb.select('Grid View')
    assert tb.is_active('Grid View'), "Images grid view setting failed"
    tb.select('Tile View')
    assert tb.is_active('Tile View'), "Images tile view setting failed"
    tb.select('List View')
    assert tb.is_active('List View'), "Images list view setting failed"
def test_replicators_views():
    navigate_to(Replicator, 'All')
    tb.select('Grid View')
    assert tb.is_active('Grid View'), "Replicators grid view setting failed"
    tb.select('Tile View')
    assert tb.is_active('Tile View'), "Replicators tile view setting failed"
    tb.select('List View')
    assert tb.is_active('List View'), "Replicators list view setting failed"
def test_pods_views():
    """ This test verifies functionality of different views.
        Views that are being tested are: grid view, tile view,
        and list view

    """
    navigate_to(Pod, 'All')
    tb.select('Grid View')
    assert tb.is_active('Grid View'), "Pods grid view setting failed"
    tb.select('Tile View')
    assert tb.is_active('Tile View'), "Pods tile view setting failed"
    tb.select('List View')
    assert tb.is_active('List View'), "Pods list view setting failed"
Beispiel #11
0
    def equal_drift_results(self, row_text, *indexes):
        """ Compares drift analysis results of a row specified by it's title text

        Args:
            row_text: Title text of the row to compare
            indexes: Indexes of results to compare starting with 0 for first row (latest result).
                     Compares all available drifts, if left empty (default).

        Note:
            There have to be at least 2 drift results available for this to work.

        Returns:
            ``True`` if equal, ``False`` otherwise.
        """
        # mark by indexes or mark all
        sel.force_navigate('infrastructure_host', context={'host': self})
        list_acc.select('Relationships', 'Show host drift history')
        if indexes:
            drift_table.select_rows_by_indexes(*indexes)
        else:
            # We can't compare more than 10 drift results at once
            # so when selecting all, we have to limit it to the latest 10
            if len(list(drift_table.rows())) > 10:
                drift_table.select_rows_by_indexes(*range(0, 10))
            else:
                drift_table.select_all()
        tb.select("Select up to 10 timestamps for Drift Analysis")

        d_grid = DriftGrid()
        if not tb.is_active("All attributes"):
            tb.select("All attributes")
        if any(d_grid.cell_indicates_change(row_text, i) for i in range(0, len(indexes))):
            return False
        return True
Beispiel #12
0
def test_grid_defaultview(request, setup_a_provider, key):
    name = re.split(r"\/", key)
    default_view = get_default_view(name[0])
    set_grid_view(name[0])
    sel.force_navigate(name[1])
    assert tb.is_active('Grid View'), "Grid Default view setting failed"
    reset_default_view(name[0], default_view)
Beispiel #13
0
def test_table_views():
    for obj in objects_mapping.keys():
        navigate_to(obj, 'All')
        view = choice(VIEWS)
        tb.select(view)
        if not tb.is_active(view):
            raise Exception("Failed to set view \"{}\" For {}".format(view, obj.__name__))
Beispiel #14
0
def test_default_views(random_default_views):
    for obj in objects_mapping.keys():
        navigate_to(obj, 'All', use_resetter=False)
        view = random_default_views[obj]
    if not tb.is_active(view):
        raise Exception("Failed to setup default view \"{}\" for {}"
                        .format(view, objects_mapping[obj]))
Beispiel #15
0
    def equal_drift_results(self, row_text, section, *indexes):
        """ Compares drift analysis results of a row specified by it's title text

        Args:
            row_text: Title text of the row to compare
            section: Accordion section where the change happened; this section must be activated
            indexes: Indexes of results to compare starting with 0 for first row (latest result).
                     Compares all available drifts, if left empty (default).

        Note:
            There have to be at least 2 drift results available for this to work.

        Returns:
            ``True`` if equal, ``False`` otherwise.
        """
        # mark by indexes or mark all
        navigate_to(self, 'Details')
        list_acc.select(
            'Relationships',
            version.pick({
                version.LOWEST: 'Show host drift history',
                '5.4': 'Show Host drift history'
            }))
        if indexes:
            drift_table.select_rows_by_indexes(*indexes)
        else:
            # We can't compare more than 10 drift results at once
            # so when selecting all, we have to limit it to the latest 10
            if len(list(drift_table.rows())) > 10:
                drift_table.select_rows_by_indexes(*range(0, 10))
            else:
                drift_table.select_all()
        tb.select("Select up to 10 timestamps for Drift Analysis")

        # Make sure the section we need is active/open
        sec_loc_map = {
            'Properties': 'Properties',
            'Security': 'Security',
            'Configuration': 'Configuration',
            'My Company Tags': 'Categories'
        }
        active_sec_loc = "//div[@id='all_sections_treebox']//li[contains(@id, 'group_{}')]"\
            "/span[contains(@class, 'dynatree-selected')]".format(sec_loc_map[section])
        sec_checkbox_loc = "//div[@id='all_sections_treebox']//li[contains(@id, 'group_{}')]"\
            "//span[contains(@class, 'dynatree-checkbox')]".format(sec_loc_map[section])
        sec_apply_btn = "//div[@id='accordion']/a[contains(normalize-space(text()), 'Apply')]"

        # If the section is not active yet, activate it
        if not sel.is_displayed(active_sec_loc):
            sel.click(sec_checkbox_loc)
            sel.click(sec_apply_btn)

        if not tb.is_active("All attributes"):
            tb.select("All attributes")
        d_grid = DriftGrid()
        if any(
                d_grid.cell_indicates_change(row_text, i)
                for i in range(0, len(indexes))):
            return False
        return True
def test_default_views(random_default_views):
    for obj in objects_mapping.keys():
        navigate_to(obj, 'All', use_resetter=False)
        view = random_default_views[obj]
    if not tb.is_active(view):
        raise Exception("Failed to setup default view \"{}\" for {}"
                        .format(view, objects_mapping[obj]))
def set_and_test_default_view(group_name, view, page):
    old_default = DefaultView.get_default_view(group_name, fieldset='Clouds')
    DefaultView.set_default_view(group_name, view, fieldset='Clouds')
    navigate_to(page, 'All', use_resetter=False)
    # TODO replace view detection with widgets when all tested classes have them
    assert tb.is_active(view), "{} view setting failed".format(view)
    DefaultView.set_default_view(group_name, old_default, fieldset='Clouds')
def set_and_test_default_view(group_name, view, page):
    old_default = DefaultView.get_default_view(group_name)
    DefaultView.set_default_view(group_name, view)
    navigate_to(page, 'All', use_resetter=False)
    # TODO replace view detection with widgets when all tested classes have them
    assert tb.is_active(view), "{} view setting failed".format(view)
    DefaultView.set_default_view(group_name, old_default)
Beispiel #19
0
def test_tabular_view(request, setup_a_provider):
    path = [
        "Configuration Management", "Hosts", "Virtual Infrastructure Platforms"
    ]
    report = CannedSavedReport.new(path)
    report.navigate()
    tb.select('Tabular View')
    assert tb.is_active('Tabular View'), "Tabular view setting failed"
def test_containers_providers_views(view):
    """
    Click on top right "grid view", "tile view", "list view" icon.
    Verify routes appear in a proper view
    """
    sel.force_navigate('containers_providers')
    tb.select(''.join(view))
    assert tb.is_active(''.join(view)), "{}' setting failed".format(''.join(view))
Beispiel #21
0
def test_table_views():
    for obj in objects_mapping.keys():
        navigate_to(obj, 'All')
        view = choice(VIEWS)
        tb.select(view)
        if not tb.is_active(view):
            raise Exception("Failed to set view \"{}\" For {}".format(
                view, obj.__name__))
Beispiel #22
0
def set_and_test_view(group_name, view):
    old_default = DefaultView.get_default_view(group_name)
    DefaultView.set_default_view(group_name, view)
    navigate_to(Vm, 'All')
    select_two_quads()
    tb.select('Configuration', 'Compare Selected items')
    assert tb.is_active(view), "{} setting failed".format(view)
    DefaultView.set_default_view(group_name, old_default)
def set_and_test_view(group_name, view):
    default_view = get_default_view(group_name)
    set_view(group_name, view)
    sel.force_navigate('clouds_instances')
    select_two_quads()
    tb.select('Configuration', 'Compare Selected items')
    assert tb.is_active(view), "{} setting failed".format(view)
    reset_default_view(group_name, default_view)
def set_and_test_view(group_name, view):
    default_view = get_default_view(group_name)
    set_view(group_name, view)
    sel.force_navigate('infrastructure_virtual_machines')
    select_two_quads()
    tb.select('Configuration', 'Compare Selected items')
    assert tb.is_active(view), "{} setting failed".format(view)
    reset_default_view(group_name, default_view)
def set_and_test_view(group_name, view):
    old_default = DefaultView.get_default_view(group_name)
    DefaultView.set_default_view(group_name, view)
    inst_view = navigate_to(Instance, 'All')
    [e.check() for e in inst_view.entities.get_all()[:2]]
    inst_view.toolbar.configuration.item_select('Compare Selected items')
    assert tb.is_active(view), "{} setting failed".format(view)
    DefaultView.set_default_view(group_name, old_default)
Beispiel #26
0
def set_and_test_view(group_name, view):
    old_default = DefaultView.get_default_view(group_name)
    DefaultView.set_default_view(group_name, view)
    vm_view = navigate_to(Vm, 'All')
    [e.check() for e in vm_view.entities.get_all()[:2]]
    vm_view.toolbar.configuration.item_select('Compare Selected items')
    assert tb.is_active(view), "{} setting failed".format(view)
    DefaultView.set_default_view(group_name, old_default)
def set_and_test_view(group_name, view):
    old_default = DefaultView.get_default_view(group_name)
    DefaultView.set_default_view(group_name, view)
    navigate_to(Instance, 'All')
    select_two_quads()
    tb.select('Configuration', 'Compare Selected items')
    assert tb.is_active(view), "{} setting failed".format(view)
    DefaultView.set_default_view(group_name, old_default)
Beispiel #28
0
def test_tile_defaultview(request, setup_a_provider, key):
    name = re.split(r"\/", key)
    default_view = get_default_view(name[0])
    set_tile_view(name[0])
    sel.force_navigate(name[1])
    if name[1] == "clouds_providers" or "clouds_instances":
        tb.select('Tile View')
    assert tb.is_active('Tile View'), "Tile Default view setting failed"
    reset_default_view(name[0], default_view)
def set_and_test_default_view(group_name, view, page):
    default_view = get_default_view(group_name)
    set_view(group_name, view)
    if isinstance(page, basestring):
        sel.force_navigate(page)
    else:
        navigate_to(page, 'All', use_resetter=False)
    assert tb.is_active(view), "{} view setting failed".format(view)
    reset_default_view(group_name, default_view)
Beispiel #30
0
def test_list_defaultview(request, setup_a_provider, key):
    name = re.split(r"\/", key)
    default_view = get_default_view(name[0])
    set_list_view(name[0])
    sel.force_navigate(name[1])
    if name[1] == "infrastructure_providers":
        tb.select('List View')
    assert tb.is_active('List View'), "List Default view setting failed"
    reset_default_view(name[0], default_view)
def test_table_views(appliance):
    for obj in objects_mapping.keys():
        if isinstance(obj, BaseCollection):
            obj = appliance.get(obj)
        navigate_to(obj, 'All')
        view = choice(VIEWS)
        tb.select(view)
        if not tb.is_active(view):
            raise Exception("Failed to set view \"{}\" For {}".format(view, obj.__name__))
def test_tile_defaultview(request, setup_a_provider, key):
    name = re.split(r"\/", key)
    default_view = get_default_view(name[0])
    set_tile_view(name[0])
    sel.force_navigate(name[1])
    if name[1] == "clouds_providers" or "clouds_instances":
        tb.select('Tile View')
    assert tb.is_active('Tile View'), "Tile Default view setting failed"
    reset_default_view(name[0], default_view)
def test_containers_providers_views():
    """
    Click on top right "grid view", "tile view", "list view" icon.
    Verify routes appear in a proper view
    """
    navigate_to(ContainersProvider, 'All')
    for view in views:
        tb.select(view)
        assert tb.is_active(view), "{}' setting failed".format(view)
def test_containers_projects_views():
    """
    Click on top right "grid view", "tile view", "list view" icon.
    Verify routes appear in a proper view
    """
    sel.force_navigate('containers_projects')
    for view in views:
        tb.select(view)
        assert tb.is_active(view), "{}' setting failed".format(view)
Beispiel #35
0
def test_containers_providers_views(view):
    """
    Click on top right "grid view", "tile view", "list view" icon.
    Verify routes appear in a proper view
    """
    sel.force_navigate('containers_providers')
    tb.select(''.join(view))
    assert tb.is_active(''.join(view)), "{}' setting failed".format(
        ''.join(view))
def set_and_test_default_view(group_name, view, page):
    old_default = DefaultView.get_default_view(group_name)
    DefaultView.set_default_view(group_name, view)
    dest = 'All'
    if group_name == 'VMs':
        dest = 'VMsOnly'
    navigate_to(page, dest, use_resetter=False)

    assert tb.is_active(view), "{} view setting failed".format(view)
    DefaultView.set_default_view(group_name, old_default)
Beispiel #37
0
def test_compressed_view(request, setup_a_provider, key):
    name = re.split(r"\/", key)
    default_view = get_default_view(name[0])
    set_compressed_view(name[0])
    sel.force_navigate(name[1])
    Quadicon.select_first_quad()
    select_second_quad()
    tb.select(name[2], name[3])
    assert tb.is_active('Compressed View'), "Compressed view setting failed"
    reset_default_view(name[0], default_view)
Beispiel #38
0
def set_and_test_default_view(group_name, view, page):
    old_default = DefaultView.get_default_view(group_name)
    DefaultView.set_default_view(group_name, view)
    dest = 'All'
    if group_name == 'VMs':
        dest = 'VMsOnly'
    navigate_to(page, dest, use_resetter=False)

    assert tb.is_active(view), "{} view setting failed".format(view)
    DefaultView.set_default_view(group_name, old_default)
Beispiel #39
0
    def equal_drift_results(self, row_text, section, *indexes):
        """ Compares drift analysis results of a row specified by it's title text

        Args:
            row_text: Title text of the row to compare
            section: Accordion section where the change happened; this section must be activated
            indexes: Indexes of results to compare starting with 0 for first row (latest result).
                     Compares all available drifts, if left empty (default).

        Note:
            There have to be at least 2 drift results available for this to work.

        Returns:
            ``True`` if equal, ``False`` otherwise.
        """
        # mark by indexes or mark all
        navigate_to(self, 'Details')
        list_acc.select('Relationships',
            version.pick({
                version.LOWEST: 'Show host drift history',
                '5.4': 'Show Host drift history'}))
        if indexes:
            drift_table.select_rows_by_indexes(*indexes)
        else:
            # We can't compare more than 10 drift results at once
            # so when selecting all, we have to limit it to the latest 10
            if len(list(drift_table.rows())) > 10:
                drift_table.select_rows_by_indexes(*range(0, 10))
            else:
                drift_table.select_all()
        tb.select("Select up to 10 timestamps for Drift Analysis")

        # Make sure the section we need is active/open
        sec_loc_map = {
            'Properties': 'Properties',
            'Security': 'Security',
            'Configuration': 'Configuration',
            'My Company Tags': 'Categories'}
        active_sec_loc = "//div[@id='all_sections_treebox']//li[contains(@id, 'group_{}')]"\
            "/span[contains(@class, 'dynatree-selected')]".format(sec_loc_map[section])
        sec_checkbox_loc = "//div[@id='all_sections_treebox']//li[contains(@id, 'group_{}')]"\
            "//span[contains(@class, 'dynatree-checkbox')]".format(sec_loc_map[section])
        sec_apply_btn = "//div[@id='accordion']/a[contains(normalize-space(text()), 'Apply')]"

        # If the section is not active yet, activate it
        if not sel.is_displayed(active_sec_loc):
            sel.click(sec_checkbox_loc)
            sel.click(sec_apply_btn)

        if not tb.is_active("All attributes"):
            tb.select("All attributes")
        d_grid = DriftGrid()
        if any(d_grid.cell_indicates_change(row_text, i) for i in range(0, len(indexes))):
            return False
        return True
Beispiel #40
0
def test_exists_view(request, setup_a_provider, key):
    name = re.split(r"\/", key)
    button_name = name[0] + " Mode"
    default_view = get_default_view(button_name)
    set_exist_view(button_name)
    sel.force_navigate(name[1])
    Quadicon.select_first_quad()
    select_second_quad()
    tb.select(name[2], name[3])
    assert tb.is_active('Exists Mode'), "Exists view setting failed"
    reset_default_view(button_name, default_view)
def test_containers_providers_default_view(button_group, view):
    """ Containers Providers/Projects/Routes/Nodes/Containers/Replicators default view test
        This test checks successful change of default views settings for Containers -->
        Providers/Projects/Routes/Nodes/Containers/Replicators menu
        Steps:
            * Goes to Settings --> My Settings --> Default Views menu and change the default view
             settings of Containers --> Containers Providers/Projects/Routes/Nodes
             /Containers/Replicators
              to Grid/Tile/List view
            * Goes to Compute --> Containers --> Providers and verifies the selected view
        """
    DefaultView.set_default_view(button_group_name=button_group, default=view)
    navigate_to(mapping[button_group], 'All', use_resetter=False)
    assert tb.is_active(view), "{}'s {} setting failed".format(view, button_group)
Beispiel #42
0
    def equal_drift_results(self, row_text, section, *indexes):
        """ Compares drift analysis results of a row specified by it's title text

        Args:
            row_text: Title text of the row to compare
            section: Accordion section where the change happened; this section will be activated
            indexes: Indexes of results to compare starting with 0 for first row (latest result).
                     Compares all available drifts, if left empty (default).

        Note:
            There have to be at least 2 drift results available for this to work.

        Returns:
            ``True`` if equal, ``False`` otherwise.
        """
        # mark by indexes or mark all
        self.load_details(refresh=True)
        sel.click(InfoBlock("Properties", "Drift History"))
        if indexes:
            drift_table.select_rows_by_indexes(*indexes)
        else:
            # We can't compare more than 10 drift results at once
            # so when selecting all, we have to limit it to the latest 10
            if len(list(drift_table.rows())) > 10:
                drift_table.select_rows_by_indexes(*range(0, min(10, len)))
            else:
                drift_table.select_all()
        tb.select("Select up to 10 timestamps for Drift Analysis")

        # Make sure the section we need is active/open
        sec_apply_btn = "//div[@id='accordion']/a[contains(normalize-space(text()), 'Apply')]"

        # Deselect other sections
        for other_section in drift_section.child_items():
            drift_section.check_node(other_section.text)
            drift_section.uncheck_node(other_section.text)

        # Activate the required section
        drift_section.check_node(section)
        sel.click(sec_apply_btn)

        if not tb.is_active("All attributes"):
            tb.select("All attributes")
        drift_grid = DriftGrid()
        if any(
                drift_grid.cell_indicates_change(row_text, i)
                for i in range(0, len(indexes))):
            return False
        return True
Beispiel #43
0
    def equal_drift_results(self, row_text, section, *indexes):
        """ Compares drift analysis results of a row specified by it's title text

        Args:
            row_text: Title text of the row to compare
            section: Accordion section where the change happened; this section will be activated
            indexes: Indexes of results to compare starting with 0 for first row (latest result).
                     Compares all available drifts, if left empty (default).

        Note:
            There have to be at least 2 drift results available for this to work.

        Returns:
            ``True`` if equal, ``False`` otherwise.
        """
        # mark by indexes or mark all
        self.load_details(refresh=True)
        sel.click(InfoBlock("Properties", "Drift History"))
        if indexes:
            drift_table.select_rows_by_indexes(*indexes)
        else:
            # We can't compare more than 10 drift results at once
            # so when selecting all, we have to limit it to the latest 10
            if len(list(drift_table.rows())) > 10:
                drift_table.select_rows_by_indexes(*range(0, min(10, len)))
            else:
                drift_table.select_all()
        tb.select("Select up to 10 timestamps for Drift Analysis")

        # Make sure the section we need is active/open
        sec_apply_btn = "//div[@id='accordion']/a[contains(normalize-space(text()), 'Apply')]"

        # Deselect other sections
        for other_section in drift_section.child_items():
            drift_section.check_node(other_section.text)
            drift_section.uncheck_node(other_section.text)

        # Activate the required section
        drift_section.check_node(section)
        sel.click(sec_apply_btn)

        if not tb.is_active("All attributes"):
            tb.select("All attributes")
        drift_grid = DriftGrid()
        if any(drift_grid.cell_indicates_change(row_text, i) for i in range(0, len(indexes))):
            return False
        return True
Beispiel #44
0
def test_containers_providers_default_view(button_group, view):
    """ Containers Providers/Projects/Routes/Nodes/Containers/Replicators default view test
        This test checks successful change of default views settings for Containers -->
        Providers/Projects/Routes/Nodes/Containers/Replicators menu
        Steps:
            * Goes to Settings --> My Settings --> Default Views menu and change the default view
             settings of Containers --> Containers Providers/Projects/Routes/Nodes
             /Containers/Replicators
              to Grid/Tile/List view
            * Goes to Compute --> Containers --> Providers and verifies the selected view
        """
    sel.force_navigate('my_settings_default_views')
    bg = ButtonGroup(button_group)
    bg.choose(view)
    sel.click(form_buttons.save)
    sel.force_navigate(mapping[button_group])
    assert tb.is_active(view), "{}'s {} setting failed".format(view, button_group)
Beispiel #45
0
    def equal_drift_results(self, row_text, section, *indexes):
        """ Compares drift analysis results of a row specified by it's title text

        Args:
            row_text: Title text of the row to compare
            section: Accordion section where the change happened; this section will be activated
            indexes: Indexes of results to compare starting with 0 for first row (latest result).
                     Compares all available drifts, if left empty (default).

        Note:
            There have to be at least 2 drift results available for this to work.

        Returns:
            ``True`` if equal, ``False`` otherwise.
        """
        # mark by indexes or mark all
        self.load_details(refresh=True)
        sel.click(InfoBlock("Properties", "Drift History"))
        if indexes:
            drift_table.select_rows_by_indexes(*indexes)
        else:
            # We can't compare more than 10 drift results at once
            # so when selecting all, we have to limit it to the latest 10
            if len(list(drift_table.rows())) > 10:
                drift_table.select_rows_by_indexes(*range(0, min(10, len)))
            else:
                drift_table.select_all()
        tb.select("Select up to 10 timestamps for Drift Analysis")

        # Make sure the section we need is active/open
        sec_loc_map = {
            'Properties': 'Properties',
            'Security': 'Security',
            'Configuration': 'Configuration',
            'My Company Tags': 'Categories'}
        sec_loc_template = "//div[@id='all_sections_treebox']//li[contains(@id, 'group_{}')]" \
                           "//span[contains(@class, 'dynatree-checkbox')]"
        sec_checkbox_loc = "//div[@id='all_sections_treebox']//li[contains(@id, 'group_{}')]" \
            "//span[contains(@class, 'dynatree-checkbox')]".format(sec_loc_map[section])
        sec_apply_btn = "//div[@id='accordion']/a[contains(normalize-space(text()), 'Apply')]"

        # Deselect other sections
        for other_section in sec_loc_map.keys():
            other_section_loc = sec_loc_template.format(sec_loc_map[other_section])
            other_section_classes = sel.get_attribute(other_section_loc + '/..', "class")
            if other_section != section and 'dynatree-partsel' in other_section_classes:
                # Element needs to be checked out if it has no dynatree-selected
                if 'dynatree-selected' not in other_section_classes:
                    sel.click(other_section_loc)
                sel.click(other_section_loc)

        # Activate the required section
        sel.click(sec_checkbox_loc)
        sel.click(sec_apply_btn)

        if not tb.is_active("All attributes"):
            tb.select("All attributes")
        drift_grid = DriftGrid()
        if any(drift_grid.cell_indicates_change(row_text, i) for i in range(0, len(indexes))):
            return False
        return True
Beispiel #46
0
def test_report_view(create_report, view):
    create_report.navigate()
    tb.select(view)
    assert tb.is_active(view), "View setting failed for {}".format(view)
Beispiel #47
0
    def sections(self):
        """Dictionary of navigation elements.

        These can be either (nav destination name, section title) section tuples, or dictionary
        objects containing more section tuples.
        Keys are toplevel sections (the main tabs), values are a supertuple of secondlevel
        sections, or thirdlevel sections.
        You can also add a resetting callable that is called after clicking the second or third
        level.

        The main tab destination is usually the first secondlevel page in that tab
        Since this is redundant, it's arguable that the toplevel tabs should be
        nav destination at all; they're included here "just in case". The toplevel
        and secondlevel destinations exist at the same level of nav_tree because the
        secondlevel destinations don't depend on the toplevel nav taking place to reach
        their destination.
        """
        if version.current_version() < "5.6.0.1":
            sections = {
                ('cloud_intelligence', 'Cloud Intelligence'):
                (('dashboard', 'Dashboard'), ('reports', 'Reports'),
                 ('chargeback', 'Chargeback'), ('timelines',
                                                'Timelines'), ('rss', 'RSS')),
                ('services', 'Services'): (('my_services', 'My Services'),
                                           ('services_catalogs', 'Catalogs'),
                                           ('services_workloads', 'Workloads'),
                                           ('services_requests', 'Requests')),
                ('clouds', 'Clouds'):
                (('clouds_providers', 'Providers',
                  lambda: toolbar.select('Grid View')),
                 ('clouds_availability_zones', 'Availability Zones'),
                 ('clouds_tenants', 'Tenants'), ('clouds_flavors', 'Flavors'),
                 ('clouds_security_groups', 'Security Groups'),
                 ('clouds_instances', 'Instances',
                  self._tree_func_with_grid("Instances by Provider",
                                            "Instances by Provider")),
                 ('clouds_stacks', 'Stacks')),
                ('containers', 'Containers'):
                (('containers_providers', 'Providers'),
                 ('containers_projects', 'Projects'), ('containers_nodes',
                                                       'Container Nodes'),
                 ('containers_pods', 'Pods'), ('containers_routes', 'Routes'),
                 ('containers_replicators', 'Replicators'),
                 ('containers_services',
                  'Container Services'), ('containers_containers',
                                          'Containers'), ('containers_images',
                                                          'Container Images'),
                 ('containers_image_registries',
                  'Image Registries'), ('containers_topology', 'Topology')),
                ('infrastructure', 'Infrastructure'): (
                    ('infrastructure_providers', 'Providers',
                     lambda: toolbar.select('Grid View')),
                    ('infrastructure_clusters', "/ems_cluster"),
                    ('infrastructure_hosts', "/host"),
                    ('infrastructure_virtual_machines', 'Virtual Machines',
                     self._tree_func_with_grid("VMs & Templates",
                                               "All VMs & Templates")),
                    ('infrastructure_resource_pools', 'Resource Pools'),
                    ('infrastructure_datastores', 'Datastores'),
                    ('infrastructure_repositories', 'Repositories'),
                    ('infrastructure_pxe', 'PXE'),
                    ('infrastructure_requests', 'Requests'),
                ),
                ('control', 'Control'):
                (('control_explorer', 'Explorer'), ('control_simulation',
                                                    'Simulation'),
                 ('control_import_export', 'Import / Export'), ('control_log',
                                                                'Log')),
                ('automate', 'Automate'):
                (('automate_explorer', 'Explorer'), ('automate_simulation',
                                                     'Simulation'),
                 ('automate_customization', 'Customization'),
                 ('automate_import_export', 'Import / Export'),
                 ('automate_log', 'Log'), ('automate_requests', 'Requests')),
                ('optimize', 'Optimize'): (('utilization', 'Utilization'),
                                           ('planning', 'Planning'),
                                           ('bottlenecks', 'Bottlenecks')),
                ('configure', 'Configure'):
                (('my_settings', 'My Settings'), ('tasks', 'Tasks'),
                 ('configuration', 'Configuration'),
                 ('smartproxies', 'SmartProxies'), ('about', 'About')),
                ('__bogus', lambda: logger.error('Trying to enter an unsupported feature!')):
                (
                    ('middleware_providers',
                     _not_implemented('Middleware providers', '5.6')),
                    ('middleware_servers',
                     _not_implemented('Middleware servers', '5.6')),
                    ('middleware_deployments',
                     _not_implemented('Middleware deployments', '5.6')),
                    ('middleware_datasources',
                     _not_implemented('Middleware datasources', '5.6')),
                    ('middleware_topology',
                     _not_implemented('Middleware topology', '5.6')),
                )
            }
        else:
            sections = {
                ('cloud_intelligence', 'Cloud Intel'):
                (('dashboard', 'Dashboard'), ('reports', 'Reports'),
                 ('chargeback', 'Chargeback'), ('timelines',
                                                'Timelines'), ('rss', 'RSS')),
                ('services', 'Services'):
                (('my_services', 'My Services'), ('services_catalogs',
                                                  'Catalogs'),
                 ('services_workloads', 'Workloads'), ('services_requests',
                                                       'Requests')),
                ('compute', 'Compute'): {
                    ('clouds', 'Clouds'):
                    (('clouds_providers', 'Providers',
                      lambda: toolbar.select('Grid View')),
                     ('clouds_availability_zones',
                      'Availability Zones'), ('clouds_tenants', 'Tenants'),
                     ('clouds_flavors', 'Flavors'), ('clouds_security_groups',
                                                     'Security Groups'),
                     ('clouds_instances', 'Instances',
                      self._tree_func_with_grid("Instances by Provider",
                                                "Instances by Provider")),
                     ('clouds_stacks', 'Stacks')),
                    ('infrastructure', 'Infrastructure'): (
                        ('infrastructure_providers', 'Providers',
                         lambda: toolbar.select('Grid View')),
                        ('infrastructure_clusters', "/ems_cluster"),
                        ('infrastructure_hosts', "/host"),
                        ('infrastructure_virtual_machines', 'Virtual Machines',
                         self._tree_func_with_grid("VMs & Templates",
                                                   "All VMs & Templates")),
                        ('infrastructure_resource_pools', 'Resource Pools'),
                        ('infrastructure_datastores', 'Datastores'),
                        ('infrastructure_repositories', 'Repositories'),
                        ('infrastructure_pxe', 'PXE'),
                        ('infrastructure_requests', 'Requests'),
                        # ('infrastructure_config_management', 'Configuration Management')
                    ),
                    ('containers', 'Containers'):
                    (('containers_providers',
                      'Providers'), ('containers_projects', 'Projects'),
                     ('containers_nodes',
                      'Container Nodes'), ('containers_pods', 'Pods'),
                     ('containers_routes',
                      'Routes'), ('containers_replicators', 'Replicators'),
                     ('containers_services',
                      'Services'), ('containers_containers', 'Containers'),
                     ('containers_images', 'Container Images'),
                     ('containers_image_registries',
                      'Image Registries'), ('containers_topology',
                                            'Topology')),
                },
                ('n_configuration', 'Configuration'):
                (('infrastructure_config_management',
                  'Configuration Management'), ),
                ('middleware', 'Middleware'): (
                    ('middleware_providers', 'Providers',
                     lambda: toolbar.select('Grid View')
                     if not toolbar.is_active("Grid View") else None),
                    ('middleware_servers', 'Middleware Servers',
                     lambda: toolbar.select('List View')
                     if not toolbar.is_active("List View") else None),
                    ('middleware_deployments', 'Middleware Deployments',
                     lambda: toolbar.select('List View')
                     if not toolbar.is_active("List View") else None),
                    ('middleware_datasources', 'Middleware Datasources',
                     lambda: toolbar.select('List View')
                     if not toolbar.is_active("List View") else None),
                    ('middleware_topology', 'Topology'),
                ),
                ('control', 'Control'):
                (('control_explorer', 'Explorer'), ('control_simulation',
                                                    'Simulation'),
                 ('control_import_export', 'Import / Export'), ('control_log',
                                                                'Log')),
                ('automate', 'Automate'):
                (('automate_explorer', 'Explorer'), ('automate_simulation',
                                                     'Simulation'),
                 ('automate_customization', 'Customization'),
                 ('automate_import_export', 'Import / Export'),
                 ('automate_log', 'Log'), ('automate_requests', 'Requests')),
                ('optimize', 'Optimize'): (('utilization', 'Utilization'),
                                           ('planning', 'Planning'),
                                           ('bottlenecks', 'Bottlenecks')),
                ('configure', 'Settings'):
                (('my_settings', 'My Settings'), ('tasks', 'Tasks'),
                 ('configuration', 'Configuration'), ('about', 'About'))
            }
        return sections