コード例 #1
0
ファイル: settings.py プロジェクト: prachiyadav/cfme_tests
def set_default_view(button_group_name, view):
    bg = ButtonGroup(button_group_name)
    sel.force_navigate("my_settings_default_views")
    default_view = bg.active
    if(default_view != view):
        bg.choose(view)
        sel.click(form_buttons.save)
コード例 #2
0
def test_summary_pages_links(provider, cls):

    navigate_to(cls.object, "All")
    all_url = sel.current_url()
    tb.select("List View")
    name = choice([r[2].text for r in list_tbl.rows()])
    obj = cls.object(name, provider)
    obj.summary  # <- reload summary

    breads = breadcrumbs()
    bread_names = map(sel.text_sane, breads)

    if cls.breadcrumb_member.startswith("Container") and cls.breadcrumb_member not in bread_names:
        breadcrumb_member = cls.breadcrumb_member.split(" ")[-1]
    else:
        breadcrumb_member = cls.breadcrumb_member

    assert breadcrumb_member in bread_names

    chosen_link = next(b for b in breads if sel.text_sane(b) == breadcrumb_member)

    sel.click(chosen_link)

    # TODO: replace with widgetastic view.is_displayed function when available
    assert sel.current_url().split("?")[0] == all_url.split("?")[0]
コード例 #3
0
ファイル: tasks.py プロジェクト: quarckster/cfme_tests
def _filter(
        zone=None,
        user=None,
        time_period=None,
        task_status_queued=None,
        task_status_running=None,
        task_status_ok=None,
        task_status_error=None,
        task_status_warn=None,
        task_state=None):
    """ Does filtering of the results in table. Needs to be on the correct page before called.

    If there was no change in the form and the apply button does not appear, nothing happens.

    Args:
        zone: Value for 'Zone' select
        user: Value for 'User' select
        time_period: Value for 'Time period' select.
        task_status_*: :py:class:`bool` values for checkboxes
        task_state: Value for 'Task State' select.
    """
    fill(filter_form, locals())
    try:
        wait_for(lambda: sel.is_displayed(buttons.apply), num_sec=5)
        sel.click(buttons.apply)
    except TimedOutError:
        pass
コード例 #4
0
def test_relationships_tables(provider, cls):
    """This module verifies the integrity of the Relationships table.
    clicking on each field in the Relationships table takes the user
    to either Summary page where we verify that the field that appears
    in the Relationships table also appears in the Properties table,
    or to the page where the number of rows is equal to the number
    that is displayed in the Relationships table.
    """
    navigate_to(cls.object, 'All')
    tb.select('List View')
    list_tbl = CheckboxTable(table_locator="//div[@id='list_grid']//table")
    cls_instances = [r.name.text for r in list_tbl.rows()]
    cls_instances = sample(cls_instances, min(2, len(cls_instances)))
    for name in cls_instances:
        obj = cls.object(name, provider)
        obj.summary.reload()
        keys = sample(obj.summary.relationships.keys,
                      min(1, len(obj.summary.relationships.keys)))
        for key in keys:
            # reload summary to prevent StaleElementReferenceException:
            obj.summary.reload()
            element = getattr(obj.summary.relationships, key)
            if element.value in rel_values:
                continue
            sel.click(element)
            # TODO: find a better indication that we are in the right page:
            sel.is_displayed_text('{} (Summary)'.format(element.text_value))
コード例 #5
0
ファイル: toolbar.py プロジェクト: MattLombana/cfme_tests
def refresh():
    """Refreshes page, attempts to use cfme refresh button otherwise falls back to browser refresh.
    """
    if sel.is_displayed("//div[@title='Reload current display']"):
        sel.click("//div[@title='Reload current display']")
    else:
        sel.refresh()
コード例 #6
0
ファイル: __init__.py プロジェクト: rananda/cfme_tests
    def add_jdbc_driver(self, filename, driver_name, module_name, driver_class,
                        major_version=None, minor_version=None, cancel=False):
        """Clicks to "Add JDBC Driver" button, in opened window fills fields by provided parameters,
        and deploys.

        Args:
            filename: Full path to JDBC Driver to import.
            driver_name: Name of newly created JDBC Driver.
            module_name: Name on Module to register on server side.
            driver_class: JDBC Driver Class.
            major_version: Major version of JDBC driver, optional.
            minor_version: Minor version of JDBC driver, optional.
            cancel: Whether to click Cancel instead of commit.
        """
        self.load_details(refresh=True)
        jdbc_btn("Add JDBC Driver")
        fill(jdbc_driver_form,
            {
                "file_select": filename,
                "jdbc_driver_name": driver_name,
                "jdbc_module_name": module_name,
                "jdbc_driver_class": driver_class,
                "major_version": major_version,
                "minor_version": minor_version
            })
        sel.click(jdbc_driver_form.cancel_button if cancel else jdbc_driver_form.deploy_button)
        flash.assert_success_message('JDBC Driver "{}" has been installed on this server.'
                    .format(driver_name))
コード例 #7
0
ファイル: reports.py プロジェクト: slouderm/cfme_tests
 def download(self, extension):
     self.navigate()
     toolbar.select("Download")
     sel.click(
         "//table[contains(@class, 'buttons_cont')]"
         "//img[contains(@class, 'btn_sel_img') and contains(@src, '{}.png')]".format(extension)
     )
コード例 #8
0
def fill_count(count=None, key=None, value=None):
    """ Fills the 'Count of' type of form.

    If the value is unspecified and we are in the advanced search form (user input), the user_input
    checkbox will be checked if the value is None.

    Args:
        count: Name of the field to compare (Host.VMs, ...).
        key: Operation to do (=, <, >=, ...).
        value: Value to check against.
    Returns: See :py:func:`cfme.web_ui.fill`.
    """
    fill(
        count_form,
        dict(
            type="Count of",
            count=count,
            key=key,
            value=value,
        ),
    )
    # In case of advanced search box
    if sel.is_displayed(field_form.user_input):
        user_input = value is None
    else:
        user_input = None
    fill(field_form.user_input, user_input)
    sel.click(buttons.commit)
コード例 #9
0
def select_expression_by_text(text):
    sel.click(
        sel.element(
            "//a[contains(@id,'exp_')][contains(normalize-space(text()),'{}')]".format(text),
            root=_expressions_root()
        )
    )
コード例 #10
0
ファイル: explorer.py プロジェクト: patchkez/cfme_tests
    def edit_schema(self, add_fields=None, remove_fields=None):
        sel.force_navigate("automate_explorer_schema_edit", context={'tree_item': self})
        for remove_field in remove_fields or []:
            f = remove_field.get_form()
            fill(f, {}, action=f.remove_entry_button, action_always=True)

        for add_field in add_fields or []:
            sel.click(self.schema_edit_page.add_field_btn)
            f = add_field.get_form(blank=True)
            fill(f, {'name_text': add_field.name,
                     'type_select': add_field.type_,
                     'data_type_select': add_field.data_type,
                     'default_value_text': add_field.default_value,
                     'description_text': add_field.description,
                     'sub_cb': add_field.sub,
                     'collect_text': add_field.collect,
                     'message_text': add_field.message,
                     'on_entry_text': add_field.on_entry,
                     'on_exit_text': add_field.on_exit,
                     'max_retries_text': add_field.max_retries,
                     'max_time_text': add_field.max_time},
                 action=f.add_entry_button)

        sel.click(form_buttons.save)
        flash.assert_success_message('Schema for Automate Class "{}" was saved'.format(self.name))
コード例 #11
0
 def create(self):
     sel.force_navigate('catalog_item_new', context={'provider_type': self.item_type})
     sel.wait_for_element(basic_info_form.name_text)
     fill(basic_info_form, {'name_text': self.name,
                            'description_text': self.description,
                            'display_checkbox': self.display_in,
                            'select_catalog': self.catalog,
                            'select_dialog': self.dialog})
     tabstrip.select_tab("Request Info")
     template = template_select_form.template_table.find_row_by_cells({
         'Name': self.catalog_name,
         'Provider': self.provider
     })
     sel.click(template)
     web_ui.fill(request_form, {
         'instance_name': self.vm_name,
         'instance_type': self.instance_type,
         'guest_keypair': self.guest_keypair,
         'availability_zone': self.availability_zone,
         'cloud_tenant': self.cloud_tenant,
         'cloud_network': self.cloud_network,
         'security_groups': self.security_groups[0],  # not supporting multiselect now,
                                                      # just take first value
     })
     sel.click(template_select_form.add_button)
     flash.assert_success_message('Service Catalog Item "%s" was added' % self.name)
コード例 #12
0
ファイル: __init__.py プロジェクト: rrasouli/cfme_tests
    def add_deployment(self, filename, runtime_name=None, enable_deploy=True, cancel=False):
        """Clicks to "Add Deployment" button, in opened window fills fields by provided parameters,
        and deploys.

        Args:
            filename: Full path to file to import.
            runtime_name: Runtime name of deployment archive.
            enable_deploy: Whether to enable deployment archive or keep disabled.
            cancel: Whether to click Cancel instead of commit.
        """
        self.load_details()
        deploy_btn("Add Deployment")
        fill(
            import_form,
            {"file_select": filename},
        )
        if runtime_name:
            fill(
                import_form,
                {"runtime_name": runtime_name},
            )
        if not enable_deploy:
            fill(
                import_form,
                {"enable_deployment": enable_deploy}
            )
        sel.click(import_form.cancel_button if cancel else import_form.deploy_button)
        flash.assert_success_message('Deployment "{}" has been initiated on this server.'
                    .format(runtime_name if runtime_name else os.path.basename(filename)))
コード例 #13
0
ファイル: pxe.py プロジェクト: rrasouli/cfme_tests
 def _submit(self, cancel, submit_button):
     if cancel:
         sel.click(form_buttons.cancel)
         # sel.wait_for_element(page.configuration_btn)
     else:
         sel.click(submit_button)
         flash.assert_no_errors()
コード例 #14
0
ファイル: provider.py プロジェクト: slouderm/cfme_tests
 def _submit(self, cancel, submit_button):
     if cancel:
         sel.click(page_specific_locators.cancel_button)
         # sel.wait_for_element(page.configuration_btn)
     else:
         sel.click(submit_button)
         flash.assert_no_errors()
コード例 #15
0
ファイル: login.py プロジェクト: richardfontana/cfme_tests
def close_password_update_form():
    """ Goes back to main login form on login page """
    try:
        sel.click(page.back)
    except (ElementNotVisibleException, NoSuchElementException):
        # Already on main login form or not on login page at all
        pass
コード例 #16
0
 def delete_all_attached_vms(self):
     self.load_details()
     sel.click(details_page.infoblock.element("Relationships", "Managed VMs"))
     for q in Quadicon.all('vm'):
         fill(q.checkbox(), True)
     cfg_btn("Remove selected items from the VMDB", invokes_alert=True)
     sel.handle_alert(cancel=False)
コード例 #17
0
ファイル: toolbar.py プロジェクト: anewmanRH/cfme_tests
def refresh():
    """Refreshes page, attempts to use cfme refresh button otherwise falls back to browser refresh.
    """
    if sel.is_displayed(RELOAD_LOC):
        sel.click(RELOAD_LOC)
    else:
        sel.refresh()
コード例 #18
0
ファイル: myservice.py プロジェクト: pombredanne/cfme_tests
    def check_vm_add(self, add_vm_name):
        sel.force_navigate('service',
                           context={'service_name': self.service_name})

        quadicon = Quadicon(add_vm_name, "vm")
        sel.click(quadicon)
        flash.assert_no_errors()
コード例 #19
0
ファイル: ui_elements.py プロジェクト: MattLombana/cfme_tests
 def deselect(self, *items):
     self._close_combo()
     for item in items:
         sel.click(
             sel.element(
                 self._remove_button.format(item),
                 root=sel.element(self._root_loc)))
コード例 #20
0
 def current_snapshot_name(self):
     """Returns the current snapshot name."""
     self.load_details(refresh=True)
     sel.click(InfoBlock("Properties", "Snapshots"))
     text = sel.text("//a[contains(normalize-space(.), '(Active)')]|"
         "//li[contains(normalize-space(.), '(Active)')]").strip()
     return re.sub(r"\s*\(Active\)$", "", text)
コード例 #21
0
    def compare(self, *objects, **kwargs):
        """Compares two or more objects in the genealogy.

        Args:
            *objects: :py:class:`Vm` or :py:class:`Template` or :py:class:`str` with name.

        Keywords:
            sections: Which sections to compare.
            attributes: `all`, `different` or `same`. Default: `all`.
            mode: `exists` or `details`. Default: `exists`."""
        sections = kwargs.get("sections", None)
        attributes = kwargs.get("attributes", "all").lower()
        mode = kwargs.get("mode", "exists").lower()
        assert len(objects) >= 2, "You must specify at least two objects"
        objects = map(lambda o: o.name if isinstance(o, (Vm, Template)) else o, objects)
        self.navigate()
        for obj in objects:
            if not isinstance(obj, list):
                path = self.genealogy_tree.find_path_to(obj)
            self.genealogy_tree.check_node(*path)
        toolbar.select("Compare selected VMs")
        # COMPARE PAGE
        flash.assert_no_errors()
        if sections is not None:
            map(lambda path: self.section_comparison_tree.check_node(*path), sections)
            sel.click(self.apply_button)
            flash.assert_no_errors()
        # Set requested attributes sets
        toolbar.select(self.attr_mapping[attributes])
        # Set the requested mode
        toolbar.select(self.mode_mapping[mode])
コード例 #22
0
ファイル: multibox.py プロジェクト: weissjeffm/cfme_tests
    def _move_to_selected(self):
        """ Clicks the button for moving items from unselected to selected.

        Returns: :py:class:`bool` with success.
        """
        sel.click(sel.element(self._to_selected))
        return not any(map(flash.is_error, flash.get_all_messages()))
コード例 #23
0
def select_expression_by_text(text):
    sel.click(
        sel.element(
            "//a[contains(@id,'exp_')][contains(text(),'%s')]" % text,
            root=_expressions_root()
        )
    )
コード例 #24
0
 def order(self):
     navigate_to(self, 'Order')
     if self.stack_data:
         stack_form.fill(self.stack_data)
     sel.click(form_buttons.submit)
     wait_for(flash.get_messages, num_sec=10, delay=2, fail_condition=[], fail_func=tb.refresh())
     flash.assert_success_message("Order Request was Submitted")
コード例 #25
0
ファイル: vm.py プロジェクト: rananda/cfme_tests
 def set_ownership(self, user=None, group=None, click_cancel=False, click_reset=False):
     """Set ownership of the VM/Instance or Template/Image"""
     sel.click(self.find_quadicon(False, False, False, use_search=False))
     cfg_btn('Set Ownership')
     if click_reset:
         action = form_buttons.reset
         msg_assert = partial(
             flash.assert_message_match,
             'All changes have been reset'
         )
     elif click_cancel:
         action = form_buttons.cancel
         msg_assert = partial(
             flash.assert_success_message,
             'Set Ownership was cancelled by the user'
         )
     else:
         action = form_buttons.save
         msg_assert = partial(
             flash.assert_success_message,
             'Ownership saved for selected {}'.format(self.VM_TYPE)
         )
     fill(set_ownership_form, {'user_name': user, 'group_name': group},
          action=action)
     msg_assert()
コード例 #26
0
ファイル: dashboard.py プロジェクト: FilipB/cfme_tests
 def _click_menu_button_by_loc(self, loc):
     self.close_zoom()
     try:
         self.open_dropdown_menu()
         sel.click(loc.format(self._div_id))
     finally:
         self.close_dropdown_menu()
コード例 #27
0
 def _retrieve_ext_auth_user_groups(self):
     navigate_to(self, 'Add')
     fill(self.group_form, {'lookup_ldap_groups_chk': True,
                            'user_to_look_up': self.user_to_lookup,
                            },)
     sel.wait_for_element(form_buttons.retrieve)
     sel.click(form_buttons.retrieve)
コード例 #28
0
ファイル: toolbar.py プロジェクト: kbrock/cfme_tests
def select(root, sub=None, invokes_alert=False):
    """ Clicks on a button by calling the :py:meth:`click_n_move` method.

    Args:
        root: The root button's name as a string.
        sub: The sub button's name as a string. (optional)
        invokes_alert: If ``True``, then the behaviour is little bit different. After the last
            click, no ajax wait and no move away is done to be able to operate the alert that
            appears after click afterwards. Defaults to ``False``.
    Returns: ``True`` if the button was enabled at time of clicking, ``False`` if not.
    """
    if not is_greyed(root):
        if sub is None and invokes_alert:
            # We arrived into a place where alert will pop up so no moving and no ajax
            sel.click(root_loc(root), wait_ajax=False)
        else:
            select_n_move(root_loc(root))
    else:
        return False
    if sub:
        if not is_greyed(root, sub):
            if invokes_alert:
                # We arrived into a place where alert will pop up so no moving and no ajax
                sel.click(sub_loc(sub), wait_ajax=False)
            else:
                select_n_move(sub_loc(sub))
        else:
            return False
    return True
コード例 #29
0
ファイル: menu.py プロジェクト: weissjeffm/cfme_tests
 def f(_):
     toplevel_elem = sel.element(toplevel_loc % toplevel)
     if secondlevel is None:
         sel.click(toplevel_elem)
     else:
         sel.move_to_element(toplevel_elem)
         sel.click(sel.element(secondlevel_loc % (toplevel, secondlevel)))
コード例 #30
0
ファイル: test_stack.py プロジェクト: petrblaho/cfme_tests
def set_grid_view(name):
    bg = ButtonGroup(name)
    sel.force_navigate("my_settings_default_views")
    default_view = bg.active
    if(default_view != 'Grid View'):
        bg.choose('Grid View')
        sel.click(form_buttons.save)
コード例 #31
0
details_page = Region(infoblock_type='detail')

cfg_btn = partial(tb.select, 'Configuration')
pol_btn = partial(tb.select, 'Policy')


def nav_to_datastore_through_provider(context):
    sel.force_navigate('infrastructure_provider', context=context)
    list_acc.select('Relationships', 'Show all managed Datastores')
    sel.click(Quadicon(context['datastore'].name, 'datastore'))


nav.add_branch(
    'infrastructure_datastores', {
        'infrastructure_datastore':
        lambda ctx: sel.click(Quadicon(ctx['datastore'].name, 'datastore'))
        if 'provider' not in ctx else nav_to_datastore_through_provider(ctx)
    })


class Datastore(object):
    """ Model of an infrastructure datastore in cfme

    Args:
        name: Name of the datastore.
        provider_key: Name of the provider this datastore is attached to.

    Note:
        If given a provider_key, it will navigate through ``Infrastructure/Providers`` instead
        of the direct path through ``Infrastructure/Datastores``.
    """
コード例 #32
0
 def step(self):
     sel.click(InfoBlock.element('Relationships', 'Middleware Deployments'))
コード例 #33
0
 def step(self):
     sel.click(InfoBlock.element('Relationships', 'Middleware Datasources'))
コード例 #34
0
 def step(self):
     sel.click(InfoBlock.element('Relationships', 'Middleware Servers'))
コード例 #35
0
 def step(self):
     sel.click(Quadicon(self.obj.name, self.obj.quad_name))
コード例 #36
0
ファイル: node.py プロジェクト: lukas-bednar/cfme_tests
 def click_element(self, *ident):
     self.load_details(refresh=True)
     return sel.click(details_page.infoblock.element(*ident))
コード例 #37
0
def nav_to_datastore_through_provider(context):
    sel.force_navigate('infrastructure_provider', context=context)
    list_acc.select('Relationships', 'Show all managed Datastores')
    sel.click(Quadicon(context['datastore'].name, 'datastore'))
コード例 #38
0
 def __call__(self, *args, **kwargs):
     """For maintaining backward compatibility"""
     sel.click(self)
コード例 #39
0
 def delete_all_templates(self):
     view = navigate_to(self, "TemplateType")
     sel.click(pg.check_all())
     view.configuration.item_select(
         "Remove selected Orchestration Templates", handle_alert=True)
コード例 #40
0
def check_and_click_close():
    """Check for display of advanced search close button and click it"""
    if sel.is_displayed(search_box.close_button):
        logger.debug(
            'search.check_and_click_close: clicking advanced search close')
        sel.click(search_box.close_button)
コード例 #41
0
 def close_zoom(cls):
     if cls.is_zoomed():
         sel.click(cls._zoomed_close)
         # Here no ajax, so we have to check it manually
         wait_for(lambda: not cls.is_zoomed(), delay=0.1, num_sec=5, message="cancel zoom")
コード例 #42
0
def _fill_fb_bool(fb, b):
    if b:
        sel.click(fb)
コード例 #43
0
def _go_to(cls, dest='All'):
    """Create a thunk that navigates to the given destination"""
    return lambda: navigate_to(cls, dest)


@pytest.mark.tier(3)
@pytest.mark.parametrize(
    'role,allowed_actions,disallowed_actions',
    [
        [
            _mk_role(product_features=[
                [['Everything'], False],  # minimal permission
                [['Everything', 'Settings', 'Tasks'], True]
            ]),
            {
                'tasks': lambda: sel.click(tasks.buttons.default)
            },  # can only access one thing
            {
                'my services': _go_to(MyService),
                'chargeback': _go_to(Server, 'Chargeback'),
                'clouds providers': _go_to(base_types()['cloud']),
                'infrastructure providers': _go_to(base_types()['infra']),
                'control explorer': _go_to(Server, 'ControlExplorer'),
                'automate explorer': _go_to(Server, 'AutomateExplorer')
            }
        ],
        [
            _mk_role(
                product_features=[[['Everything'], True]]),  # full permissions
            {
                'my services': _go_to(MyService),
コード例 #44
0
def click_help(item):
    base_locator = '//nav//a[@id="dropdownMenu1"]/../ul//a[normalize-space(.)="{}"]'
    sel.click(page.help_dropdown)
    sel.click(base_locator.format(item), wait_ajax=False)
    sel.handle_alert(wait=False)
コード例 #45
0
 def remove(loc):
     """Return a callable that clicks but still allows popup dismissal"""
     return lambda _: sel.click(loc, wait_ajax=False)
コード例 #46
0
 def _click_menu_button_by_loc(self, loc):
     self.close_zoom()
     self.open_dropdown_menu()
     sel.click(loc.format(self._div_id))
コード例 #47
0
 def cloud_provider_quad(self, value):
     sel.force_navigate("my_settings_visual")
     fill(self.quadicons_form.cloud_provider_quad, str(value))
     sel.click(form_buttons.save)
コード例 #48
0
 def check_vm_add(self, add_vm_name):
     view = navigate_to(self, 'Details')
     # TODO - replace Quadicon later
     quadicon = Quadicon(add_vm_name, "vm")
     sel.click(quadicon)
     view.flash.assert_no_error()
コード例 #49
0
 def login_page(self, value):
     sel.force_navigate("my_settings_visual")
     fill(self.startpage_form.login_page, str(value))
     sel.click(form_buttons.save)
コード例 #50
0
 def timezone(self, value):
     sel.force_navigate("my_settings_visual")
     fill(self.display_form.time_zone, str(value))
     sel.click(form_buttons.save)
コード例 #51
0
ファイル: stack.py プロジェクト: vprusa/cfme_tests
 def nav_to_resources_link(self):
     sel.force_navigate('clouds_stack', context={'stack': self})
     sel.click(details_page.infoblock.element("Relationships", "Resources"))
コード例 #52
0
 def template_quad(self, value):
     sel.force_navigate("my_settings_visual")
     fill(self.quadicons_form.template_quad, str(value))
     sel.click(form_buttons.save)
コード例 #53
0
ファイル: stack.py プロジェクト: vprusa/cfme_tests
    '5.5':
    Table('//div[@id="list_grid"]/table'),
    '5.4':
    SplitTable(
        ('//*[@id="list_grid"]//table[contains(@class, "hdr")]/tbody', 1),
        ('//*[@id="list_grid"]//table[contains(@class, "obj")]/tbody', 1))
})

edit_tags_form = Form(fields=[(
    "select_tag",
    ui.Select("select#tag_cat")), ("select_value",
                                   ui.Select("select#tag_add"))])

nav.add_branch('clouds_stacks', {
    'clouds_stack':
    lambda ctx: sel.click(Quadicon(ctx['stack'].name, 'stack'))
})


class Stack(Pretty):
    pretty_attrs = ['name']

    def __init__(self, name=None):
        self.name = name

    def delete(self):
        sel.force_navigate('clouds_stack', context={'stack': self})
        cfg_btn("Remove this Stack from the VMDB", invokes_alert=True)
        sel.handle_alert()
        flash.assert_success_message(
            'The selected Orchestration Stack was deleted')
コード例 #54
0
 def report_view_limit(self, value):
     sel.force_navigate("my_settings_visual")
     fill(self.item_form.reports, str(value))
     sel.click(form_buttons.save)
コード例 #55
0
def click_element(el):
    '''Advance the page until the given element is displayed, and click it'''
    find_element(el)
    sel.click(el)
コード例 #56
0
ファイル: stack.py プロジェクト: vprusa/cfme_tests
 def nav_to_output_link(self):
     sel.force_navigate('clouds_stack', context={'stack': self})
     sel.click(details_page.infoblock.element("Relationships", "Outputs"))
     cells = {'Key': "WebsiteURL"}
     output_table().click_rows_by_cells(cells, "Key", True)
コード例 #57
0
            version.LOWEST: properties_form_55,
            '5.6': properties_form_56,
        }
    }
)

details_page = Region(infoblock_type='detail')

cfg_btn = partial(tb.select, 'Configuration')
pol_btn = partial(tb.select, 'Policy')
mon_btn = partial(tb.select, 'Monitoring')

nav.add_branch('clouds_providers',
               {'clouds_provider_new': lambda _: cfg_btn('Add a New Cloud Provider'),
                'clouds_provider_discover': lambda _: cfg_btn('Discover Cloud Providers'),
                'clouds_provider': [lambda ctx: sel.click(Quadicon(ctx['provider'].name,
                                                                  'cloud_prov')),
                                   {'clouds_provider_edit':
                                    lambda _: cfg_btn('Edit this Cloud Provider'),
                                    'clouds_provider_policy_assignment':
                                    lambda _: pol_btn('Manage Policies'),
                                    'cloud_provider_timelines':
                                    lambda _: mon_btn('Timelines')}]})


class Provider(Pretty, CloudInfraProvider):
    """
    Abstract model of a cloud provider in cfme. See EC2Provider or OpenStackProvider.

    Args:
        name: Name of the provider.
        details: a details record (see EC2Details, OpenStackDetails inner class).
コード例 #58
0
ファイル: login.py プロジェクト: vrutkovs/cfme_tests
def click_on_login():
    """
    Convenience internal function to click the login locator submit button.
    """
    sel.click(page.submit_button)
コード例 #59
0
ファイル: resource_pool.py プロジェクト: vrutkovs/cfme_tests
from cfme.web_ui import Quadicon, Region, toolbar as tb
from functools import partial
from utils.pretty import Pretty
from utils.providers import get_crud
from utils.wait import wait_for

details_page = Region(infoblock_type='detail')

cfg_btn = partial(tb.select, 'Configuration')
pol_btn = partial(tb.select, 'Policy')


nav.add_branch(
    'infrastructure_resource_pools', {
        'infrastructure_resource_pool':
        lambda ctx: sel.click(Quadicon(ctx['resource_pool'].name, 'resource_pool'))
    }
)


class ResourcePool(Pretty):
    """ Model of an infrastructure Resource pool in cfme

    Args:
        name: Name of the Resource pool.
        provider_key: Name of the provider this resource pool is attached to.

    Note:
        If given a provider_key, it will navigate through ``Infrastructure/Providers`` instead
        of the direct path through ``Infrastructure/Resourcepool``.
    """
コード例 #60
0
def reset():
    """Reset the paginator to the first page or do nothing if no pages"""
    if 'dimmed' not in first().get_attribute('class'):
        sel.click(first())