예제 #1
0
    class module_streams(SatTab, SearchableViewMixin):
        TAB_NAME = 'Module Streams'
        status_filter = Select(
            locator='.//select[@ng-model="nutupaneParams.status"]')
        table = SatTable(
            locator='//table',
            column_widgets={
                'Name':
                Text('.//a'),
                'Actions':
                ActionDropdownWithCheckbox(
                    ".//div[contains(@class, 'dropdown')]")
            },
        )

        def search(self, query, status='All'):
            """Searches for Module Streams. Apply available filters before
            proceeding with searching. By default 'All' is passed

            :param str query: search query to type into search field.
            :param str optional status: filter by status of module stream on host
            :return: list of dicts representing table rows
            :rtype: list
            """
            if status is not None:
                self.status_filter.fill(status)
            self.searchbox.search(query)
            return self.table.read()
예제 #2
0
class HostCollectionManageModuleStreamsView(BaseLoggedInView, SearchableViewMixin):
    title = Text("//h4[contains(., 'Content Host Module Stream Management')]")
    table = SatTable(
        locator='//table',
        column_widgets={
            'Name': Text('.//a'),
            'Actions': ActionDropdownWithCheckbox(".//div[contains(@class, 'dropdown')]"),
        },
    )

    @property
    def is_displayed(self):
        """The view is displayed when it's title exists"""
        return self.browser.wait_for_element(self.title, exception=False) is not None