示例#1
0
    def delete(self, from_dest='All'):
        """
        Delete the stack, starting from the destination provided by from_dest
        @param from_dest: where to delete from, a valid navigation destination for Stack
        """

        # Navigate to the starting destination
        if from_dest in navigator.list_destinations(self):
            navigate_to(self, from_dest)
        else:
            msg = 'cfme.cloud.stack does not have destination {}'.format(
                from_dest)
            raise DestinationNotFound(msg)

        # Delete using the method appropriate for the starting destination
        if from_dest == 'All':
            sel.check(Quadicon(self.name, self.quad_name).checkbox())
            cfg_btn("Remove Orchestration Stacks", invokes_alert=True)
        elif from_dest == 'Details':
            cfg_btn("Remove this Orchestration Stack", invokes_alert=True)

        sel.handle_alert()
        # The delete initiated message may get missed if the delete is fast
        try:
            flash.assert_message_contain(
                "Delete initiated for 1 Orchestration Stacks")
        except FlashMessageException as ex:
            if 'No flash message contains' in ex.message:
                flash.assert_message_contain(
                    "The selected Orchestration Stacks was deleted")

        self.wait_for_delete()
示例#2
0
    def delete(self, from_dest='All'):
        """
        Delete the catalog, starting from the destination provided by from_dest
        Throws cfme.DestinationNotFound exception

        :param from_dest: A valid navigation destination to start the delete from
        :return: none
        """
        if from_dest in navigator.list_destinations(self):
            navigate_to(self, from_dest)
        else:
            msg = 'cfme.services.catalogs.catalog does not have destination {}'.format(from_dest)
            raise DestinationNotFound(msg)

        # Delete using the appropriate method
        if from_dest == 'All':
            # Select the row to delete, assuming default List View for All
            listview_table.select_row_by_cells({'Name': self.name, 'Description': self.description})
            cfg_btn(version.pick({version.LOWEST: 'Remove Items from the VMDB',
                    '5.7': 'Remove Catalog Items'}), invokes_alert=True)
        elif from_dest == 'Details':
            cfg_btn(version.pick({version.LOWEST: 'Remove Item from the VMDB',
                    '5.7': 'Remove Catalog'}), invokes_alert=True)

        sel.handle_alert()
        flash.assert_success_message(
            'Catalog "{}": Delete successful'.format(self.description or self.name))
示例#3
0
    def delete(self, from_dest='All'):
        """
        Delete the stack, starting from the destination provided by from_dest
        @param from_dest: where to delete from, a valid navigation destination for Stack
        """

        # Navigate to the starting destination
        if from_dest in navigator.list_destinations(self):
            navigate_to(self, from_dest)
        else:
            msg = 'cfme.cloud.stack does not have destination {}'.format(from_dest)
            raise DestinationNotFound(msg)

        # Delete using the method appropriate for the starting destination
        if from_dest == 'All':
            sel.check(Quadicon(self.name, self.quad_name).checkbox())
            cfg_btn("Remove Orchestration Stacks", invokes_alert=True)
        elif from_dest == 'Details':
            cfg_btn("Remove this Orchestration Stack", invokes_alert=True)

        sel.handle_alert()
        # The delete initiated message may get missed if the delete is fast
        try:
            flash.assert_message_contain("Delete initiated for 1 Orchestration Stacks")
        except FlashMessageException as ex:
            if 'No flash message contains' in ex.message:
                flash.assert_message_contain("The selected Orchestration Stacks was deleted")

        self.wait_for_delete()
示例#4
0
 def delete(self, from_dest='All'):
     if from_dest in navigator.list_destinations(self):
         navigate_to(self, from_dest)
     else:
         msg = 'cfme.services.catalogs.catalog_item does not have destination {}'\
             .format(from_dest)
         raise DestinationNotFound(msg)
     if from_dest == 'All':
         # select the row for deletion
         listview_table.select_row_by_cells({'Name': self.name,
                                             'Description': self.description})
         cfg_btn(version.pick({version.LOWEST: 'Remove Items from the VMDB',
             '5.7': 'Remove Catalog Items'}), invokes_alert=True)
     if from_dest == 'Details':
         cfg_btn(version.pick({version.LOWEST: 'Remove Item from the VMDB',
             '5.7': 'Remove Catalog Item'}), invokes_alert=True)
     sel.handle_alert()
     flash.assert_success_message(version.pick(
         {version.LOWEST: 'The selected 1 Catalog Item were deleted',
             '5.7': 'The selected 1 Catalog Item was deleted'}))
示例#5
0
    def delete(self, from_dest='All'):
        """Delete the stack, starting from the destination provided by from_dest"""
        # Navigate to the starting destination
        if from_dest in navigator.list_destinations(self):
            view = navigate_to(self, from_dest)
        else:
            msg = 'cfme.cloud.stack does not have destination {}'.format(from_dest)
            raise DestinationNotFound(msg)

        # Delete using the method appropriate for the starting destination
        if from_dest == 'All':
            view.toolbar.view_selector.select('List View')
            try:
                row = view.paginator.find_row_on_pages(view.entities.table, name=self.name)
                row[0].check()
                view.toolbar.configuration.item_select('Remove Orchestration Stacks',
                                                       handle_alert=True)
            except NoSuchElementException:
                raise StackNotFound('Stack {} not found'.format(self.name))
            view.entities.flash.assert_no_error()
            view.entities.flash.assert_success_message(
                'Delete initiated for 1 Orchestration Stacks from the CFME Database')
        elif from_dest == 'Details':
            view.toolbar.configuration.item_select('Remove this Orchestration Stack',
                                                   handle_alert=True)
            view.entities.flash.assert_no_error()
            view.entities.flash.assert_success_message('Delete initiated for 1 Orchestration Stack')

        def refresh():
            """Refresh the view"""
            if self.provider:
                self.provider.refresh_provider_relationships()
            view.browser.selenium.refresh()
            view.flush_widget_cache()

        wait_for(lambda: not self.exists, fail_condition=False, fail_func=refresh, num_sec=15 * 60,
                 delay=30, message='Wait for stack to be deleted')