本文整理汇总了Python中cfme.automate.buttons.ButtonGroup.delete方法的典型用法代码示例。如果您正苦于以下问题:Python ButtonGroup.delete方法的具体用法?Python ButtonGroup.delete怎么用?Python ButtonGroup.delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cfme.automate.buttons.ButtonGroup
的用法示例。
在下文中一共展示了ButtonGroup.delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_button_group_crud
# 需要导入模块: from cfme.automate.buttons import ButtonGroup [as 别名]
# 或者: from cfme.automate.buttons.ButtonGroup import delete [as 别名]
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()
示例2: test_button_group_crud
# 需要导入模块: from cfme.automate.buttons import ButtonGroup [as 别名]
# 或者: from cfme.automate.buttons.ButtonGroup import delete [as 别名]
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()
示例3: test_button_group_crud
# 需要导入模块: from cfme.automate.buttons import ButtonGroup [as 别名]
# 或者: from cfme.automate.buttons.ButtonGroup import delete [as 别名]
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