• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python ui.navigate_to函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中utils.appliance.endpoints.ui.navigate_to函数的典型用法代码示例。如果您正苦于以下问题:Python navigate_to函数的具体用法?Python navigate_to怎么用?Python navigate_to使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了navigate_to函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: exists

 def exists(self):
     navigate_to(self, 'All')
     for page in paginator.pages():
         if sel.is_displayed(Quadicon(self.name, 'host')):
             return True
     else:
         return False
开发者ID:anewmanRH,项目名称:cfme_tests,代码行数:7,代码来源:host.py


示例2: discover

def discover(credential, cancel=False, d_type="Amazon"):
    """
    Discover cloud providers. Note: only starts discovery, doesn't
    wait for it to finish.

    Args:
      credential (cfme.Credential):  Amazon discovery credentials.
      cancel (boolean):  Whether to cancel out of the discover UI.
    """
    navigate_to(Provider, "Discover")
    form_data = {"discover_select": d_type}
    if credential:
        form_data.update(
            {
                "username": credential.principal,
                "password": credential.secret,
                "password_verify": credential.verify_secret,
            }
        )
    fill(
        discover_form,
        form_data,
        action=form_buttons.cancel if cancel else discover_form.start_button,
        action_always=True,
    )
开发者ID:anewmanRH,项目名称:cfme_tests,代码行数:25,代码来源:__init__.py


示例3: discover

def discover(rhevm=False, vmware=False, scvmm=False, cancel=False, start_ip=None, end_ip=None):
    """
    Discover infrastructure providers. Note: only starts discovery, doesn't
    wait for it to finish.

    Args:
        rhevm: Whether to scan for RHEVM providers
        vmware: Whether to scan for VMware providers
        scvmm: Whether to scan for SCVMM providers
        cancel:  Whether to cancel out of the discover UI.
        start_ip: String start of the IP range for discovery
        end_ip: String end of the IP range for discovery
    """
    navigate_to(Provider, 'Discover')
    form_data = {}
    if rhevm:
        form_data.update({'rhevm_chk': True})
    if vmware:
        form_data.update({'vmware_chk': True})
    if scvmm:
        form_data.update({'scvmm_chk': True})

    if start_ip:
        for idx, octet in enumerate(start_ip.split('.')):
            key = 'from_%i' % idx
            form_data.update({key: octet})
    if end_ip:
        end_octet = end_ip.split('.')[-1]
        form_data.update({'to_3': end_octet})

    fill(discover_form, form_data,
         action=form_buttons.cancel if cancel else discover_form.start_button,
         action_always=True)
开发者ID:rrasouli,项目名称:cfme_tests,代码行数:33,代码来源:__init__.py


示例4: test_clear_host_filter_results

def test_clear_host_filter_results(provider):
    """ Test for clearing filter results for hosts."""

    navigate_to(Host, 'All')
    list_acc.select('Filters', 'Status / Stopped', by_title=False)
    pytest.sel.click(search_box.clear_advanced_search)
    page_title = pytest.sel.text(host.page_title_loc)
    assert page_title == 'Hosts', 'Clear filter results failed'
开发者ID:anewmanRH,项目名称:cfme_tests,代码行数:8,代码来源:test_set_default_filter.py


示例5: test_openstack_provider_has_api_version

def test_openstack_provider_has_api_version():
    """Check whether the Keystone API version field is present for Openstack."""
    prov = Provider()
    navigate_to(prov, 'Add')
    fill(prop_region.properties_form, {"type_select": "OpenStack"})
    pytest.sel.wait_for_ajax()
    assert pytest.sel.is_displayed(
        prov.properties_form.api_version), "API version select is not visible"
开发者ID:rrasouli,项目名称:cfme_tests,代码行数:8,代码来源:test_providers.py


示例6: exists

 def exists(self):
     try:
         navigate_to(self, "All")
         quad = Quadicon(self.name, self.quad_name)
         if sel.is_displayed(quad):
             return True
     except sel.NoSuchElementException:
         return False
开发者ID:anewmanRH,项目名称:cfme_tests,代码行数:8,代码来源:resource_pool.py


示例7: has_valid_credentials

    def has_valid_credentials(self):
        """ Check if host has valid credentials saved

        Returns: ``True`` if credentials are saved and valid; ``False`` otherwise
        """
        navigate_to(self, 'All')
        quad = Quadicon(self.name, 'host')
        return 'checkmark' in quad.creds
开发者ID:anewmanRH,项目名称:cfme_tests,代码行数:8,代码来源:host.py


示例8: delete

 def delete(self, cancel=False):
     navigate_to(self, 'Details')
     if version.current_version() >= '5.7':
         btn_name = "Remove Dialog"
     else:
         btn_name = "Remove from the VMDB"
     cfg_btn(btn_name, invokes_alert=True)
     sel.handle_alert(cancel)
开发者ID:anewmanRH,项目名称:cfme_tests,代码行数:8,代码来源:provisioning_dialogs.py


示例9: execute_button

 def execute_button(self, button_group, button, cancel=True):
     navigate_to(self, 'Details')
     host_btn = partial(tb.select, button_group)
     host_btn(button, invokes_alert=True)
     sel.click(form_buttons.submit)
     flash.assert_success_message("Order Request was Submitted")
     host_btn(button, invokes_alert=True)
     sel.click(form_buttons.cancel)
     flash.assert_success_message("Service Order was cancelled by the user")
开发者ID:anewmanRH,项目名称:cfme_tests,代码行数:9,代码来源:host.py


示例10: get_detail

    def get_detail(self, *ident):
        """ Gets details from the details infoblock

        Args:
            *ident: An InfoBlock title, followed by the Key name, e.g. "Relationships", "Images"
        Returns: A string representing the contents of the InfoBlock's value.
        """
        navigate_to(self, 'Details')
        return details_page.infoblock.text(*ident)
开发者ID:anewmanRH,项目名称:cfme_tests,代码行数:9,代码来源:__init__.py


示例11: delete

    def delete(self, cancel=True):
        """Deletes a resource pool from CFME

        Args:
            cancel: Whether to cancel the deletion, defaults to True
        """
        navigate_to(self, "Details")
        cfg_btn("Remove from the VMDB", invokes_alert=True)
        sel.handle_alert(cancel=cancel)
开发者ID:anewmanRH,项目名称:cfme_tests,代码行数:9,代码来源:resource_pool.py


示例12: test_filter_without_user_input

def test_filter_without_user_input(hosts, hosts_with_vm_count, host_with_median_vm):
    navigate_to(Host, 'All')
    median_host, median_vm_count = host_with_median_vm
    # We will filter out hosts with less than median VMs
    more_than_median_hosts = list(dropwhile(lambda h: h[1] <= median_vm_count, hosts_with_vm_count))
    # Set up the filter
    search.fill_and_apply_filter(get_expression(False).format(median_vm_count))
    assert_no_cfme_exception()
    assert len(more_than_median_hosts) == len(host.get_all_hosts(do_not_navigate=True))
开发者ID:anewmanRH,项目名称:cfme_tests,代码行数:9,代码来源:test_advanced_search_host.py


示例13: hosts

def hosts():
    """Ensure the infra providers are set up and get list of hosts"""
    try:
        setup_a_provider(prov_class="infra")
    except Exception:
        pytest.skip("It's not possible to set up any providers, therefore skipping")
    navigate_to(Host, 'All')
    search.ensure_no_filter_applied()
    return host.get_all_hosts()
开发者ID:anewmanRH,项目名称:cfme_tests,代码行数:9,代码来源:test_advanced_search_host.py


示例14: wait_for_appear

 def wait_for_appear(self):
     navigate_to(self, "All")
     wait_for(
         lambda: self.exists,
         fail_condition=False,
         message="Wait resource pool to appear",
         num_sec=1000,
         fail_func=sel.refresh,
     )
开发者ID:anewmanRH,项目名称:cfme_tests,代码行数:9,代码来源:resource_pool.py


示例15: test_filter_save_cancel

def test_filter_save_cancel(hosts, hosts_with_vm_count, host_with_median_vm):
    navigate_to(Host, 'All')
    median_host, median_vm_count = host_with_median_vm
    filter_name = fauxfactory.gen_alphanumeric()
    # Try save filter
    search.save_filter(get_expression(True), filter_name, cancel=True)
    assert_no_cfme_exception()
    with pytest.raises(pytest.sel.NoSuchElementException):
        search.load_filter(filter_name)  # does not exist
开发者ID:anewmanRH,项目名称:cfme_tests,代码行数:9,代码来源:test_advanced_search_host.py


示例16: set_pxe_image_type

 def set_pxe_image_type(self, image_name, image_type):
     """
     Function to set the image type of a PXE image
     """
     if self.get_pxe_image_type(image_name) != image_type:
         navigate_to(self, 'All')
         pxe_tree(self.name, 'PXE Images', image_name)
         cfg_btn('Edit this PXE Image')
         fill(pxe_image_type_form, {'image_type': image_type}, action=form_buttons.save)
开发者ID:rrasouli,项目名称:cfme_tests,代码行数:9,代码来源:pxe.py


示例17: run_smartstate_analysis

    def run_smartstate_analysis(self):
        """ Runs smartstate analysis on this host

        Note:
            The host must have valid credentials already set up for this to work.
        """
        navigate_to(self, 'Details')
        tb.select('Configuration', 'Perform SmartState Analysis', invokes_alert=True)
        sel.handle_alert()
        flash.assert_message_contain('"{}": Analysis successfully initiated'.format(self.name))
开发者ID:anewmanRH,项目名称:cfme_tests,代码行数:10,代码来源:host.py


示例18: exists_ui

 def exists_ui(self):
     """
     Checks if the ISO Datastore already exists via UI
     """
     navigate_to(self, 'All')
     try:
         iso_tree(self.provider)
         return True
     except CandidateNotFound:
         return False
开发者ID:rrasouli,项目名称:cfme_tests,代码行数:10,代码来源:pxe.py


示例19: wait_for_a_provider

def wait_for_a_provider():
    navigate_to(Provider, "All")
    logger.info("Waiting for a provider to appear...")
    wait_for(
        paginator.rec_total,
        fail_condition=None,
        message="Wait for any provider to appear",
        num_sec=1000,
        fail_func=sel.refresh,
    )
开发者ID:anewmanRH,项目名称:cfme_tests,代码行数:10,代码来源:__init__.py


示例20: get_all_hosts

def get_all_hosts(do_not_navigate=False):
    """Returns list of all hosts"""
    if not do_not_navigate:
        navigate_to(Host, 'All')
    hosts = set([])
    for page in paginator.pages():
        for title in sel.elements(
                "//div[@id='quadicon']/../../../tr/td/a[contains(@href,'host/show')]"):
            hosts.add(sel.get_attribute(title, "title"))
    return hosts
开发者ID:anewmanRH,项目名称:cfme_tests,代码行数:10,代码来源:host.py



注:本文中的utils.appliance.endpoints.ui.navigate_to函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python ui.navigate_to函数代码示例发布时间:2022-05-26
下一篇:
Python appliance.Navigatable类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap