コード例 #1
0
    class MyView(View):
        the_reference = Select(id='switchabletesting-select')

        the_switchable_widget = ConditionalSwitchableView(
            reference='the_reference')

        the_switchable_widget.register(
            'foo', widget=Text('//h3[@id="switchabletesting-1"]'))
        the_switchable_widget.register(
            'bar', widget=Text('//h3[@id="switchabletesting-2"]'))
コード例 #2
0
 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')
コード例 #3
0
    class optional_input_validators(View):
        expander = Text(".//h2[contains(@data-target, '#optional_input_validators_')]")
        required = Checkbox(locator=".//input[contains(@name, '[required]') and @type!='hidden']")
        validator_type = Select(locator=".//select[contains(@name, '[validator_type]')]")
        validator_rule = TextInput(locator=".//input[contains(@name, '[validator_rule]')]")

        def __init__(self, parent, logger=None):
            View.__init__(self, parent, logger=logger)
            if 'collapsed' in self.browser.classes(self.expander):
                self.expander.click()
                self.browser.wait_for_element(self.validator_type, visible=True)
コード例 #4
0
class JobTemplateForeignInputSetItem(GenericRemovableWidgetItem):
    """Job Template Foreign Input Set Item widget"""
    remove_button = Text(".//a[@class='remove_nested_fields']")
    target_template = Select(
        locator=".//select[contains(@name, '[target_template_id]')]")
    include_all = Checkbox(
        locator=".//input[contains(@id, 'include_all')]")
    include = TextInput(
        locator=".//input[contains(@name, '[include]')]")
    exclude = TextInput(
        locator=".//input[contains(@name, '[exclude]')]")
コード例 #5
0
ファイル: contentviewfilter.py プロジェクト: vijay8451/airgun
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'
        )
コード例 #6
0
ファイル: product.py プロジェクト: vikask18/airgun
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')
    create_sync_plan = Text("//a[contains(@ng-click, 'openSyncPlanModal')]")
    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')
コード例 #7
0
 class affected_repositories(AffectedRepositoriesTab):
     filter_toggle = RadioGroup(".//div[@class='col-sm-8']")
     product_filter = Select(locator=".//select[@ng-model='product']")
     searchbox = TextInput(locator=".//input[@ng-model='repositorySearch']")
     update_repositories = Button('Update Repositories')
     select_all = Checkbox(
         locator=".//table//th[@class='row-select']/input")
     table = SatTable(
         locator='.//table',
         column_widgets={0: Checkbox(locator=".//input[@type='checkbox']")},
     )
コード例 #8
0
ファイル: contentcredential.py プロジェクト: ogajduse/airgun
class ContentCredentialCreateView(BaseLoggedInView):
    name = TextInput(id='name')
    content_type = Select(id='content_type')
    content = TextInput(name='content')
    upload_file = FileInput(name='file_path')
    submit = Text("//button[contains(@ng-click, 'handleSave')]")

    @property
    def is_displayed(self):
        return self.browser.wait_for_element(self.name,
                                             exception=False) is not None
コード例 #9
0
class NetworkRouterAddInterfaceView(BaseLoggedInPage):
    """ Represents Add Interface to Network Router page """
    flash = FlashMessages(
        './/div[@id="flash_msg_div"]/div[@id="flash_text_div" or '
        'contains(@class, "flash_text_div")]')
    subnet_name = Select(id='cloud_subnet_id')
    add = Button('Add')

    @property
    def is_displayed(self):
        return False
コード例 #10
0
    class options(Tab):  # noqa
        default_text_box = Input(name='default_value')
        field_required = DialogBootstrapSwitch(label='Required')
        default_value = DialogBootstrapSwitch(label='Default value')
        field_required = DialogBootstrapSwitch(label='Required')
        field_past_dates = DialogBootstrapSwitch(label='Show Past Dates')
        field_category = Select(
            locator='.//select[../../../../label[normalize-space(text())="Category"]]')

        validation = Input(name='validator_rule')
        visible = DialogBootstrapSwitch(label='Visible')
コード例 #11
0
ファイル: syncplan.py プロジェクト: ogajduse/airgun
class SyncPlanCreateView(BaseLoggedInView):
    name = TextInput(id='name')
    description = TextInput(id='description')
    interval = Select(id='interval')
    date_time = DateTime()
    submit = Text("//button[contains(@ng-click, 'handleSave')]")

    @property
    def is_displayed(self):
        return self.browser.wait_for_element(self.name,
                                             exception=False) is not None
コード例 #12
0
    class instance_properties(View):  # noqa
        table = Table('.//div[contains(@class, "container-fluid")]/table')
        edit_instance_properties = Text(
            locator='.//button/span[contains(@class, "pficon-edit")]')
        select_security_group = Select(locator='.//td[5]/select')
        select_flavor = Select(locator='.//td[6]/select')
        save_properties = Text(
            locator='.//div[contains(@class, "inline-edit-buttons")]'
            '/button[contains(@aria-label, "Save")]')

        @property
        def is_displayed(self):
            return (self.table.is_displayed and (len(
                self.browser.elements(".//div[contains(@class,'spinner')]"))
                                                 == 0))

        def fill(self, values):
            """
            This is required only for OSP
            and only if we want to edit osp_security_group or osp_flavor
            otherwise not needed.
            If none them is to be edited only next needs to be clicked.
            Args:
                values:
            """
            was_change = True
            osp_security_group = values.get('osp_security_group')
            osp_flavor = values.get('osp_flavor')
            if osp_security_group or osp_flavor:
                self.edit_instance_properties.click()
                self.select_security_group.wait_displayed()
                if osp_security_group:
                    self.select_security_group.fill(osp_security_group)
                if osp_flavor:
                    self.select_flavor.fill(osp_flavor)
                self.save_properties.click()
            self.after_fill(was_change)
            return was_change

        def after_fill(self, was_change):
            self.parent.next_btn.click()
コード例 #13
0
ファイル: computeresource.py プロジェクト: vijay8451/airgun
    class VMwareProviderForm(View):
        vcenter = TextInput(id='compute_resource_server')
        user = TextInput(id='compute_resource_user')
        password = TextInput(id='compute_resource_password')
        display_type = Select(id='compute_resource_display_type')
        vnc_console_passwords = Checkbox(
            id='compute_resource_set_console_password')
        enable_caching = Checkbox(id='compute_resource_caching_enabled')
        load_datacenters = Text("//*[contains(@id,'test_connection_button')]")

        def after_fill(self, was_change):
            self.load_datacenters.click()
コード例 #14
0
class Navbar(View):
    """
    Navigation bar on top of every page except the login page.
    usermanagement is only available to admins
    """
    ROOT = ".//nav[contains(@class,'navbar-pf-contextselector tendrl-header-container')]"
    title = Text(".//a[@class='navbar-brand']")
    clusters = Select(".//select[contains(@ng-change, 'goToClusterPage')]")
    modal = NavDropdown(".//button[@id='aboutModalDropdown']/parent::li")
    usermanagement = NavDropdown(".//a[@id='usermanagement']/parent::li")
    alerts = NavDropdown(".//a[@id='notifications']/parent::li")
    usermenu = NavDropdown(".//a[@id='usermenu']/parent::li")
コード例 #15
0
class FlavorAddForm(View):
    """ Represents Add Flavor page """
    provider = Select(name='ems_id')
    flavor_name = TextInput(name='name')
    ram_size = TextInput(name='ram')
    vcpus = TextInput(name='vcpus')
    disk_size = TextInput(name='disk')
    swap_size = TextInput(name='swap')
    rxtx_factor = TextInput(name='rxtx_factor')
    public = BootstrapSwitch(name='is_public')
    add = Button('Add')
    cancel = Button('Cancel')
コード例 #16
0
    class FileRepository(View):
        upstream_url = TextInput(id='url')
        verify_ssl = Checkbox(id='verify_ssl_on_sync')
        upstream_username = TextInput(id='upstream_username')
        upstream_password = TextInput(id='upstream_password')
        publish_via_http = Checkbox(id='unprotected')
        http_proxy_policy = Select(id="http_proxy_policy")
        proxy_policy = ConditionalSwitchableView(reference='http_proxy_policy')

        @proxy_policy.register('Use specific HTTP Proxy')
        class SpecificHttpProxy(View):
            http_proxy = Select(id="http_proxy")
コード例 #17
0
ファイル: host.py プロジェクト: san7ket/airgun
class HostsChangeEnvironment(BaseLoggedInView):
    title = Text("//h4[text()='Change Environment - The"
                 " following hosts are about to be changed']")
    table = SatTable("//div[@class='modal-body']//table")
    keep_selected = Checkbox(id='keep_selected')
    environment = Select(id='environment_id')
    submit = Text('//button[@onclick="submit_modal_form()"]')

    @property
    def is_displayed(self):
        return self.browser.wait_for_element(self.title,
                                             exception=False) is not None
コード例 #18
0
class ActivationKeyCreateView(BaseLoggedInView):

    name = TextInput(id='name')
    hosts_limit = LimitInput()
    description = TextInput(id='description')
    lce = LCESelector()
    content_view = Select(id='content_view_id')
    submit = Text("//button[contains(@ng-click, 'handleSave')]")

    @property
    def is_displayed(self):
        return self.browser.wait_for_element(self.name,
                                             exception=False) is not None
コード例 #19
0
    class MyView(View):
        the_reference = Select(id="switchabletesting-select")

        the_switchable_view = ConditionalSwitchableView(
            reference="the_reference")

        @the_switchable_view.register("foo")
        class FooView(View):
            widget = Text('//h3[@id="switchabletesting-1"]')

        @the_switchable_view.register("bar")
        class BarView(View):
            widget = Text('//h3[@id="switchabletesting-2"]')
コード例 #20
0
    class MyView(View):
        the_reference = Select(id="ewaopaopsdkgnjdsopjf")

        the_switchable_view = ConditionalSwitchableView(
            reference="the_reference")

        @the_switchable_view.register("foo")
        class FooView(View):
            widget = Text('//h3[@id="switchabletesting-1"]')

        @the_switchable_view.register("bar", default=True)
        class BarView(View):
            widget = Text('//h3[@id="switchabletesting-2"]')
コード例 #21
0
    class MyView(View):
        the_reference = Select(id='switchabletesting-select')

        the_switchable_view = ConditionalSwitchableView(
            reference='the_reference')

        @the_switchable_view.register('foo')
        class FooView(View):
            widget = Text('//h3[@id="switchabletesting-1"]')

        @the_switchable_view.register('bar')
        class BarView(View):
            widget = Text('//h3[@id="switchabletesting-2"]')
コード例 #22
0
    class MyView(View):
        the_reference = Select(id='ewaopaopsdkgnjdsopjf')

        the_switchable_view = ConditionalSwitchableView(
            reference='the_reference')

        @the_switchable_view.register('foo')
        class FooView(View):
            widget = Text('//h3[@id="switchabletesting-1"]')

        @the_switchable_view.register('bar', default=True)
        class BarView(View):
            widget = Text('//h3[@id="switchabletesting-2"]')
コード例 #23
0
    class options(PotentiallyInvisibleTab):  # noqa
        form = ConditionalSwitchableView(reference="type")
        type = BootstrapSelect("button_type")

        @form.register("Default")
        class ButtonFormDefaultView(View):  # noqa
            dialog = BootstrapSelect("dialog_id")

        @form.register("Ansible Playbook")
        class ButtonFormAnsibleView(View):  # noqa
            playbook_cat_item = BootstrapSelect("service_template_id")
            inventory = AutomateRadioGroup(locator=".//input[@name='inventory']/..")
            hosts = Input(name="hosts")

        text = Input(name="name")
        display = Checkbox(name="display")
        hover = Input(name="description")
        image = FonticonPicker("button_icon")
        icon_color = ColourInput(id="button_color")
        open_url = Checkbox("open_url")
        display_for = Select(id="display_for")
        submit = Select(id="submit_how")
コード例 #24
0
ファイル: job_template.py プロジェクト: vijay8451/airgun
        class foreign_input(View):
            ROOT = "//div[contains(@class, 'foreign_input')]" \
                   "/following-sibling::div[1]"
            target_template = Select(
                locator=".//select[contains(@name, '[target_template_id]')]")
            include_all = Checkbox(
                locator=".//input[contains(@id, 'include_all')]")
            include = TextInput(
                locator=".//input[contains(@name, '[include]')]")
            exclude = TextInput(
                locator=".//input[contains(@name, '[exclude]')]")

            def before_fill(self, values=None):
                self.parent.add_foreign_input_set.click()
コード例 #25
0
ファイル: activationkey.py プロジェクト: schlupov/airgun
class ActivationKeyDetailsView(BaseLoggedInView):

    name = TextInput(id='name')
    description = TextInput(id='description')
    unlimited_hosts = Checkbox(name='limit')
    max_hosts = TextInput(id='max_hosts')
    submit = Text("//button[contains(@ng-click, 'handleSave')]")
    lce = LCESelector()
    content_view = Select(id='content_view_id')

    @property
    def is_displayed(self):
        return self.browser.wait_for_element(self.name,
                                             exception=False) is not None
コード例 #26
0
class ControlImportExportView(BaseLoggedInPage):

    upload_button = InputButton("commit")
    export_button = Button("Export")
    commit_button = Button("Commit")

    upload_file = Input("upload[file]")
    export = BootstrapSelect("dbtype")
    policy_profiles = Select(id="choices_chosen_")

    @property
    def is_displayed(self):
        return (self.logged_in_as_current_user
                and self.navigation.currently_selected
                == ["Control", "Import / Export"])
コード例 #27
0
class ProductManageHttpProxy(BaseLoggedInView):
    """Represents Http Proxy Management page for Products."""
    title = Text("//h4[text()='Http Proxy Management']")
    http_proxy_policy = Select(id="http_proxy_policy")
    proxy_policy = ConditionalSwitchableView(reference='http_proxy_policy')
    update = Text('//button[@ng-click="update()"]')

    @proxy_policy.register('Use specific HTTP Proxy')
    class ExistingProductForm(View):
        http_proxy = Select(id="http_proxy")

    @property
    def is_displayed(self):
        return self.browser.wait_for_element(self.title,
                                             exception=False) is not None
コード例 #28
0
    class options(WaitTab):  # noqa
        default_text_box = Input(name='default_value')
        entry_point = EntryPoint(locator="//input[@class='form-control']",
                                 tree_id="treeview-tree-selector")
        field_required = DialogBootstrapSwitch(label='Required')
        default_value = DialogBootstrapSwitch(label='Default value')
        field_required = DialogBootstrapSwitch(label='Required')
        field_past_dates = DialogBootstrapSwitch(label='Show Past Dates')
        field_category = Select(
            locator=
            './/select[../../../../label[normalize-space(text())="Category"]]')

        validation_switch = DialogBootstrapSwitch(label='Validation')
        validation = Input(name='validator_rule')
        visible = DialogBootstrapSwitch(label='Visible')
コード例 #29
0
class ContentCredentialCreateView(BaseLoggedInView):
    breadcrumb = BreadCrumb()
    name = TextInput(id='name')
    content_type = Select(id='content_type')
    content = TextInput(name='content')
    upload_file = FileInput(name='file_path')
    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] == 'Content Credential'
                and self.breadcrumb.read() == 'New Content Credential')
コード例 #30
0
class ImportExportWidgetsView(CloudIntelReportsView):
    title = Text("#explorer_title_text")
    subtitle = Text(locator=".//div[@id='main_div']/h2")

    upload_file = FileInput(id="upload_file")
    upload_button = InputButton("commit")

    items_for_export = Select(id="widgets_")
    export_button = Button(value="Export")

    @property
    def is_displayed(self):
        return (self.in_intel_reports and self.title.text == "Import / Export"
                and self.subtitle.text == "Widgets"
                and self.import_export.tree.currently_selected
                == ["Import / Export", "Widgets"])