def test_data_integrity_for_topology(test_data):
    """ This test verifies that every status box value under Containers Overview is identical to the
    number present on its page.
    Steps:
        * Go to Containers / Overview
        * All cells should contain the correct relevant information
            # of nodes
            # of providers
            # ...
    """
    section_values = {}
    sel.force_navigate('container_dashboard')
    # We should wait ~2 seconds for the StatusBox population
    # (until we find a better solution)
    time.sleep(2)
    status_box = StatusBox(test_data[2])
    section_values[test_data[0]] = int(status_box.value())
    sel.force_navigate(test_data[1])
    if section_values[test_data[0]] > 0:
        if test_data[0] is Provider:
            assert len(map(lambda i: i, Quadicon.all())) == section_values[test_data[0]]
        else:
            assert len(map(lambda r: r, test_data[3].rows())
                       ) == section_values[test_data[0]]
    else:
        assert sel.is_displayed_text('No Records Found.')
def test_data_integrity_for_topology(test_data):
    """ This test verifies that every status box value under Containers Overview is identical to the
    number present on its page.
    """
    navigate_to(ContainersOverview, 'All')
    # We should wait ~2 seconds for the StatusBox population
    # (until we find a better solution)
    time.sleep(2)
    status_box = StatusBox(test_data.name)
    statusbox_value = int(status_box.value())
    navigate_to(test_data.object, 'All')
    if statusbox_value > 0:
        tb.select('Grid View')
        try:
            ensure_no_filter_applied()
        except NoSuchElementException:
            pass
        assert len(list(Quadicon.all())) == statusbox_value
    else:
        assert sel.is_displayed_text('No Records Found.')
def test_data_integrity_for_topology(test_data):
    """ This test verifies that every status box value under Containers Overview is identical to the
    number present on its page.
    Steps:
        * Go to Containers / Overview
        * All cells should contain the correct relevant information
            # of nodes
            # of providers
            # ...
    """
    sel.force_navigate('container_dashboard')
    # We should wait ~2 seconds for the StatusBox population
    # (until we find a better solution)
    time.sleep(2)
    status_box = StatusBox(test_data.name)
    statusbox_value = int(status_box.value())
    navigate_to(test_data.object, 'All')
    if statusbox_value > 0:
        tb.select('Grid View')
        assert len(map(lambda i: i, Quadicon.all())) == statusbox_value
    else:
        assert sel.is_displayed_text('No Records Found.')