当前位置: 首页>>代码示例>>Python>>正文


Python buttons.ButtonGroup类代码示例

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


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

示例1: test_button_avp_displayed

def test_button_avp_displayed(dialog, request):
    """This test checks whether the Attribute/Values pairs are displayed in the dialog.
       automates 1229348
    Steps:
        * Open a dialog to create a button.
        * Locate the section with attribute/value pairs.
    """
    # This is optional, our nav tree does not have unassigned button
    buttongroup = ButtonGroup(
        text=fauxfactory.gen_alphanumeric(),
        hover="btn_desc_{}".format(fauxfactory.gen_alphanumeric()),
        type=ButtonGroup.VM_INSTANCE)
    request.addfinalizer(buttongroup.delete_if_exists)
    buttongroup.create()
    button = Button(group=buttongroup,
                    text=fauxfactory.gen_alphanumeric(),
                    hover="btn_hvr_{}".format(fauxfactory.gen_alphanumeric()),
                    dialog=dialog, system="Request", request="InspectMe")
    navigate_to(button, 'Add')
    section_loc = "//*[(self::h3 or self::p) and normalize-space(text())='Attribute/Value Pairs']"
    assert sel.is_displayed(section_loc),\
        "The Attribute/Value Pairs part of the form is not displayed"
    for i in range(1, 6):
        assert sel.is_displayed('#attribute_{}'.format(i))
        assert sel.is_displayed('#value_{}'.format(i))
开发者ID:dajohnso,项目名称:cfme_tests,代码行数:25,代码来源:test_buttons.py

示例2: testing_group

def testing_group(request):
    group_desc = fauxfactory.gen_alphanumeric()
    group = ButtonGroup(
        text=group_desc,
        hover=group_desc,
        type=ButtonGroup.VM_INSTANCE
    )
    request.addfinalizer(group.delete_if_exists)
    group.create()
    return group
开发者ID:seandst,项目名称:cfme_tests,代码行数:10,代码来源:test_vmware_methods.py

示例3: testing_group

def testing_group(request):
    group_desc = generate_random_string()
    group = ButtonGroup(
        text=group_desc,
        hover=group_desc,
        type=ButtonGroup.VM_INSTANCE
    )
    request.addfinalizer(group.delete_if_exists)
    group.create()
    return group
开发者ID:petrblaho,项目名称:cfme_tests,代码行数:10,代码来源:test_vmware_methods.py

示例4: testing_group

def testing_group(request):
    group_desc = fauxfactory.gen_alphanumeric()
    group = ButtonGroup(
        text=group_desc,
        hover=group_desc,
        type=ButtonGroup.VM_INSTANCE
    )
    group.create()
    yield group
    group.delete_if_exists()
开发者ID:MattLombana,项目名称:cfme_tests,代码行数:10,代码来源:test_vmware_methods.py

示例5: test_button_on_host

def test_button_on_host(appliance, request, provider, setup_provider):
    buttongroup = ButtonGroup(
        text=fauxfactory.gen_alphanumeric(),
        hover="btn_desc_{}".format(fauxfactory.gen_alphanumeric()))
    buttongroup.type = buttongroup.HOST
    request.addfinalizer(buttongroup.delete_if_exists)
    buttongroup.create()
    button = Button(group=buttongroup,
                    text=fauxfactory.gen_alphanumeric(),
                    hover="btn_hvr_{}".format(fauxfactory.gen_alphanumeric()),
                    system="Request", request="InspectMe")
    request.addfinalizer(button.delete_if_exists)
    button.create()
    host = appliance.collections.hosts.all(provider)[0]
    host.execute_button(buttongroup.hover, button.text, handle_alert=None)
开发者ID:hhovsepy,项目名称:cfme_tests,代码行数:15,代码来源:test_buttons.py

示例6: test_button_crud

def test_button_crud(dialog, request):
    buttongroup = ButtonGroup(
        text=fauxfactory.gen_alphanumeric(),
        hover="btn_desc_{}".format(fauxfactory.gen_alphanumeric()),
        type=ButtonGroup.SERVICE)
    request.addfinalizer(buttongroup.delete_if_exists)
    buttongroup.create()
    button = Button(group=buttongroup,
                    text=fauxfactory.gen_alphanumeric(),
                    hover="btn_hvr_{}".format(fauxfactory.gen_alphanumeric()),
                    dialog=dialog, system="Request", request="InspectMe")
    request.addfinalizer(button.delete_if_exists)
    button.create()
    with update(button):
        button.hover = "edit_desc_{}".format(fauxfactory.gen_alphanumeric())
    button.delete()
开发者ID:pombredanne,项目名称:cfme_tests,代码行数:16,代码来源:test_buttons.py

示例7: test_button_on_host

def test_button_on_host(dialog, request):
    buttongroup = ButtonGroup(
        text=fauxfactory.gen_alphanumeric(),
        hover="btn_desc_{}".format(fauxfactory.gen_alphanumeric()),
        type=ButtonGroup.HOST)
    request.addfinalizer(buttongroup.delete_if_exists)
    buttongroup.create()
    button = Button(group=buttongroup,
                    text=fauxfactory.gen_alphanumeric(),
                    hover="btn_hvr_{}".format(fauxfactory.gen_alphanumeric()),
                    dialog=dialog, system="Request", request="InspectMe")
    request.addfinalizer(button.delete_if_exists)
    button.create()
    myhost = host.get_from_config('esx')
    if not myhost.exists:
        myhost.create()
    myhost.execute_button(buttongroup.hover, button.text)
开发者ID:pombredanne,项目名称:cfme_tests,代码行数:17,代码来源:test_buttons.py

示例8: test_button_avp_displayed

def test_button_avp_displayed(request):
    """This test checks whether the Attribute/Values pairs are displayed in the dialog.

    Steps:
        * Open a dialog to create a button.
        * Locate the section with attribute/value pairs.
    """
    # This is optional, our nav tree does not have unassigned button
    buttongroup = ButtonGroup(
        text=fauxfactory.gen_alphanumeric(),
        hover="btn_desc_{}".format(fauxfactory.gen_alphanumeric()),
        type=ButtonGroup.VM_INSTANCE)
    request.addfinalizer(buttongroup.delete_if_exists)
    buttongroup.create()
    pytest.sel.force_navigate("new_button", context={'buttongroup': buttongroup})
    assert (pytest.sel.is_displayed(
        "//*[(self::h3 or self::p) and normalize-space(text())='Attribute/Value Pairs']"),
        "The Attribute/Value Pairs part of the form is not displayed")
开发者ID:pombredanne,项目名称:cfme_tests,代码行数:18,代码来源:test_buttons.py

示例9: test_button_crud

def test_button_crud(dialog, request):
    """Test Creating a Button

    Prerequisities:
        * An Button Group

    Steps:
        * Create a Button with random button text and button hover text, and random request
        * Assert that the button exists
        * Assert that the entered values correspond with what is displayed on the details page
        * Change the hover text, ensure the text is changed on details page
        * Delete the button
        * Assert that the button no longer exists.
    """
    buttongroup = ButtonGroup(
        text=fauxfactory.gen_alphanumeric(), hover=fauxfactory.gen_alphanumeric(), type=ButtonGroup.SERVICE
    )
    request.addfinalizer(buttongroup.delete_if_exists)
    buttongroup.create()
    button = Button(
        group=buttongroup,
        text=fauxfactory.gen_alphanumeric(),
        hover=fauxfactory.gen_alphanumeric(),
        dialog=dialog,
        system="Request",
        request="InspectMe",
    )
    request.addfinalizer(button.delete_if_exists)
    button.create()
    assert button.exists
    view = navigate_to(button, "Details")
    assert view.text.text == button.text
    assert view.hover.text == button.hover
    edited_hover = "edited {}".format(fauxfactory.gen_alphanumeric())
    with update(button):
        button.hover = edited_hover
    assert button.exists
    view = navigate_to(button, "Details")
    assert view.hover.text == edited_hover
    button.delete(cancel=True)
    assert button.exists
    button.delete()
    assert not button.exists
开发者ID:RonnyPfannschmidt,项目名称:cfme_tests,代码行数:43,代码来源:test_buttons.py

示例10: test_button_avp_displayed

def test_button_avp_displayed(dialog, request):
    """This test checks whether the Attribute/Values pairs are displayed in the dialog.
       automates 1229348
    Steps:
        * Open a dialog to create a button.
        * Locate the section with attribute/value pairs.
    """
    # This is optional, our nav tree does not have unassigned button
    buttongroup = ButtonGroup(
        text=fauxfactory.gen_alphanumeric(),
        hover="btn_desc_{}".format(fauxfactory.gen_alphanumeric()),
        type=ButtonGroup.VM_INSTANCE)
    request.addfinalizer(buttongroup.delete_if_exists)
    buttongroup.create()
    button = Button(group=buttongroup,
                    text=fauxfactory.gen_alphanumeric(),
                    hover="btn_hvr_{}".format(fauxfactory.gen_alphanumeric()),
                    dialog=dialog, system="Request", request="InspectMe")
    view = navigate_to(button, 'Add')
    assert view.advanced.attribute_1.is_displayed
    assert view.advanced.value_1.is_displayed
开发者ID:hhovsepy,项目名称:cfme_tests,代码行数:21,代码来源:test_buttons.py

示例11: retire_extend_button

def retire_extend_button(request):
    grp_name = "grp_{}".format(fauxfactory.gen_alphanumeric())
    grp = ButtonGroup(
        text=grp_name,
        hover=grp_name,
        type=ButtonGroup.VM_INSTANCE
    )
    request.addfinalizer(lambda: grp.delete_if_exists())
    grp.create()
    btn_name = "btn_{}".format(fauxfactory.gen_alphanumeric())
    button = Button(
        group=grp,
        text=btn_name,
        hover=btn_name,
        system="Request",
        request="vm_retire_extend"
    )
    request.addfinalizer(lambda: button.delete_if_exists())
    button.create()

    return lambda: toolbar.select(grp.text, button.text)
开发者ID:pombredanne,项目名称:cfme_tests,代码行数:21,代码来源:test_common_methods.py

示例12: test_button_group_crud

def test_button_group_crud(request):
    buttongroup = ButtonGroup(
        text=fauxfactory.gen_alphanumeric(), hover="btn_hvr", type=ButtonGroup.SERVICE)
    request.addfinalizer(buttongroup.delete_if_exists)
    buttongroup.create()
    with update(buttongroup):
        buttongroup.hover = "edit_desc_{}".format(fauxfactory.gen_alphanumeric())
    buttongroup.delete()
开发者ID:pombredanne,项目名称:cfme_tests,代码行数:8,代码来源:test_buttons.py

示例13: test_button_group_crud

def test_button_group_crud(request):
    buttongroup = ButtonGroup(
        text=generate_random_string(), hover="btn_hvr", type=ButtonGroup.SERVICE)
    request.addfinalizer(buttongroup.delete_if_exists)
    buttongroup.create()
    with update(buttongroup):
        buttongroup.hover = "edit_desc_{}".format(generate_random_string())
    buttongroup.delete()
开发者ID:petrblaho,项目名称:cfme_tests,代码行数:8,代码来源:test_buttons.py

示例14: test_button_group_crud

def test_button_group_crud(request):
    """Test Creating a Button Group

    Prerequisities:
        * An appliance

    Steps:
        * Create a Button Group with random button text and button hover text, select type Service
        * Assert that the button group exists
        * Assert that the entered values correspond with what is displayed on the details page
        * Change the hover text, ensure the text is changed on details page
        * Delete the button group
        * Assert that the button group no longer exists.
    """
    # Generate an object
    buttongroup = ButtonGroup(
        text=fauxfactory.gen_alphanumeric(),
        hover=fauxfactory.gen_alphanumeric(),
        type=ButtonGroup.SERVICE)
    # Ensure it gets deleted after the test
    request.addfinalizer(buttongroup.delete_if_exists)
    # 1) Create it
    buttongroup.create()
    # 2) Verify it exists
    assert buttongroup.exists
    # 3) Now the new part, go to the details page
    view = navigate_to(buttongroup, 'Details')
    # 4) and verify that the values in there indeed correspond to the values specified
    assert view.text.text == buttongroup.text
    assert view.hover.text == buttongroup.hover
    # 5) generate a random string for update test
    updated_hover = "edit_desc_{}".format(fauxfactory.gen_alphanumeric())
    # 6) Update it (this might go over multiple fields in the object)
    with update(buttongroup):
        buttongroup.hover = updated_hover
    # 7) Assert it still exists
    assert buttongroup.exists
    # 8) Go to the details page again
    view = navigate_to(buttongroup, 'Details')
    # 9) Verify it indeed equals to what it was set to before
    assert view.hover.text == updated_hover
    # 10) Delete it - first cancel and then real
    buttongroup.delete(cancel=True)
    assert buttongroup.exists
    buttongroup.delete()
    # 11) Verify it is deleted
    assert not buttongroup.exists
开发者ID:dajohnso,项目名称:cfme_tests,代码行数:47,代码来源:test_buttons.py

示例15: custom_service_button

def custom_service_button(ansible_catalog_item):
    buttongroup = ButtonGroup(
        text=fauxfactory.gen_alphanumeric(),
        hover="btn_desc_{}".format(fauxfactory.gen_alphanumeric()))
    buttongroup.type = buttongroup.SERVICE
    buttongroup.create()
    button = Button(
        group=buttongroup,
        text=fauxfactory.gen_alphanumeric(),
        hover="btn_hvr_{}".format(fauxfactory.gen_alphanumeric()),
        dialog=ansible_catalog_item.provisioning["provisioning_dialog_name"],
        system="Request",
        request="Order_Ansible_Playbook"
    )
    button.create()
    yield button
    button.delete_if_exists()
    buttongroup.delete_if_exists()
开发者ID:jkandasa,项目名称:integration_tests,代码行数:18,代码来源:test_embedded_ansible_services.py


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