Пример #1
0
def test_tag_item_through_selecting(request, location, tag):
    """Add a tag to an item with going through the details page.

    Prerequisities:
        * Have a tag category and tag created.
        * Be on the page you want to test.

    Steps:
        * Select any quadicon.
        * Select ``Policy/Edit Tags`` and assign the tag to it.
        * Click on the quadicon and verify the tag is assigned. (TODO)
        * Go back to the quadicon view and select ``Policy/Edit Tags`` and remove the tag.
        * Click on the quadicon and verify the tag is not present. (TODO)
    """
    pytest.sel.force_navigate(location)
    tb.select('Grid View')
    if not Quadicon.any_present():
        pytest.skip("No Quadicon present, cannot test.")
    Quadicon.select_first_quad()

    def _delete():
        pytest.sel.force_navigate(location)
        tb.select('Grid View')
        Quadicon.select_first_quad()
        mixins.remove_tag(tag)
    request.addfinalizer(lambda: diaper(_delete))
    mixins.add_tag(tag)
    _delete()
Пример #2
0
 def exists(self):
     """Returns whether the manager exists in the UI or not"""
     sel.force_navigate('infrastructure_config_managers')
     if (Quadicon.any_present() and
             Quadicon('{} Configuration Manager'.format(self.name), None).exists):
         return True
     return False
Пример #3
0
 def exists(self):
     """Returns whether the manager exists in the UI or not"""
     navigate_to(self, 'All')
     if (Quadicon.any_present() and
             Quadicon(self.quad_name, None).exists):
         return True
     return False
Пример #4
0
def test_tag_item_through_details(request, location, tag):
    """Add a tag to an item with going through the details page.

    Prerequisities:
        * Have a tag category and tag created.
        * Be on the page you want to test.

    Steps:
        * Click any quadicon.
        * On the details page, select ``Policy/Edit Tags`` and assign the tag to it.
        * Verify the tag is assigned. (TODO)
        * Select ``Policy/Edit Tags`` and remove the tag.
        * Verify the tag is not present. (TODO)
    """
    pytest.sel.force_navigate(location)
    tb.select('Grid View')
    if not Quadicon.any_present():
        pytest.skip("No Quadicon present, cannot test.")
    pytest.sel.click(Quadicon.first())
    request.addfinalizer(lambda: diaper(lambda: mixins.remove_tag(tag)))
    mixins.add_tag(tag)
    mixins.remove_tag(tag)
Пример #5
0
def _navigate_and_check(location):
    navigate_to(param_classes[location], 'All')
    tb.select('Grid View')
    return Quadicon.any_present()
Пример #6
0
 def exists(self):
     """Returns whether the manager exists in the UI or not"""
     navigate_to(self, 'All')
     if (Quadicon.any_present() and Quadicon(self.quad_name, None).exists):
         return True
     return False