Beispiel #1
0
class CreateYumFilterView(BaseLoggedInView):
    breadcrumb = BreadCrumb()

    name = TextInput(id='name')
    content_type = Select(id='type')
    inclusion_type = Select(id='inclusion')
    description = TextInput(id='description')

    save = Text('.//button[contains(@ng-click, "handleSave()")]')
    cancel = Text('.//button[@ng-click="handleCancel()"]')

    @property
    def is_displayed(self):
        breadcrumb_loaded = self.browser.wait_for_element(self.breadcrumb,
                                                          exception=False)
        return (breadcrumb_loaded
                and self.breadcrumb.locations[0] == 'Content Views'
                and self.breadcrumb.read() == 'Create Yum Filter')
Beispiel #2
0
class SCAPContentEditView(SCAPContentCreateView):
    scap_file_name = Text('//div[@class="col-md-4"]/b')
    breadcrumb = BreadCrumb()

    @View.nested
    class file_upload(SatTab):
        TAB_NAME = 'File Upload'
        title = TextInput(id='scap_content_title')
        uploaded_scap_file = Text(
            locator="//label[@for='scap_file']/following-sibling::div/b")
        scap_file = FileInput(id='scap_content_scap_file')

    @property
    def is_displayed(self):
        breadcrumb_loaded = self.browser.wait_for_element(self.breadcrumb,
                                                          exception=False)
        return (breadcrumb_loaded
                and self.breadcrumb.locations[0] == 'Scap Contents')
Beispiel #3
0
class ActivationKeyCreateView(BaseLoggedInView):
    breadcrumb = BreadCrumb()
    name = TextInput(id='name')
    hosts_limit = LimitInput()
    description = TextInput(id='description')
    lce = ParametrizedView.nested(LCESelectorGroup)
    content_view = Select(id='content_view_id')
    submit = Text("//button[contains(@ng-click, 'handleSave')]")

    @property
    def is_displayed(self):
        breadcrumb_loaded = self.browser.wait_for_element(
            self.breadcrumb, exception=False)
        return (
                breadcrumb_loaded
                and self.breadcrumb.locations[0] == 'Activation Keys'
                and self.breadcrumb.read() == 'New Activation Key'
        )
Beispiel #4
0
class PuppetClassDetailsView(BaseLoggedInView):
    breadcrumb = BreadCrumb()
    submit = Text('//input[@name="commit"]')

    @property
    def is_displayed(self):
        breadcrumb_loaded = self.browser.wait_for_element(
            self.breadcrumb, exception=False)
        return (
            breadcrumb_loaded
            and self.breadcrumb.locations[0] == 'Puppetclasses'
            and self.breadcrumb.read().starts_with('Edit Puppet Class ')
        )

    @View.nested
    class puppet_class(SatTab):
        TAB_NAME = 'Puppet Class'
        # Name field is disabled by default
        name = TextInput(id='puppetclass_name')
        # Puppet environment field is disabled by default
        puppet_environment = TextInput(id='puppetclass_environments')
        host_group = MultiSelect(id='ms-puppetclass_hostgroup_ids')

    @View.nested
    class smart_class_parameter(SatTab):
        TAB_NAME = 'Smart Class Parameter'
        filter = TextInput(locator="//input[@placeholder='Filter by name']")
        environment_filter = FilteredDropdown(id='environment_filter')
        parameter_list = ItemsList(
            "//div[@id='smart_class_param']"
            "//ul[contains(@class, 'smart-var-tabs')]"
        )
        parameter = SmartClassParameterContent(
            locator="//div[@id='smart_class_param']"
                    "//div[@class='tab-pane fields active']"
        )

    @View.nested
    class smart_variables(SatTab):
        TAB_NAME = 'Smart Variables'
        variable = SmartVariableContent(
            locator="//div[@id='smart_vars']"
                    "//div[@class='tab-pane fields active']"
        )
Beispiel #5
0
class ContentViewVersionDetailsView(BaseLoggedInView):
    breadcrumb = BreadCrumb()

    @property
    def is_displayed(self):
        breadcrumb_loaded = self.browser.wait_for_element(self.breadcrumb, exception=False)
        return (
            breadcrumb_loaded
            and len(self.breadcrumb.locations) > 3
            and self.breadcrumb.locations[0] == 'Content Views'
            and self.breadcrumb.locations[2] == 'Versions'
        )

    @View.nested
    class yum_repositories(SatSecondaryTab, SearchableViewMixin):
        TAB_NAME = 'Yum Repositories'
        table = Table('.//table')

    @View.nested
    class docker_repositories(SatSecondaryTab, SearchableViewMixin):
        TAB_NAME = 'Docker Repositories'
        table = Table('.//table')

    @View.nested
    class rpm_packages(EntitySearchView):
        TAB_NAME = 'rpm Packages'

    @View.nested
    class module_streams(EntitySearchView):
        TAB_NAME = 'Module Streams'

    @View.nested
    class errata(SatSecondaryTab, SearchableViewMixin):
        table = Table(locator='.//table', column_widgets={'Title': Text('./a')})

    @View.nested
    class puppet_modules(SatSecondaryTab, SearchableViewMixin):
        TAB_NAME = 'Puppet Modules'
        table = Table('.//table')

    @View.nested
    class details(SatSecondaryTab):
        description = ReadOnlyEntry(name='Description')
        environments = ReadOnlyEntry(name='Environments')
Beispiel #6
0
class OperatingSystemEditView(BaseLoggedInView):
    breadcrumb = BreadCrumb()
    submit = Text('//input[@name="commit"]')

    @property
    def is_displayed(self):
        breadcrumb_loaded = self.browser.wait_for_element(
            self.breadcrumb, exception=False)
        return (
            breadcrumb_loaded
            and self.breadcrumb.locations[0] == 'Operating Systems'
            and self.breadcrumb.read().startswith('Edit ')
        )

    @View.nested
    class operating_system(SatTab):
        TAB_NAME = 'Operating System'
        name = TextInput(locator=".//input[@id='operatingsystem_name']")
        major = TextInput(locator=".//input[@id='operatingsystem_major']")
        minor = TextInput(locator=".//input[@id='operatingsystem_minor']")
        description = TextInput(
            locator=".//input[@id='operatingsystem_description']")
        family = FilteredDropdown(id='operatingsystem_family')
        password_hash = FilteredDropdown(id='operatingsystem_password_hash')
        architectures = MultiSelect(id='ms-operatingsystem_architecture_ids')

    @View.nested
    class partition_table(SatTab):
        TAB_NAME = 'Partition Table'
        resources = MultiSelect(id='ms-operatingsystem_ptable_ids')

    @View.nested
    class installation_media(SatTab):
        TAB_NAME = 'Installation Media'
        resources = MultiSelect(id='ms-operatingsystem_medium_ids')

    @View.nested
    class templates(SatTab):
        resources = TemplatesList()

    @View.nested
    class parameters(SatTab):
        TAB_NAME = 'Parameters'
        os_params = CustomParameter(id='global_parameters_table')
Beispiel #7
0
class UserGroupDetailsView(BaseLoggedInView):
    breadcrumb = BreadCrumb()
    submit = Text('//input[@name="commit"]')

    @property
    def is_displayed(self):
        breadcrumb_loaded = self.browser.wait_for_element(self.breadcrumb,
                                                          exception=False)
        return (breadcrumb_loaded
                and self.breadcrumb.locations[0] == 'User Groups'
                and self.breadcrumb.read().startswith('Edit '))

    @View.nested
    class usergroup(SatTab):
        TAB_NAME = "User Group"

        name = TextInput(id='usergroup_name')
        usergroups = MultiSelect(id='ms-usergroup_usergroup_ids')
        users = MultiSelect(id='ms-usergroup_user_ids')

    @View.nested
    class roles(SatTab):
        admin = Checkbox(id='usergroup_admin')
        resources = MultiSelect(id='ms-usergroup_role_ids')

    @View.nested
    class external_groups(SatTab):
        TAB_NAME = 'External Groups'
        table = Table('.//table',
                      column_widgets={
                          'Actions': Text('.//a[contains(@href, "refresh")]'),
                      })

        add_external_user_group = Text(
            './/a[@data-association="external_usergroups"]')
        name = TextInput(locator=(
            "(//input[starts-with(@name, 'usergroup[external_usergroups_attributes]')]"
            "[contains(@name, '[name]')])[last()]"))
        auth_source = FilteredDropdown(locator=(
            "//div[starts-with(@id, 's2id_usergroup_external_usergroups_attributes')]"
            "[contains(@id, 'auth_source_id')]"))

        def before_fill(self, values):
            self.add_external_user_group.click()
Beispiel #8
0
class PartitionTableEditView(BaseLoggedInView):
    breadcrumb = BreadCrumb()
    submit = Text('//input[@name="commit"]')

    @View.nested
    class template(SatTab):
        name = TextInput(id='ptable_name')
        default = Checkbox(id='ptable_default')
        snippet = Checkbox(locator="//input[@id='ptable_snippet']")
        os_family_selection = ConditionalSwitchableView(reference='snippet')

        @os_family_selection.register(True)
        class SnippetOption(View):
            pass

        @os_family_selection.register(False)
        class OSFamilyOption(View):
            os_family = FilteredDropdown(id='s2id_ptable_os_family')

        template_editor = ACEEditor()
        audit_comment = TextInput(id='ptable_audit_comment')

    @View.nested
    class inputs(RemovableWidgetsItemsListView, SatTab):
        ITEMS = ".//div[contains(@class, 'template_inputs')]/following-sibling::div"
        ITEM_WIDGET_CLASS = TemplateInputItem
        add_item_button = Text(".//a[@data-association='template_inputs']")

    @View.nested
    class locations(SatTab):
        resources = MultiSelect(id='ms-ptable_location_ids')

    @View.nested
    class organizations(SatTab):
        resources = MultiSelect(id='ms-ptable_organization_ids')

    @property
    def is_displayed(self):
        breadcrumb_loaded = self.browser.wait_for_element(self.breadcrumb, exception=False)
        return (
            breadcrumb_loaded
            and self.breadcrumb.locations[0] == 'Partition Tables'
            and self.breadcrumb.read().startswith('Edit ')
        )
Beispiel #9
0
class ProductCreateView(BaseLoggedInView):
    breadcrumb = BreadCrumb()
    name = TextInput(id='name')
    label = TextInput(id='label')
    gpg_key = Select(id='gpg_key_id')
    ssl_ca_cert = Select(id='ssl_ca_cert_id')
    ssl_client_cert = Select(id='ssl_client_cert_id')
    ssl_client_key = Select(id='ssl_client_key_id')
    sync_plan = Select(id='sync_plan_id')
    description = TextInput(id='description')
    submit = Text("//button[contains(@ng-click, 'handleSave')]")

    @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'
                and self.breadcrumb.read() == 'New Product')
Beispiel #10
0
class ReportTemplateGenerateView(BaseLoggedInView):
    breadcrumb = BreadCrumb()
    email = Checkbox(id='report_template_report_send_mail')
    email_to = TextInput(id='report_template_report_mail_to')
    inputs = TextInputsGroup(locator='.//form')
    output_format = FilteredDropdown(id='s2id_report_template_report_format')
    hosts_filter = TextInput(locator='//input[contains(@class,"search-input")]')
    generate_at = TextInput(id='report_template_report_generate_at')
    submit = Text('//input[@name="commit"]')
    generated = Text('//div[contains(@class, "alert-success")]')

    @property
    def is_displayed(self):
        breadcrumb_loaded = self.browser.wait_for_element(self.breadcrumb, exception=False)
        return (
            breadcrumb_loaded
            and self.breadcrumb.locations[0] == 'Report Templates'
            and self.breadcrumb.read() == 'Generate a Report'
        )
Beispiel #11
0
class TrendEditView(BaseLoggedInView):
    breadcrumb = BreadCrumb()
    table = Table(
        './/table',
        column_widgets={
            'Display Name': TextInput(locator=".//input[@type='text']"),
        }
    )
    submit = Text('//input[@name="commit"]')

    @property
    def is_displayed(self):
        breadcrumb_loaded = self.browser.wait_for_element(
            self.breadcrumb, exception=False)
        return (
            breadcrumb_loaded
            and self.breadcrumb.locations[0] == 'Trends'
            and self.breadcrumb.read().startswith('Edit ')
        )
Beispiel #12
0
class EditYumFilterView(BaseLoggedInView):
    breadcrumb = BreadCrumb()

    @property
    def is_displayed(self):
        breadcrumb_loaded = self.browser.wait_for_element(self.breadcrumb,
                                                          exception=False)
        return (breadcrumb_loaded and len(self.breadcrumb.locations) > 3
                and self.breadcrumb.locations[2] == 'Yum Filters'
                and self.breadcrumb.read() != 'Create Yum Filter')

    @View.nested
    class details(SatSecondaryTab):
        name = EditableEntry(name='Name')
        description = EditableEntry(name='Description')

    @View.nested
    class rpms(SatSecondaryTab, SearchableViewMixin):
        TAB_NAME = 'RPMs'

        exclude_no_errata = Checkbox(locator=".//input[@type='checkbox']"
                                     "[@ng-model='filter.original_packages']")
        add_rule = Text(".//button[@ng-click='addRule()']")
        remove_rule = Text(".//button[@ng-click='removeRules(filter)']")
        table = SatTable(
            locator='//table',
            column_widgets={
                0: Checkbox(locator=".//input[@type='checkbox']"),
                4: Text("./button[contains(@ng-click, 'rule.editMode')]"),
            },
        )

    @View.nested
    class affected_repositories(SatSecondaryTab):
        TAB_NAME = 'Affected Repositories'
        filter_toggle = RadioGroup(".//div[@class='col-sm-8']")
        product_filter = Select(locator=".//select[@ng-model='product']")
        searchbox = Search()
        update_repositories = Button('Update Repositories')
        table = SatTable(
            locator='//table',
            column_widgets={0: Checkbox(locator=".//input[@type='checkbox']")},
        )
Beispiel #13
0
class ComputeProfileDetailView(BaseLoggedInView):
    breadcrumb = BreadCrumb()
    table = SatTable(
        './/table',
        column_widgets={
            'Compute Resource': Text('./a'),
        }
    )

    @property
    def is_displayed(self):
        breadcrumb_loaded = self.browser.wait_for_element(
            self.breadcrumb, exception=False)
        return (
            breadcrumb_loaded
            and self.breadcrumb.locations[0] == 'Compute Profiles'
            and self.breadcrumb.read() != 'Create Compute Profile'
            and self.breadcrumb.read() != 'Edit Compute Profile'
        )
Beispiel #14
0
class ActivationKeyEditView(BaseLoggedInView):
    """View for the ActivationKeys Edit page"""

    breadcrumb = BreadCrumb()
    actions = ActionsDropdown("//div[contains(@class, 'btn-group')]")
    dialog = ConfirmationDialog()

    @property
    def is_displayed(self):
        breadcrumb_loaded = self.browser.wait_for_element(self.breadcrumb,
                                                          exception=False)
        return (breadcrumb_loaded
                and self.breadcrumb.locations[0] == 'Activation Keys'
                and self.breadcrumb.read() != 'New Activation Key')

    @View.nested
    class details(SatTab):
        name = EditableEntry(name='Name')
        description = EditableEntry(name='Description')
        hosts_limit = EditableLimitEntry(name='Host Limit')
        service_level = EditableEntrySelect(name='Service Level')
        lce = ParametrizedView.nested(LCESelectorGroup)
        content_view = EditableEntrySelect(name='Content View')

    @View.nested
    class subscriptions(SatTab):
        resources = View.nested(AddRemoveSubscriptionsView)

    @View.nested
    class repository_sets(SatTab):
        TAB_NAME = 'Repository Sets'
        table = Table(locator=".//table")

    @View.nested
    class host_collections(SatTab):
        TAB_NAME = 'Host Collections'
        resources = View.nested(AddRemoveResourcesView)

    @View.nested
    class content_hosts(SatTabWithDropdown):
        TAB_NAME = 'Associations'
        SUB_ITEM = 'Content Hosts'
        table = Table(locator=".//table")
Beispiel #15
0
class ContentViewVersionRemoveConfirmationView(BaseLoggedInView):
    breadcrumb = BreadCrumb()

    cancel = Text(".//button[normalize-space(.)='Cancel']")
    back = Text(".//button[@ng-click='transitionBack()']")
    confirm_remove = Text(".//button[@ng-click='performDeletion()']")
    message_title = Text(".//h3")

    @property
    def is_displayed(self):
        breadcrumb_loaded = self.browser.wait_for_element(
            self.breadcrumb, exception=False)
        return (
            breadcrumb_loaded
            and self.breadcrumb.locations[0] == 'Content Views'
            and len(self.breadcrumb.locations) == 3
            and self.breadcrumb.read() == 'Deletion'
            and self.confirm_remove.is_displayed
        )
Beispiel #16
0
class SyncTemplatesView(BaseLoggedInView):
    breadcrumb = BreadCrumb()
    title = Text("//h2[contains(., 'Import or Export Templates')]")
    sync_type = RadioGroup("//div[label[contains(., 'Action type')]]")
    submit = Text("//button[@type='submit']")

    template = ConditionalSwitchableView(reference='sync_type')

    @property
    def is_displayed(self):
        breadcrumb_loaded = self.browser.wait_for_element(self.breadcrumb,
                                                          exception=False)
        return (breadcrumb_loaded and self.browser.wait_for_element(
            self.title, exception=False) is not None)

    def before_fill(self, values):
        """Wait for Sync Type Radio Button to be displayed"""
        wait_for(lambda: self.sync_type.is_displayed,
                 timeout=10,
                 delay=1,
                 logger=self.logger)

    @template.register('Import')
    class ImportTemplates(View):
        associate = Select(name='associate')
        branch = TextInput(name='branch')
        dirname = TextInput(name='dirname')
        filter = TextInput(name='filter')
        force_import = Checkbox(name='force')
        lock = Checkbox(name='lock')
        negate = Checkbox(name='negate')
        prefix = TextInput(name='prefix')
        repo = TextInput(name='repo')

    @template.register('Export')
    class ExportTemplates(View):
        branch = TextInput(name='branch')
        dirname = TextInput(name='dirname')
        filter = TextInput(name='filter')
        metadata_export_mode = Select(name='metadata_export_mode')
        negate = Checkbox(name='negate')
        repo = TextInput(name='repo')
Beispiel #17
0
class ErrataDetailsView(BaseLoggedInView):

    breadcrumb = BreadCrumb()
    advisory = Text("//h3")
    type = ReadOnlyEntry(name='Type')
    title = ReadOnlyEntry(name='Title')
    issued = ReadOnlyEntry(name='Issued')
    updated = ReadOnlyEntry(name='Updated')
    description = ReadOnlyEntry(name='Description')
    last_updated_on = ReadOnlyEntry(name='Last Updated On')
    reboot_suggested = ReadOnlyEntry(name='Reboot Suggested')
    packages = ReadOnlyEntry(name='Packages')
    module_streams = ReadOnlyEntry(name='Module Streams')

    @property
    def is_displayed(self):
        breadcrumb_loaded = self.browser.wait_for_element(self.breadcrumb,
                                                          exception=False)
        return (breadcrumb_loaded and self.breadcrumb.locations[1] == 'Errata'
                and len(self.breadcrumb.locations) > 3)
Beispiel #18
0
class ProductTaskDetailsView(BaseLoggedInView):
    breadcrumb = BreadCrumb()
    action_type = ReadOnlyEntry(name='Action Type')
    user = ReadOnlyEntry(name='User')
    started_at = ReadOnlyEntry(name='Started At')
    finished_at = ReadOnlyEntry(name='Finished At')
    parameters = ReadOnlyEntry(name='Parameters')
    state = ReadOnlyEntry(name='State')
    result = ReadOnlyEntry(name='Result')
    progressbar = ProgressBar()
    details = ReadOnlyEntry(name='Details')

    @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'
                and self.breadcrumb.locations[2] == 'Tasks'
                and len(self.breadcrumb.locations) > 3)
Beispiel #19
0
class ProductEditView(BaseLoggedInView):
    breadcrumb = BreadCrumb()
    actions = ActionsDropdown("//div[contains(@class, 'btn-group')]")
    dialog = ConfirmationDialog()

    @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'
                and self.breadcrumb.read()
                not in ('New Product', 'Discover Repositories')
                and len(self.breadcrumb.locations) <= 3)

    @View.nested
    class details(SatTab):
        name = EditableEntry(name='Name')
        label = ReadOnlyEntry(name='Label')
        gpg_key = EditableEntrySelect(name='GPG Key')
        ssl_ca_cert = EditableEntrySelect(name='SSL CA Cert')
        ssl_client_cert = EditableEntrySelect(name='SSL Client Cert')
        ssl_client_key = EditableEntrySelect(name='SSL Client Key')
        description = EditableEntry(name='Description')
        repos_count = ReadOnlyEntry(name='Number of Repositories')
        tasks_count = ReadOnlyEntry(name='Active Tasks')
        sync_plan = EditableEntrySelect(name='Sync Plan')
        sync_state = ReadOnlyEntry(name='Sync State')

    @View.nested
    class repositories(SatTab):
        table = SatTable(
            locator=".//table",
            column_widgets={
                0:
                Checkbox(
                    locator="./input[@ng-change='itemSelected(repository)']"),
                'Name':
                Text("./a"),
            },
        )
Beispiel #20
0
class ResourceProviderDetailView(BaseLoggedInView):
    breadcrumb = BreadCrumb()
    submit = Text('//input[@name="commit"]')

    @property
    def is_displayed(self):
        breadcrumb_loaded = self.browser.wait_for_element(
            self.breadcrumb, exception=False)
        return (
            breadcrumb_loaded
            and self.breadcrumb.locations[0] == 'Compute resources'
            and self.breadcrumb.read() != 'Create Compute Resource'
        )

    @View.nested
    class compute_resource(SatTab):
        TAB_NAME = 'Compute Resource'
        table = SatTable('.//table')

    @View.nested
    class virtual_machines(SatTab, SearchableViewMixin):
        TAB_NAME = 'Virtual Machines'

        table = SatTable(
            './/table',
            column_widgets={
                'Name': Text('./a'),
                'Actions': Text('.//a[@data-method="put"]'),
                'Power': Text('.//span[contains(@class,"label")]'),
            }
        )

    @View.nested
    class compute_profiles(SatTab):
        TAB_NAME = 'Compute profiles'
        table = SatTable(
            './/table',
            column_widgets={
                'Compute profile': Text('./a'),
            }
        )
Beispiel #21
0
class ProvisionView(BaseLoggedInPage):
    """
    The provisioning view, with nested ProvisioningForm as `form` attribute.
    Handles template selection before Provisioning form with `before_fill` method
    """
    title = Text('#explorer_title_text')
    breadcrumb = BreadCrumb()
    image_table = Table('//div[@id="pre_prov_div"]//table')

    @View.nested
    class form(BasicProvisionFormView):  # noqa
        """First page of provision form is image selection
        Second page of form is tabbed with nested views
        """
        continue_button = Button('Continue')  # Continue button on 1st page, image selection
        submit_button = Button('Submit')  # Submit for 2nd page, tabular form
        cancel_button = Button('Cancel')

        def before_fill(self, values):
            # Provision from image is a two part form,
            # this completes the image selection before the tabular parent form is filled
            template_name = values.get('template_name')
            provider_name = values.get('provider_name')
            if template_name is None or provider_name is None:
                logger.error('template_name "{}", or provider_name "{}" not passed to '
                             'provisioning form', template_name, provider_name)
            # try to find the template anyway, even if values weren't passed
            try:
                row = self.parent.image_table.row(name=template_name, provider=provider_name)
            except IndexError:
                raise TemplateNotFound('Cannot find template "{}" for provider "{}"'
                                       .format(template_name, provider_name))
            row.click()
            self.continue_button.click()
            # TODO timing, wait_displayed is timing out and can't get it to stop in is_displayed
            sleep(3)
            self.flush_widget_cache()

    @property
    def is_displayed(self):
        return False
Beispiel #22
0
class JobInvocationStatusView(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] == 'Job invocations'
            and len(self.breadcrumb.locations) == 2
        )

    rerun = Text("//a[text()='Rerun']")
    rerun_failed = Text("//a[text()='Rerun failed']")
    job_task = Text("//a[text()='Job Task']")
    cancel_job = Text("//a[text()='Cancel Job']")
    abort_job = Text("//a[text()='Abort Job']")

    @View.nested
    class overview(SatTab):
        job_status = Text(
            "//div[@id='job_invocations_chart_container']"
            "//*[name()='tspan'][contains(@class,'donut-title-small-pf')]"
        )
        job_status_progress = Text(
            "//div[@id='job_invocations_chart_container']"
            "//*[name()='tspan'][contains(@class,'donut-title-big-pf')]"
        )
        hosts_table = SatTable(
            './/table',
            column_widgets={
                'Host': Text('./a'),
                'Actions': ActionsDropdown(
                    "./div[contains(@class, 'btn-group')]"),
            }
        )
        total_hosts = Text(
            "//h2[contains(., 'Total hosts')]"
            "/span[@class='card-pf-aggregate-status-count']"
        )
Beispiel #23
0
class RepositoriesView(BaseLoggedInView, SearchableViewMixin):
    breadcrumb = BreadCrumb()
    new = Text("//button[contains(@href, '/repositories/new')]")
    sync = Text("//button[contains(@ng-click, 'syncSelectedRepositories')]")
    delete = Text("//button[contains(@ng-show, 'canRemoveRepositories')]")
    dialog = ConfirmationDialog()
    table = SatTable(
        locator=".//table",
        column_widgets={
            0: Checkbox(
                locator=".//input[@ng-change='itemSelected(repository)']"),
            'Name': Text("./a[contains(@ui-sref, 'product.repository.info')]"),
        })

    @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'
                and self.breadcrumb.read() == 'Repositories')
Beispiel #24
0
class ContentViewVersionRemoveView(BaseLoggedInView):
    breadcrumb = BreadCrumb()

    table = SatTable(locator='.//table',
                     column_widgets={
                         0: Checkbox(locator="./input[@type='checkbox']"),
                     })
    completely = Checkbox(
        locator=".//input[@ng-model='deleteOptions.deleteArchive']")
    next = Text(".//button[@ng-click='processSelection()']")
    cancel = Text(".//button[normalize-space(.)='Cancel']")

    @property
    def is_displayed(self):
        breadcrumb_loaded = self.browser.wait_for_element(self.breadcrumb,
                                                          exception=False)
        return (breadcrumb_loaded
                and self.breadcrumb.locations[0] == 'Content Views'
                and len(self.breadcrumb.locations) == 3
                and self.breadcrumb.read() == 'Deletion'
                and self.next.is_displayed)
Beispiel #25
0
class AnsibleRolesImportView(BaseLoggedInView):
    """View while selecting Ansible roles to import."""

    breadcrumb = BreadCrumb()
    total_available_roles = Text(
        "//div[@class='pf-c-pagination__total-items']/b[2]")
    select_all = Checkbox(locator="//input[@id='select-all']")
    table = PatternflyTable(
        component_id='OUIA-Generated-Table-2',
        column_widgets={
            0: Checkbox(locator='.//input[@type="checkbox"]'),
        },
    )
    pagination = ImportPagination()
    submit = Button('Submit')
    cancel = Button('Cancel')

    @property
    def is_displayed(self):
        return (self.breadcrumb.locations[0] == 'Roles'
                and self.breadcrumb.read() == 'Changed Ansible roles')
Beispiel #26
0
class HostRegisterView(BaseLoggedInView):
    breadcrumb = BreadCrumb()
    host_group = FilteredDropdown(id='s2id_host_group_id')
    operatingsystem = FilteredDropdown(id='s2id_operatingsystem_id')
    capsule = FilteredDropdown(id='s2id_smart_proxy')
    setup_insights = FilteredDropdown(id='s2id_setup_insights')
    remote_execution = FilteredDropdown(id='s2id_setup_remote_execution')
    token_lifetime = TextInput(id='jwt_expiration')
    remote_execution_interface = TextInput(id='remote_execution_interface')
    activation_keys = TextInput(id='activation_key')
    generate_command = TextInput(name='commit')
    registration_command = Text('//pre[@id="registration_command"]')

    @property
    def is_displayed(self):
        breadcrumb_loaded = self.browser.wait_for_element(self.breadcrumb, exception=False)
        return (
            breadcrumb_loaded
            and self.breadcrumb.locations[0] == 'Registrations'
            and self.breadcrumb.read() == 'Register Host'
        )
Beispiel #27
0
class ContentViewFiltersView(BaseLoggedInView, SearchableViewMixin):
    breadcrumb = BreadCrumb()

    new_filter = Text(".//button[@ui-sref='content-view.yum.filters.new']")
    remove_selected = Text(".//button[@ng-click='removeFilters()']")

    table = SatTable(
        locator='//table',
        column_widgets={
            0: Checkbox(locator=".//input[@type='checkbox']"),
            'Name': Text('./a'),
        },
    )

    @property
    def is_displayed(self):
        breadcrumb_loaded = self.browser.wait_for_element(self.breadcrumb,
                                                          exception=False)
        return (breadcrumb_loaded
                and self.breadcrumb.locations[0] == 'Content Views'
                and self.breadcrumb.read() == 'Yum Filters')
Beispiel #28
0
class UserDetailsView(BaseLoggedInView):
    breadcrumb = BreadCrumb()
    submit = Text('//input[@name="commit"]')

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

    @View.nested
    class user(SatTab):
        login = TextInput(id='user_login')
        firstname = TextInput(id='user_firstname')
        lastname = TextInput(id='user_lastname')
        mail = TextInput(id='user_mail')
        description = TextInput(id='user_description')
        language = FilteredDropdown(id='user_locale')
        timezone = FilteredDropdown(id='user_timezone')
        auth = FilteredDropdown(id='user_auth_source')
        password = TextInput(id='user_password')
        confirm = TextInput(id='password_confirmation')

    @View.nested
    class locations(SatTab):
        resources = MultiSelect(id='ms-user_location_ids')

    @View.nested
    class organizations(SatTab):
        resources = MultiSelect(id='ms-user_organization_ids')

    @View.nested
    class roles(SatTab):
        admin = Checkbox(id='user_admin')
        resources = MultiSelect(id='ms-user_role_ids')
Beispiel #29
0
class ProviderDetailsView(BaseLoggedInPage):
    """
     main Details page
    """
    title = Text('//div[@id="main-content"]//h1')
    breadcrumb = BreadCrumb(locator='//ol[@class="breadcrumb"]')
    toolbar = View.nested(ProviderDetailsToolBar)

    entities = ConditionalSwitchableView(reference='toolbar.view_selector',
                                         ignore_bad_reference=True)

    @entities.register('Summary View', default=True)
    class ProviderDetailsSummaryView(View):
        """
        represents Details page when it is switched to Summary aka Tables view
        """
        summary = ParametrizedSummaryTable()

    @entities.register('Dashboard View')
    class ProviderDetailsDashboardView(View):
        """
         represents Details page when it is switched to Dashboard aka Widgets view
        """
        # todo: need to develop this page
        pass

    @property
    def is_displayed(self):
        if (not self.toolbar.view_selector.is_displayed or
                self.toolbar.view_selector.selected == 'Summary View'):
            subtitle = 'Summary'
        else:
            subtitle = 'Dashboard'

        title = '{name} ({subtitle})'.format(name=self.context['object'].name,
                                             subtitle=subtitle)
        return (self.logged_in_as_current_user and
                self.breadcrumb.is_displayed and
                self.breadcrumb.active_location == title)
Beispiel #30
0
class HostCollectionEditView(BaseLoggedInView):
    breadcrumb = BreadCrumb()
    actions = ActionsDropdown("//div[contains(@class, 'btn-group')]")
    dialog = ConfirmationDialog()

    @property
    def is_displayed(self):
        breadcrumb_loaded = self.browser.wait_for_element(self.breadcrumb, exception=False)
        return (
            breadcrumb_loaded
            and self.breadcrumb.locations[0] == 'Host Collections'
            and self.breadcrumb.read() != 'New Host Collection'
        )

    @View.nested
    class details(SatTab):
        name = EditableEntry(name='Name')
        description = EditableEntry(name='Description')
        content_hosts = ReadOnlyEntry(
            locator=(
                ".//dt[contains(., 'Content Hosts')]/following-sibling"
                "::dd/a[not(contains(@class, 'ng-hide'))][1]"
            )
        )
        content_host_limit = EditableLimitEntry(name='Content Host Limit')
        # Package Installation, Removal, and Update
        manage_packages = Text(".//a[@ng-click='openPackagesModal()']")
        # Errata Installation
        install_errata = Text(".//a[@ng-click='openErrataModal()']")
        # Module Stream Installation, Removal, and Update
        manage_module_streams = Text(".//a[@ng-click='openModuleStreamsModal()']")
        # Change assigned Lifecycle Environment or Content View
        change_assigned_content = Text(".//a[@ng-click='openEnvironmentModal()']")

    @View.nested
    class hosts(SatTab):
        TAB_NAME = 'Hosts'

        resources = View.nested(AddRemoveResourcesView)