Ejemplo n.º 1
0
class DatabaseSummaryView(ServerDatabaseView):
    summary = ParametrizedSummaryTable()

    @property
    def is_displayed(self):
        return (self.summary.is_displayed and self.summary.is_active()
                and self.title.text == 'VMDB Summary')
Ejemplo n.º 2
0
class MyServiceGenericObjectInstanceView(BaseLoggedInPage):
    @View.nested
    class toolbar(View):    # noqa
        reload = Button(title=VersionPick({Version.lowest(): 'Reload current display',
                                           '5.9': 'Refresh this page'}))

        @ParametrizedView.nested
        class group(ParametrizedView):   # noqa
            PARAMETERS = ("group_name",)
            custom_button = Dropdown(text=ParametrizedString('{group_name}'))

        @ParametrizedView.nested
        class button(ParametrizedView):    # noqa
            PARAMETERS = ("button_name",)
            custom_button = Text(ParametrizedLocator('//button[contains(@id, "custom__custom") and'
                                                     ' normalize-space()={button_name|quote}]'))

    title = Text('//div[@id="main-content"]//h1')
    summary = ParametrizedSummaryTable()

    @property
    def is_displayed(self):
        return (
            self.title.text == self.context['object'].name
        )
Ejemplo n.º 3
0
    class ProviderDetailsSummaryView(View):
        """
        represents Details page when it is switched to Summary aka Tables view
        """
        summary = ParametrizedSummaryTable()
        sidebar = View.nested(SummaryAccordionView)

        @property
        def is_displayed(self):
            return self.summary("Properties").is_displayed
class GenericObjectDefinitionDetailsView(GenericObjectDefinitionView):
    title = Text('#explorer_title_text')
    configuration = Dropdown(text='Configuration')
    summary = ParametrizedSummaryTable()
    accordion = View.nested(AccordionForm)

    @property
    def is_displayed(self):
        return (self.in_generic_object_definition
                and self.title.text == 'Generic Object Class {}'.format(
                    self.context['object'].name))
Ejemplo n.º 5
0
class GenericObjectInstanceDetailsView(BaseLoggedInPage):
    @View.nested
    class toolbar(View):  # noqa
        policy = Dropdown(text='Policy')
        view_selector = View.nested(ItemsToolBarViewSelector)

    title = Text('//div[@id="main-content"]//h1')
    summary = ParametrizedSummaryTable()

    @property
    def is_displayed(self):
        return (self.title.text == '{} (Summary)'.format(
            self.context['object'].name))
Ejemplo n.º 6
0
class ContainerObjectDetailsBaseView(BaseLoggedInPage, LoggingableView):

    title = Text('//div[@id="main-content"]//h1')
    breadcrumb = BreadCrumb(locator='//ol[@class="breadcrumb"]')
    toolbar = View.nested(ProviderDetailsToolBar)
    entities = View.nested(ContainerObjectDetailsEntities)
    containers = StatusBox('Containers')
    services = StatusBox('Services')
    images = StatusBox('Images')
    summary = ParametrizedSummaryTable()
    SUMMARY_TEXT = None

    @View.nested
    class sidebar(ProviderSideBar):  # noqa

        @View.nested
        class properties(Accordion):  # noqa
            tree = ManageIQTree()

        @View.nested
        class relationships(Accordion):  # noqa
            tree = ManageIQTree()

    @property
    def is_displayed(self):
        return (
            self.title.is_displayed and
            self.breadcrumb.is_displayed and
            # We use 'in' for this condition because when we use search the
            # text will include include (Names with "...")
            '{} (Summary)'.format(self.context['object'].name) in self.breadcrumb.active_location
        )

    @property
    def summary_text(self):
        if isinstance(self.SUMMARY_TEXT, (string_types, type(None))):
            return self.SUMMARY_TEXT
        else:
            return self.SUMMARY_TEXT.pick(self.context['object'].appliance.version)
Ejemplo n.º 7
0
 class ProviderDetailsSummaryView(View):
     """
     represents Details page when it is switched to Summary aka Tables view
     """
     summary = ParametrizedSummaryTable()
Ejemplo n.º 8
0
class ContainerObjectDetailsEntities(View):
    summary = ParametrizedSummaryTable()
Ejemplo n.º 9
0
 class ProviderDetailsSummaryView(View):
     """
     represents Details page when it is switched to Summary aka Tables view
     """
     summary = ParametrizedSummaryTable()
     sidebar = View.nested(SummaryAccordionView)