Пример #1
0
class GenericObjectAddEditButtonView(GenericObjectDefinitionView):
    title = Text('#explorer_title_text')
    form = ConditionalSwitchableView(reference="button_type")

    button_type = BootstrapSelect(name='button_type')
    name = Input(name='name')
    description = Input(name='description')
    display = BootstrapSwitch(name='display')
    image = FonticonPicker('button_icon')
    dialog = BootstrapSelect(name='dialog')
    open_url = BootstrapSwitch(name='open_url')
    display_for = BootstrapSelect(name='display_for')
    submit_version = BootstrapSelect(name='submit_how')
    system_process = BootstrapSelect(name='ae_instance')
    system_message = Input(name='ae_message')
    request = Input(name='request')
    add_attribute_value_key = Button('Add Attribute/Value Pair')
    attributes = ButtonParameterForm(param_type="Attribute")
    cancel = Button('Cancel')

    @form.register("Default")
    class DefaultButtonFieldView(View):
        pass

    # the following are necessary for ansible playbook buttons in 5.11
    @form.register("Ansible Playbook")
    class AnsibleButtonFieldView(View):  # noqa
        playbook_cat_item = BootstrapSelect(name='playbook_catalog_item')
        inventory = AutomateRadioGroup(
            locator=".//input[@name='inventory']/..")
        hosts = Input(locator=".//input[contains(@ng-model, 'hosts')]")
Пример #2
0
class VolumeBackupView(VolumeView):
    @property
    def is_displayed(self):
        return False

    backup_name = TextInput(name='backup_name')
    # options
    incremental = BootstrapSwitch(name='incremental')
    force = BootstrapSwitch(name='force')

    save = Button('Save')
    reset = Button('Reset')
    cancel = Button('Cancel')
Пример #3
0
class GenericObjectButtonGroupAddView(GenericObjectDefinitionView):
    title = Text('#explorer_title_text')

    name = Input(name='name')
    display = BootstrapSwitch(name='display')
    description = Input(name='description')
    image = VersionPick({
        Version.lowest(): BootstrapSelect('button_image'),
        '5.9': FonticonPicker('button_icon')})

    add = Button('Add')
    cancel = Button('Cancel')

    @property
    def is_displayed(self):
        return (
            self.title.text == 'GenericObjectButtonGroupAddView' and
            self.name.is_displayed and
            self.in_generic_object_definition
        )

    def after_fill(self, was_change):
        # we need to click somewhere out side the form to get add button active,
        # after icon is filled
        if was_change:
            self.browser.element('//body').click()
Пример #4
0
class VolumeBackupView(VolumeView):
    @property
    def is_displayed(self):
        expected_title = 'Create Backup for Cloud Volume "{}"'.format(
            self.context['object'].name)
        return (self.entities.title.text == expected_title
                and self.entities.breadcrumb.active_location == expected_title)

    backup_name = TextInput(name='backup_name')
    # options
    incremental = BootstrapSwitch(name='incremental')
    force = BootstrapSwitch(name='force')

    save = Button('Save')
    reset = Button('Reset')
    cancel = Button('Cancel')

    entities = View.nested(VolumeBackupEntities)
class GenericObjectAddEditButtonView(GenericObjectDefinitionView):
    title = Text('#explorer_title_text')

    button_type = BootstrapSelect(name='button_type')
    name = Input(name='name')
    description = Input(name='description')
    display = BootstrapSwitch(name='display')
    image = FonticonPicker('button_icon')
    dialog = BootstrapSelect(name='dialog')
    open_url = BootstrapSwitch(name='open_url')
    display_for = BootstrapSelect(name='display_for')
    submit_version = BootstrapSelect(name='submit_how')
    system_process = BootstrapSelect(name='ae_instance')
    system_message = Input(name='ae_message')
    request = Input(name='request')
    add_attribute_value_key = Button('Add Attribute/Value Pair')
    attributes = ButtonParameterForm(param_type="Attribute")
    cancel = Button('Cancel')
Пример #6
0
class VolumeAddForm(View):
    storage_manager = BootstrapSelect(name='storage_manager_id')
    tenant = BootstrapSelect(name='cloud_tenant_id')  # is for openstack block storage only
    volume_name = TextInput(name='name')
    volume_type = BootstrapSelect(name=VersionPicker({Version.lowest(): 'aws_volume_type',
                                                      '5.10': 'volume_type'}))
    volume_size = TextInput(name='size')
    # az is for ec2 block storage only
    az = BootstrapSelect(
        name=VersionPicker(
            {Version.lowest(): 'aws_availability_zone_id', '5.11': 'availability_zone_id'}))
    iops = TextInput(name='aws_iops')  # is for ec2 block storage only
    encryption = BootstrapSwitch(name="aws_encryption")  # is for ec2 block storage only
    add = Button('Add')
    cancel = Button('Cancel')