Пример #1
0
class ContainerDetailsView(BaseLoggedInView):
    breadcrumb = BreadCrumb()

    @property
    def is_displayed(self):
        breadcrumb_loaded = self.browser.wait_for_element(self.breadcrumb,
                                                          exception=False)
        return (breadcrumb_loaded
                and self.breadcrumb.locations[0] == 'All Containers')

    commit = Button('Commit')
    power_on = Button('Power On')
    power_off = Button('Power Off')
    delete = Button('Delete')
    properties = SatTableWithUnevenStructure(
        ".//table[@id='properties_table']")
Пример #2
0
 class properties(SatTab):
     properties_table = SatTableWithUnevenStructure(
         locator="//table[@id='properties_table']")
Пример #3
0
class RepositoryEditView(BaseLoggedInView):
    breadcrumb = BreadCrumb()
    actions = ActionsDropdown("//div[contains(@class, 'btn-group')]")
    dialog = ConfirmationDialog()
    name = EditableEntry(name='Name')
    label = ReadOnlyEntry(name='Label')
    repo_type = ReadOnlyEntry(name='Type')
    repo_content = ConditionalSwitchableView(reference='repo_type')
    content_counts = SatTableWithUnevenStructure(
        locator='.//table[//th[normalize-space(.)="Content Type"]]',
        column_locator='./*'
    )

    @repo_content.register('docker')
    class DockerRepository(View):
        registry_url = EditableEntry(name='Registry URL')
        upstream_repo_name = EditableEntry(name='Upstream Repository')
        repo_name = ReadOnlyEntry(name='Name')
        verify_ssl = EditableEntryCheckbox(name='Verify SSL')
        upstream_authorization = AuthorizationEntry(
            name='Upstream Authorization')
        publish_via_http = EditableEntryCheckbox(name='Publish via HTTP')
        http_proxy_policy = EditableEntrySelect(name='HTTP Proxy')
        proxy_policy = ConditionalSwitchableView(reference='http_proxy_policy')

        @proxy_policy.register(True, default=True)
        class NoSpecificHttpProxy(View):
            pass

    @repo_content.register('yum')
    class YumRepository(View):
        arch_restrict = EditableEntrySelect(name='Restrict to architecture')
        upstream_url = EditableEntry(name='Upstream URL')
        verify_ssl = EditableEntryCheckbox(name='Verify SSL')
        upstream_authorization = AuthorizationEntry(
            name='Upstream Authorization')
        metadata_type = EditableEntrySelect(name='Yum Metadata Checksum')
        mirror_on_sync = EditableEntryCheckbox(name='Mirror on Sync')
        publish_via_http = EditableEntryCheckbox(name='Publish via HTTP')
        gpg_key = EditableEntrySelect(name='GPG Key')
        download_policy = EditableEntrySelect(name='Download Policy')
        upload_content = FileInput(name='content[]')
        upload = Text("//button[contains(., 'Upload')]")
        http_proxy_policy = EditableEntrySelect(name='HTTP Proxy')
        proxy_policy = ConditionalSwitchableView(reference='http_proxy_policy')

        @proxy_policy.register(True, default=True)
        class NoSpecificHttpProxy(View):
            pass

    @repo_content.register('puppet')
    class PuppetRepository(View):
        upstream_url = EditableEntry(name='Upstream URL')
        verify_ssl = EditableEntryCheckbox(name='Verify SSL')
        upstream_authorization = AuthorizationEntry(
            name='Upstream Authorization')
        mirror_on_sync = EditableEntryCheckbox(name='Mirror on Sync')
        publish_via_https = ReadOnlyEntry(name='Publish via HTTPS')
        publish_via_http = EditableEntryCheckbox(name='Publish via HTTP')
        published_at = ReadOnlyEntry(name='Published At')
        upload_content = FileInput(name='content[]')
        upload = Text("//button[contains(., 'Upload')]")
        http_proxy_policy = EditableEntrySelect(name='HTTP Proxy')
        proxy_policy = ConditionalSwitchableView(reference='http_proxy_policy')

        @proxy_policy.register(True, default=True)
        class NoSpecificHttpProxy(View):
            pass

    @repo_content.register('ostree')
    class OstreeRepository(View):
        upstream_url = EditableEntry(name='Upstream URL')
        verify_ssl = EditableEntryCheckbox(name='Verify SSL')
        upstream_authorization = AuthorizationEntry(
            name='Upstream Authorization')
        publish_via_https = ReadOnlyEntry(name='Publish via HTTPS')
        published_at = ReadOnlyEntry(name='Published At')
        http_proxy_policy = EditableEntrySelect(name='HTTP Proxy')
        proxy_policy = ConditionalSwitchableView(reference='http_proxy_policy')

        @proxy_policy.register(True, default=True)
        class NoSpecificHttpProxy(View):
            pass

    @property
    def is_displayed(self):
        breadcrumb_loaded = self.browser.wait_for_element(
            self.breadcrumb, exception=False)
        return (
            breadcrumb_loaded
            and self.breadcrumb.locations[0] == 'Products'
            # repositories do not have tabs, so if we are deep inside some
            # specific repository (e.g. in repository packages) - there's no
            # turn back, so we can't treat any level deeper than repository
            # details like details' sub-tab
            and self.breadcrumb.locations[-2] == 'Repositories'
            and self.breadcrumb.read() != 'New Repository'
        )
Пример #4
0
 class details(SatTab):
     details_table = SatTableWithUnevenStructure(
         locator='.//table',
         column_locator='./*')