예제 #1
0
class BasicInfoForm(ServicesCatalogView):
    title = Text('#explorer_title_text')

    # Filling dropdowns first to avoid selenium field reset bug
    select_catalog = BootstrapSelect('catalog_id')
    select_dialog = BootstrapSelect('dialog_id')

    select_provider = BootstrapSelect('manager_id')
    select_orch_template = BootstrapSelect('template_id')
    select_config_template = BootstrapSelect('template_id')

    name = Input(name='name')
    description = Input(name='description')
    display = Checkbox(name='display')

    subtype = BootstrapSelect('generic_subtype')
    provisioning_entry_point = EntryPoint(name='fqname',
                                          tree_id="automate_catalog_treebox")
    retirement_entry_point = EntryPoint(name='retire_fqname',
                                        tree_id="automate_catalog_treebox")
    reconfigure_entry_point = EntryPoint(name='reconfigure_fqname',
                                         tree_id="automate_catalog_treebox")
    select_resource = BootstrapSelect('resource_id')
    additional_tenants = CheckableBootstrapTreeview(tree_id="tenants_treebox")
    zone = BootstrapSelect("zone_id")
    currency = BootstrapSelect("currency")
    price_per_month = Input(name="price")

    @View.nested
    class modal(View):  # noqa
        tree = ManageIQTree('automate_treebox')
        include_domain = Checkbox(id='include_domain_prefix_chk')
        apply = Button('Apply')
        cancel = Button('Cancel')
예제 #2
0
class MethodEditView(AutomateExplorerView):
    title = Text('#explorer_title_text')

    # inline
    inline_name = Input(name='method_name')
    inline_display_name = Input(name='method_display_name')
    script = ScriptBox()
    data = Input(name='method_data')
    validate_button = Button('Validate')
    inputs = View.nested(Inputs)

    # playbook
    playbook_name = Input(name='name')
    playbook_display_name = Input(name='display_name')
    repository = PlaybookBootstrapSelect('provisioning_repository_id')
    playbook = PlaybookBootstrapSelect('provisioning_playbook_id')
    machine_credential = PlaybookBootstrapSelect('provisioning_machine_credential_id')
    hosts = Input('provisioning_inventory')
    max_ttl = Input('provisioning_execution_ttl')
    logging_output = PlaybookBootstrapSelect('provisioning_log_output')
    escalate_privilege = BootstrapSwitch('provisioning_become_enabled')
    verbosity = PlaybookBootstrapSelect('provisioning_verbosity')
    playbook_input_parameters = PlaybookInputParameters()

    # Edit embedded method
    embedded_method_table = Table('//*[@id="embedded_methods_div"]/table')
    embedded_method = EntryPoint(locator='//*[@id="automate-inline-method-select"]//button',
                                 tree_id="treeview-entrypoint_selection")

    save_button = Button('Save')
    reset_button = Button('Reset')
    cancel_button = Button('Cancel')

    def before_fill(self, values):
        location = self.context['object'].location.lower()
        if 'display_name' in values and location in ['inline', 'playbook']:
            values['{}_display_name'.format(location)] = values['display_name']
            del values['display_name']
        elif 'name' in values and location in ['inline', 'playbook']:
            values['{}_name'.format(location)] = values['name']
            del values['name']

    @property
    def is_displayed(self):
        return (
            self.in_explorer
            and self.datastore.is_opened
            and (f'Editing Automate Method "{self.context["object"].name}"' in self.title.text)
            and check_tree_path(
                self.datastore.tree.currently_selected,
                self.context["object"].tree_path,
                partial=True,
            )
        )
예제 #3
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')
예제 #4
0
class MethodAddView(AutomateExplorerView):
    fill_strategy = WaitFillViewStrategy()
    title = Text('#explorer_title_text')

    location = BootstrapSelect('cls_method_location', can_hide_on_select=True)

    inline_name = Input(name='cls_method_name')
    inline_display_name = Input(name='cls_method_display_name')
    script = ScriptBox()
    data = Input(name='cls_method_data')
    validate_button = Button('Validate')
    inputs = View.nested(Inputs)

    playbook_name = Input(name='name')
    playbook_display_name = Input(name='display_name')
    repository = PlaybookBootstrapSelect('provisioning_repository_id')
    playbook = PlaybookBootstrapSelect('provisioning_playbook_id')
    machine_credential = PlaybookBootstrapSelect('provisioning_machine_credential_id')
    hosts = Input('provisioning_inventory')
    max_ttl = Input('provisioning_execution_ttl')
    logging_output = PlaybookBootstrapSelect('provisioning_log_output')
    escalate_privilege = BootstrapSwitch('provisioning_become_enabled')
    verbosity = PlaybookBootstrapSelect('provisioning_verbosity')
    playbook_input_parameters = PlaybookInputParameters()

    # Add embedded method
    embedded_method_table = Table('//*[@id="embedded_methods_div"]/table')
    embedded_method = EntryPoint(locator='//*[@id="automate-inline-method-select"]//button',
                                 tree_id="treeview-entrypoint_selection")

    add_button = Button('Add')
    cancel_button = Button('Cancel')

    @property
    def is_displayed(self):
        return (
            self.in_explorer and
            self.datastore.is_opened and
            self.title.text == 'Adding a new Automate Method' and
            check_tree_path(
                self.datastore.tree.currently_selected,
                self.context['object'].tree_path))
예제 #5
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')
     load_values_on_init = DialogBootstrapSwitch(label='Load values on init')
     default_value_dropdown = BootstrapSelect(
         locator='//label[contains(normalize-space(.), '
                 '"Default value")]/following-sibling::div/span/div'
     )
     field_past_dates = DialogBootstrapSwitch(label='Show Past Dates')
     field_category = Select(
         locator='.//select[../../../../label[normalize-space(text())="Category"]]')
     multi_select = DialogBootstrapSwitch(label='Multiselect')
     validation_switch = DialogBootstrapSwitch(label='Validation')
     validation = Input(name='validator_rule')
     visible = DialogBootstrapSwitch(label='Visible')
예제 #6
0
class BasicInfoForm(ServicesCatalogView):
    title = Text('#explorer_title_text')

    # Filling dropdowns first to avoid selenium field reset bug
    select_catalog = BootstrapSelect('catalog_id')
    select_dialog = BootstrapSelect('dialog_id')

    select_provider = BootstrapSelect('manager_id')
    select_orch_template = BootstrapSelect('template_id')
    select_config_template = BootstrapSelect('template_id')

    name = Input(name='name')
    description = Input(name='description')
    display = Checkbox(name='display')

    subtype = BootstrapSelect('generic_subtype')
    provisioning_entry_point = VersionPicker({
        LOWEST:
        EntryPoint(name='fqname', tree_id="automate_treebox"),
        "5.11":
        EntryPoint(name='fqname', tree_id="automate_catalog_treebox")
    })
    retirement_entry_point = VersionPicker({
        LOWEST:
        EntryPoint(name='retire_fqname', tree_id="automate_treebox"),
        "5.11":
        EntryPoint(name='retire_fqname', tree_id="automate_catalog_treebox")
    })
    reconfigure_entry_point = VersionPicker({
        LOWEST:
        EntryPoint(name='reconfigure_fqname', tree_id="automate_treebox"),
        "5.11":
        EntryPoint(name='reconfigure_fqname',
                   tree_id="automate_catalog_treebox")
    })
    select_resource = BootstrapSelect('resource_id')

    @View.nested
    class modal(View):  # noqa
        tree = ManageIQTree('automate_treebox')
        include_domain = Checkbox(id='include_domain_prefix_chk')
        apply = Button('Apply')
        cancel = Button('Cancel')