예제 #1
0
def set_grid_view(name):
    bg = ButtonGroup(name)
    sel.force_navigate("my_settings_default_views")
    default_view = bg.active
    if(default_view != 'Grid View'):
        bg.choose('Grid View')
        sel.click(form_buttons.save)
예제 #2
0
def set_default_view(button_group_name, view):
    bg = ButtonGroup(button_group_name)
    sel.force_navigate("my_settings_default_views")
    default_view = bg.active
    if (default_view != view):
        bg.choose(view)
        sel.click(form_buttons.save)
예제 #3
0
def set_grid_view(name):
    bg = ButtonGroup(name)
    sel.force_navigate("my_settings_default_views")
    default_view = bg.active
    if(default_view != 'Grid View'):
        bg.choose('Grid View')
        sel.click(form_buttons.save)
예제 #4
0
def set_default_view(button_group_name, view):
    bg = ButtonGroup(button_group_name)
    sel.force_navigate("my_settings_default_views")
    default_view = bg.active
    if(default_view != view):
        bg.choose(view)
        sel.click(form_buttons.save)
예제 #5
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)
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
        """
    navigate_to(Server, 'MySettings')
    tabs.select_tab("Default Views")
    bg = ButtonGroup(button_group)
    if not bg.active == str(view):
        bg.choose(view)
        sel.click(form_buttons.save)
    navigate_to(mapping[button_group], 'All', use_resetter=False)
    assert tb.is_active(view), "{}'s {} setting failed".format(view, button_group)
예제 #7
0
    def set_default_view(cls, button_group_names, defaults, fieldset=None):

        """This function sets default views for the objects.
        Args:
            * button_group_names: either the name of the button_group_name
                                  or list of the button groups to set the
                                  default view for.
            * default: the default view to set. in case that button_group_names
                       is a list, you can either set 1 view and it'll be set
                       for all the button_group_names or you can use a list
                       (default view per button_group_name).
        Examples:
            * set_default_view('Containers Providers, 'List View') --> set
              'List View' default view to 'Containers Providers'
            * set_default_view(['Images', 'Projects', 'Routes'], 'Tile View')
              --> set 'Tile View' default view to 'Images', 'Projects' and 'Routes'
            * set_default_view(['Images', 'Projects', 'Routes'],
                               ['Tile View', 'Tile View', 'Grid View']) -->
              set 'Tile View' default view to 'Images' and 'Projects' and 'Grid View'
              default view to 'Routes'
        """

        if not isinstance(button_group_names, (list, tuple)):
            button_group_names = [button_group_names]
        if not isinstance(defaults, (list, tuple)):
            defaults = [defaults] * len(button_group_names)
        assert len(button_group_names) == len(defaults)

        is_something_changed = False
        for button_group_name, default in zip(button_group_names, defaults):
            bg = ButtonGroup(button_group_name, fieldset=fieldset)
            navigate_to(cls, 'All')
            if bg.active != default:
                bg.choose(default)
                is_something_changed = True

        if is_something_changed:
            sel.click(form_buttons.save)
예제 #8
0
def set_exist_view(name):
    bg = ButtonGroup(name)
    if bg.active != 'Exists Mode':
        bg.choose('Exists Mode')
        sel.click(form_buttons.save)
예제 #9
0
def set_details_view(name):
    bg = ButtonGroup(name)
    if bg.active != 'Details Mode':
        bg.choose('Details Mode')
        sel.click(form_buttons.save)
예제 #10
0
def set_compressed_view(name):
    bg = ButtonGroup(name)
    if bg.active != 'Compressed View':
        bg.choose('Compressed View')
        sel.click(form_buttons.save)
예제 #11
0
def set_expanded_view(name):
    bg = ButtonGroup(name)
    if bg.active != 'Expanded View':
        bg.choose('Expanded View')
        sel.click(form_buttons.save)
예제 #12
0
def set_grid_view(name):
    bg = ButtonGroup(name)
    if bg.active != 'Grid View':
        bg.choose('Grid View')
        sel.click(form_buttons.save)
예제 #13
0
def set_list_view(name):
    bg = ButtonGroup(name)
    if bg.active != 'List View':
        bg.choose('List View')
        sel.click(form_buttons.save)
예제 #14
0
def set_tile_view(name):
    bg = ButtonGroup(name)
    if bg.active != 'Tile View':
        bg.choose('Tile View')
        sel.click(form_buttons.save)
예제 #15
0
def reset_default_view(name, default_view):
    bg = ButtonGroup(name)
    sel.force_navigate("my_settings_default_views")
    if bg.active != default_view:
        bg.choose(default_view)
        sel.click(form_buttons.save)
예제 #16
0
 def set_default_view(cls, button_group_name, default):
     bg = ButtonGroup(button_group_name)
     navigate_to(cls, 'All')
     if bg.active != default:
         bg.choose(default)
         sel.click(form_buttons.save)
예제 #17
0
 def get_default_view(cls, button_group_name, fieldset=None):
     bg = ButtonGroup(button_group_name, fieldset=fieldset)
     navigate_to(cls, 'All')
     return bg.active
예제 #18
0
def get_default_view(name):
    bg = ButtonGroup(name)
    pytest.sel.force_navigate("my_settings_default_views")
    default_view = bg.active
    return default_view
def set_view(group, button):
    bg = ButtonGroup(group)
    if bg.active != button:
        bg.choose(button)
        sel.click(form_buttons.save)