Example #1
0
    class options(View):  # noqa
        create = Button('Create')
        run_migration = RadioGroup('.//div[contains(@id,"migration_plan_choice_radio")]')

        @property
        def is_displayed(self):
            return self.run_migration.is_displayed
class ExternalAuthenticationView(View):
    """ External Authentication View """

    enable_sso = Checkbox(name='sso_enabled')
    provider_type = RadioGroup(locator=".//input[contains(@id, 'provider_type')]/../..")
    # the div label is 'Get [...] Groups' and the input name is [...]_role
    get_groups = Checkbox(name='httpd_role')
    class general(View):  # noqa
        infra_map = BootstrapSelect('infrastructure_mapping')
        name = TextInput(name='name')
        name_help_text = Text(locator='.//div[contains(@id,"name")]/span')
        description = TextInput(name='description')
        select_vm = RadioGroup('.//div[contains(@id,"vm_choice_radio")]')

        @property
        def is_displayed(self):
            return self.infra_map.is_displayed and self.name.is_displayed
Example #4
0
    class events(Tab, BeforeFillMixin):
        TAB_NAME = 'Events'
        event_stream = RadioGroup(locator='//div[@id="amqp"]')
        # below controls which appear only if amqp is chosen
        security_protocol = BootstrapSelect('amqp_security_protocol')
        hostname = Input('amqp_hostname')
        api_port = Input('amqp_api_port')
        username = Input('amqp_userid')
        password = Input('amqp_password')

        validate = Button('Validate')
Example #5
0
 class hardware(Tab):  # noqa
     TAB_NAME = 'Hardware'
     num_sockets = BootstrapSelect('hardware__number_of_sockets')
     cores_per_socket = BootstrapSelect('hardware__cores_per_socket')
     num_cpus = BootstrapSelect('hardware__number_of_cpus')
     memory = BootstrapSelect('hardware__vm_memory')
     disk_format = RadioGroup(locator=('//div[@id="hardware"]'
                                       '//div[./div[contains(@class, "radio")]]'))
     vm_limit_cpu = Input(name='hardware__cpu_limit')
     vm_limit_memory = Input(name='hardware__memory_limit')
     vm_reserve_cpu = Input(name='hardware__cpu_reserve')
     vm_reserve_memory = Input(name='hardware__memory_reserve')
Example #6
0
 class hardware(Tab):  # noqa
     TAB_NAME = 'Hardware'
     num_sockets = BootstrapSelect('hardware__number_of_sockets')
     cores_per_socket = BootstrapSelect('hardware__cores_per_socket')
     num_cpus = BootstrapSelect('hardware__number_of_cpus')
     memory = BootstrapSelect('hardware__vm_memory')
     schedule_type = RadioGroup(locator=('//div[@id="hardware"]'
                                         '//div[./div[@class="radio-inline"]]'))
     vm_limit_cpu = Input(name='hardware__cpu_limit')
     vm_limit_memory = Input(name='hardware__memory_limit')
     vm_reserve_cpu = Input(name='hardware__cpu_reserve')
     vm_reserve_memory = Input(name='hardware__memory_reserve')
Example #7
0
 class schedule(Tab):  # noqa
     TAB_NAME = 'Schedule'
     # Common
     schedule_type = RadioGroup(locator=('//div[@id="schedule"]'
                                         '//div[./div[contains(@class, "radio")]]'))
     provision_date = Calendar('miq_date_1')
     provision_start_hour = BootstrapSelect('start_hour')
     provision_start_min = BootstrapSelect('start_min')
     power_on = Checkbox(name='schedule__vm_auto_start')
     retirement = BootstrapSelect('schedule__retirement')
     retirement_warning = BootstrapSelect('schedule__retirement_warn')
     # Infra
     stateless = Input(name='schedule__stateless')
Example #8
0
    class schedule(View):  # noqa
        create = Button("Create")
        select_migration = RadioGroup('.//div[contains(@id,"migration_plan_type_radio")]')
        run_migration = RadioGroup('.//div[contains(@id,"migration_plan_choice_radio")]')

        @property
        def is_displayed(self):
            return self.run_migration.is_displayed

        def fill(self, values):
            was_change = True
            warm_migration = values.get('warm_migration', False)
            value = values.get('start_selection')
            if warm_migration:
                self.select_migration.select(value)
            else:
                self.run_migration.select(value)
            self.after_fill(was_change)
            return was_change

        def after_fill(self, was_change):
            self.create.click()
    class events(WaitTab, BeforeFillMixin):  # NOQA
        TAB_NAME = 'Events'
        event_stream = RadioGroup(locator='//div[@id="amqp"]')
        # below controls which appear only if amqp is chosen
        hostname = Input('amqp_hostname')
        api_port = Input('amqp_api_port')
        security_protocol = BootstrapSelect('amqp_security_protocol')
        change_password = Text(locator='.//a[normalize-space(.)="Change stored password"]')

        username = Input('amqp_userid')
        password = Input('amqp_password')
        confirm_password = Input('amqp_verify')

        validate = Button('Validate')
Example #10
0
    class general(View):  # noqa
        infra_map = BootstrapSelect("infrastructure_mapping")
        name = TextInput(name="name")
        name_help_text = Text(locator='.//div[contains(@id,"name")]/span')
        description = TextInput(name="description")
        select_vm = RadioGroup('.//div[contains(@id,"vm_choice_radio")]')
        fill_strategy = WaitFillViewStrategy("15s")

        @property
        def is_displayed(self):
            return self.infra_map.is_displayed and self.name.is_displayed

        def after_fill(self, was_change):
            self.parent.next_btn.click()
    class schedule(View):  # noqa
        create = Button("Create")
        run_migration = RadioGroup('.//div[contains(@id,"migration_plan_choice_radio")]')

        @property
        def is_displayed(self):
            return self.run_migration.is_displayed

        def fill(self, values):
            was_change = True
            self.run_migration.select(values)
            self.after_fill(was_change)
            return was_change

        def after_fill(self, was_change):
            self.create.click()
Example #12
0
 class customize(WaitTab):  # noqa
     TAB_NAME = 'Customize'
     # Common
     customize_type = BootstrapSelect('customize__sysprep_enabled')
     root_password = Input(name='customize__root_password')
     address_mode = RadioGroup(locator=('//div[@id="customize"]'
                                        '//div[./div[contains(@class, "radio")]]'))
     hostname = Input(name='customize__hostname')
     ip_address = Input(name='customize__ip_addr')
     subnet_mask = Input(name='customize__subnet_mask')
     gateway = Input(name='customize__gateway')
     dns_servers = Input(name='customize__dns_servers')
     dns_suffixes = Input(name='customize__dns_suffixes')
     specification_name = Table('//div[@id="prov_vc_div"]/table')
     admin_username = Input(name='customize__root_username')
     linux_host_name = Input(name='customize__linux_host_name')
     linux_domain_name = Input(name='customize__linux_domain_name')
     custom_template = SelectTable('//div[@id="prov_template_div"]/table')
Example #13
0
    class fields(ParametrizedView):  # noqa
        PARAMETERS = ("key", )
        input = Input(id=Parameter("key"))
        select = Select(id=Parameter("key"))
        param_input = Input(id=ParametrizedString("param_{key}"))
        dropdown = BootstrapSelect(locator=ParametrizedLocator(
            ".//div[contains(@class, 'bootstrap-select')]/select[@id={key|quote}]/.."
        ))
        param_dropdown = BootstrapSelect(locator=ParametrizedLocator(
            ".//div[contains(@class, 'bootstrap-select')]/select[@id='param_{key}']/.."
        ))
        multi_drop = BootstrapSelect(locator=ParametrizedLocator(
            ".//div[contains(@class, 'bootstrap-select')]/select[@input-id={key|quote}]/.."
        ))
        checkbox = Checkbox(id=Parameter("key"))
        refresh = Text(locator=ParametrizedLocator(
            '//label[contains(text(), "{key}")]/following-sibling::div/button')
                       )
        radiogroup = RadioGroup(locator=(
            '//div[contains(@ng-switch-when, "DialogFieldRadioButton")]/span[contains(@class, '
            '"ng-scope")]'))

        @property
        def visible_widget(self):
            for widget in (self.input, self.dropdown, self.param_input,
                           self.param_dropdown, self.select):
                try:
                    widget.wait_displayed('15s')
                    return widget
                except TimedOutError:
                    pass
            else:
                raise ItemNotFound("Visible widget is not found")

        def read(self):
            return self.visible_widget.read()

        def fill(self, value):
            return self.visible_widget.fill(value)
Example #14
0
 class general(View):  # noqa
     infra_map = BootstrapSelect('infrastructure_mapping')
     name = TextInput(name='name')
     name_help_text = Text(locator='.//div[contains(@id,"name")]/span')
     description = TextInput(name='description')
     select_vm = RadioGroup('.//div[contains(@id,"vm_choice_radio")]')
 class options(View):  # noqa
     create_btn = Button('Create')
     run_migration = RadioGroup(
         './/div[contains(@id,"migration_plan_choice_radio")]')