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


Python ServiceDialog.delete方法代码示例

本文整理汇总了Python中cfme.automate.service_dialogs.ServiceDialog.delete方法的典型用法代码示例。如果您正苦于以下问题:Python ServiceDialog.delete方法的具体用法?Python ServiceDialog.delete怎么用?Python ServiceDialog.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cfme.automate.service_dialogs.ServiceDialog的用法示例。


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

示例1: dialog

# 需要导入模块: from cfme.automate.service_dialogs import ServiceDialog [as 别名]
# 或者: from cfme.automate.service_dialogs.ServiceDialog import delete [as 别名]
def dialog():
    dialog_name = "dialog_" + fauxfactory.gen_alphanumeric()

    element_data = dict(
        ele_label="ele_" + fauxfactory.gen_alphanumeric(),
        ele_name=fauxfactory.gen_alphanumeric(),
        ele_desc="my ele desc",
        choose_type="Text Box",
        default_text_box="default value"
    )

    service_dialog = ServiceDialog(label=dialog_name, description="my dialog",
                                   submit=True, cancel=True,
                                   tab_label="tab_" + fauxfactory.gen_alphanumeric(),
                                   tab_desc="my tab desc",
                                   box_label="box_" + fauxfactory.gen_alphanumeric(),
                                   box_desc="my box desc")
    service_dialog.create(element_data)
    flash.assert_success_message('Dialog "{}" was added'.format(dialog_name))
    yield service_dialog

    # fixture cleanup
    try:
        service_dialog.delete()
    except NoSuchElementException or TimeoutException:
        logger.warning('test_catalog_item: dialog yield fixture cleanup, dialog "{}" not '
                       'found'.format(dialog_name))
开发者ID:RonnyPfannschmidt,项目名称:cfme_tests,代码行数:29,代码来源:test_catalog_item.py

示例2: test_delete_dialog_before_parent_item

# 需要导入模块: from cfme.automate.service_dialogs import ServiceDialog [as 别名]
# 或者: from cfme.automate.service_dialogs.ServiceDialog import delete [as 别名]
def test_delete_dialog_before_parent_item(catalog_item):
    service_dialog = ServiceDialog(label=catalog_item.dialog)
    service_dialog.delete()
    message = version.pick({'5.6': (("Dialog \"{}\": Error during delete: Dialog cannot be " +
                            "deleted because it is connected to other components.").
                            format(catalog_item.dialog)),
                            '5.5': (("Dialog \"{}\": Error during 'destroy': Dialog cannot be " +
                            "deleted because it is connected to other components.").
                            format(catalog_item.dialog))})
    flash.assert_message_match(message)
开发者ID:FilipB,项目名称:cfme_tests,代码行数:12,代码来源:test_generic_service_catalogs.py

示例3: test_delete_service_dialog

# 需要导入模块: from cfme.automate.service_dialogs import ServiceDialog [as 别名]
# 或者: from cfme.automate.service_dialogs.ServiceDialog import delete [as 别名]
def test_delete_service_dialog():
    element_data = {
        'ele_label': "ele_" + fauxfactory.gen_alphanumeric(),
        'ele_name': fauxfactory.gen_alphanumeric(),
        'ele_desc': fauxfactory.gen_alphanumeric(),
        'choose_type': "Text Box",
        'default_text_box': "Default text"
    }
    dialog = ServiceDialog(label=fauxfactory.gen_alphanumeric(),
                           description="my dialog", submit=True, cancel=True,
                           tab_label="tab_" + fauxfactory.gen_alphanumeric(),
                           tab_desc="my tab desc",
                           box_label="box_" + fauxfactory.gen_alphanumeric(),
                           box_desc="my box desc")
    dialog.create(element_data)
    dialog.delete()
开发者ID:FilipB,项目名称:cfme_tests,代码行数:18,代码来源:test_service_dialog.py

示例4: test_delete_service_dialog

# 需要导入模块: from cfme.automate.service_dialogs import ServiceDialog [as 别名]
# 或者: from cfme.automate.service_dialogs.ServiceDialog import delete [as 别名]
def test_delete_service_dialog():
    element_data = {
        'ele_label': "ele_" + rand.generate_random_string(),
        'ele_name': rand.generate_random_string(),
        'ele_desc': rand.generate_random_string(),
        'choose_type': "Text Box",
        'default_text_box': "Default text"
    }
    dialog = ServiceDialog(label=rand.generate_random_string(),
                           description="my dialog", submit=True, cancel=True,
                           tab_label="tab_" + rand.generate_random_string(),
                           tab_desc="my tab desc",
                           box_label="box_" + rand.generate_random_string(),
                           box_desc="my box desc")
    dialog.create(element_data)
    dialog.delete()
开发者ID:petrblaho,项目名称:cfme_tests,代码行数:18,代码来源:test_service_dialog.py

示例5: test_vmware_vimapi_hotadd_disk

# 需要导入模块: from cfme.automate.service_dialogs import ServiceDialog [as 别名]
# 或者: from cfme.automate.service_dialogs.ServiceDialog import delete [as 别名]
def test_vmware_vimapi_hotadd_disk(
        request, testing_group, provider_crud, provider_mgmt, testing_vm, domain, namespace, cls):
    """ Tests hot adding a disk to vmware vm

    Metadata:
        test_flag: hotdisk, provision
    """
    # Instance that calls the method and is accessible from the button
    if current_version() < "5.3":
        rel = "/Integration/VimApi/VMware_HotAdd_Disk"
    else:
        rel = "/Integration/VMware/VimApi/VMware_HotAdd_Disk"
    instance = Instance(
        name="VMware_HotAdd_Disk",
        values={
            "rel5": rel,
        },
        cls=cls
    )
    if not instance.exists():
        request.addfinalizer(lambda: instance.delete() if instance.exists() else None)
        instance.create()
    # Dialog to put the disk capacity
    return
    element_data = {
        'ele_label': "Disk size",
        'ele_name': "size",
        'ele_desc': "Disk size",
        'choose_type': "Text Box",
        'default_text_box': "Default text"
    }
    dialog = ServiceDialog(
        label=fauxfactory.gen_alphanumeric(),
        description=fauxfactory.gen_alphanumeric(),
        submit=True,
        tab_label=fauxfactory.gen_alphanumeric(),
        tab_desc=fauxfactory.gen_alphanumeric(),
        box_label=fauxfactory.gen_alphanumeric(),
        box_desc=fauxfactory.gen_alphanumeric(),
    )
    dialog.create(element_data)
    request.addfinalizer(lambda: dialog.delete())
    # Button that will invoke the dialog and action
    button_name = fauxfactory.gen_alphanumeric()
    button = Button(group=testing_group,
                    text=button_name,
                    hover=button_name,
                    dialog=dialog, system="Request", request="VMware_HotAdd_Disk")
    request.addfinalizer(button.delete_if_exists)
    button.create()
    # Now do the funny stuff

    def _get_disk_count():
        return int(testing_vm.get_detail(
            properties=("Datastore Allocation Summary", "Number of Disks")).strip())
    original_disk_count = _get_disk_count()
    toolbar.select(testing_group.text, button.text)
    fill(Input("size"), "1")
    pytest.sel.click(submit)
    flash.assert_no_errors()
    wait_for(lambda: original_disk_count + 1 == _get_disk_count(), num_sec=180, delay=5)
开发者ID:seandst,项目名称:cfme_tests,代码行数:63,代码来源:test_vmware_methods.py

示例6: test_delete_service_dialog

# 需要导入模块: from cfme.automate.service_dialogs import ServiceDialog [as 别名]
# 或者: from cfme.automate.service_dialogs.ServiceDialog import delete [as 别名]
def test_delete_service_dialog():
    dialog = ServiceDialog(label=rand.generate_random_string(),
                  description="my dialog", submit=True, cancel=True)
    dialog.create()
    dialog.delete()
开发者ID:slouderm,项目名称:cfme_tests,代码行数:7,代码来源:test_service_dialog.py

示例7: test_delete_dialog_before_parent_item

# 需要导入模块: from cfme.automate.service_dialogs import ServiceDialog [as 别名]
# 或者: from cfme.automate.service_dialogs.ServiceDialog import delete [as 别名]
def test_delete_dialog_before_parent_item(catalog_item):
    service_dialog = ServiceDialog(label=catalog_item.dialog)
    service_dialog.delete()
    flash.assert_message_match(("Dialog \"{}\": Error during 'destroy': Dialog cannot be deleted " +
    "because it is connected to other components.").format(catalog_item.dialog))
开发者ID:petrblaho,项目名称:cfme_tests,代码行数:7,代码来源:test_generic_service_catalogs.py

示例8: test_vmware_vimapi_hotadd_disk

# 需要导入模块: from cfme.automate.service_dialogs import ServiceDialog [as 别名]
# 或者: from cfme.automate.service_dialogs.ServiceDialog import delete [as 别名]
def test_vmware_vimapi_hotadd_disk(
        request, testing_group, provider, testing_vm, domain, namespace, cls):
    """ Tests hot adding a disk to vmware vm.

    This test exercises the ``VMware_HotAdd_Disk`` method, located either in
    ``/Integration/VimApi/`` (<5.3) or ``/Integration/VMware/VimApi`` (5.3 and up).

    Steps:
        * It creates an instance in ``System/Request`` that can be accessible from eg. a button.
        * Then it creates a service dialog that contains a field with the desired disk size, the
            text field name should be ``size``
        * Then it creates a button, that refers to the ``VMware_HotAdd_Disk`` in ``Request``. The
            button shall belong in the VM and instance button group.
        * After the button is created, it goes to a VM's summary page, clicks the button, enters
            the size of the disk and submits the dialog.
        * The test waits until the number of disks is raised.

    Metadata:
        test_flag: hotdisk, provision
    """
    # Instance that calls the method and is accessible from the button
    if current_version() < "5.3":
        rel = "/Integration/VimApi/VMware_HotAdd_Disk"
    else:
        rel = "/Integration/VMware/VimApi/VMware_HotAdd_Disk"
    instance = Instance(
        name="VMware_HotAdd_Disk",
        values={
            "rel5": rel,
        },
        cls=cls
    )
    if not instance.exists():
        request.addfinalizer(lambda: instance.delete() if instance.exists() else None)
        instance.create()
    # Dialog to put the disk capacity
    return
    element_data = {
        'ele_label': "Disk size",
        'ele_name': "size",
        'ele_desc': "Disk size",
        'choose_type': "Text Box",
        'default_text_box': "Default text"
    }
    dialog = ServiceDialog(
        label=fauxfactory.gen_alphanumeric(),
        description=fauxfactory.gen_alphanumeric(),
        submit=True,
        tab_label=fauxfactory.gen_alphanumeric(),
        tab_desc=fauxfactory.gen_alphanumeric(),
        box_label=fauxfactory.gen_alphanumeric(),
        box_desc=fauxfactory.gen_alphanumeric(),
    )
    dialog.create(element_data)
    request.addfinalizer(lambda: dialog.delete())
    # Button that will invoke the dialog and action
    button_name = fauxfactory.gen_alphanumeric()
    button = Button(group=testing_group,
                    text=button_name,
                    hover=button_name,
                    dialog=dialog, system="Request", request="VMware_HotAdd_Disk")
    request.addfinalizer(button.delete_if_exists)
    button.create()
    # Now do the funny stuff

    def _get_disk_count():
        return int(testing_vm.get_detail(
            properties=("Datastore Allocation Summary", "Number of Disks")).strip())
    original_disk_count = _get_disk_count()
    toolbar.select(testing_group.text, button.text)
    fill(Input("size"), "1")
    pytest.sel.click(submit)
    flash.assert_no_errors()
    wait_for(lambda: original_disk_count + 1 == _get_disk_count(), num_sec=180, delay=5)
开发者ID:pombredanne,项目名称:cfme_tests,代码行数:76,代码来源:test_vmware_methods.py


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