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

Python widgetastic_patternfly.Dropdown类代码示例

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

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



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

示例1: test_custom_button_expression

def test_custom_button_expression(appliance, request, setup_obj, button_group, expression):
    """ Test custom button as per expression enablement/visibility.

    Polarion:
        assignee: ndhandre
        initialEstimate: 1/4h
        caseimportance: medium
        caseposneg: positive
        testtype: functional
        startsin: 5.9
        casecomponent: CustomButton
        tags: custom_button
        testSteps:
            1. Create custom button group with the Object type
            2. Create a custom button with expression (Tag)
                a. Enablement Expression
                b. Visibility Expression
            3. Navigate to object Detail page
            4. Check: button should not enable/visible without tag
            5. Check: button should enable/visible with tag
    """

    group, obj_type = button_group
    exp = {expression: {"tag": "My Company Tags : Department", "value": "Engineering"}}

    button = group.buttons.create(
        text=fauxfactory.gen_alphanumeric(),
        hover=fauxfactory.gen_alphanumeric(),
        display_for="Single entity",
        system="Request",
        request="InspectMe",
        **exp
    )
    request.addfinalizer(button.delete_if_exists)

    tag_cat = appliance.collections.categories.instantiate(
        name="department", display_name="Department"
    )
    tag = tag_cat.collections.tags.instantiate(name="engineering", display_name="Engineering")

    view = navigate_to(setup_obj, "Details")
    custom_button_group = Dropdown(view, group.hover)
    if tag.display_name in [item.display_name for item in setup_obj.get_tags()]:
        if expression == "enablement":
            assert custom_button_group.item_enabled(button.text)
            setup_obj.remove_tag(tag)
            assert not custom_button_group.is_enabled
        elif expression == "visibility":
            assert button.text in custom_button_group.items
            setup_obj.remove_tag(tag)
            assert not custom_button_group.is_displayed
    else:
        if expression == "enablement":
            assert not custom_button_group.is_enabled
            setup_obj.add_tag(tag)
            assert custom_button_group.item_enabled(button.text)
        elif expression == "visibility":
            assert not custom_button_group.is_displayed
            setup_obj.add_tag(tag)
            assert button.text in custom_button_group.items
开发者ID:mkoura,项目名称:cfme_tests,代码行数:60,代码来源:test_generic_objects.py


示例2: test_open_url

def test_open_url(request, setup_obj, button_group, method):
    """ Test Open url functionality of custom button.

    Polarion:
        assignee: ndhandre
        initialEstimate: 1/2h
        caseimportance: high
        caseposneg: positive
        testtype: functional
        startsin: 5.9
        casecomponent: CustomButton
        tags: custom_button
        testSteps:
            1. Appliance with Infra provider
            2. Create ruby method for url functionality
            3. Create custom button group with the Object type
            4. Create a custom button with open_url option and respective method
            5. Navigate to object Detail page
            6. Execute custom button
            7. Check new tab open or not with respective url
    """

    group, obj_type = button_group
    button = group.buttons.create(
        text=fauxfactory.gen_alphanumeric(),
        hover=fauxfactory.gen_alphanumeric(),
        open_url=True,
        display_for="Single entity",
        system="Request",
        request=method.name,
    )
    request.addfinalizer(button.delete_if_exists)

    view = navigate_to(setup_obj, "Details")
    custom_button_group = Dropdown(view, group.hover)
    assert custom_button_group.has_item(button.text)

    # TODO: Move windows handling functionality to browser
    initial_count = len(view.browser.selenium.window_handles)
    main_window = view.browser.selenium.current_window_handle
    custom_button_group.item_select(button.text)

    wait_for(
        lambda: len(view.browser.selenium.window_handles) > initial_count,
        timeout=120,
        message="Check for window open",
    )
    open_url_window = set(view.browser.selenium.window_handles) - {main_window}

    view.browser.selenium.switch_to_window(open_url_window.pop())

    @request.addfinalizer
    def _reset_window():
        if view.browser.selenium.current_window_handle != main_window:
            view.browser.selenium.close()
            view.browser.selenium.switch_to_window(main_window)

    assert "example.com" in view.browser.url
开发者ID:mkoura,项目名称:cfme_tests,代码行数:58,代码来源:test_infra_objects.py


示例3: test_custom_button_display_service_vm

def test_custom_button_display_service_vm(request, appliance, service_vm, button_group):
    """ Test custom button display on UI and SSUI vm resource detail page

    Polarion:
        assignee: ndhandre
        initialEstimate: 1/2h
        caseimportance: medium
        caseposneg: positive
        testtype: functional
        startsin: 5.9
        casecomponent: CustomButton
        tags: custom_button
        setup:
            1. Order VM from service
        testSteps:
            1. Add custom button group for VM/Instance object from automation
            2. Add custom button in above group
            3. Navigate to VM Details page from service (UI and SSUI)
        expectedResults:
            1.
            2.
            3. Check for button group and button displayed or not

    Bugzilla:
        1427430
        1450473
    """

    service, _ = service_vm
    with appliance.context.use(ViaUI):
        button = button_group.buttons.create(
            text=fauxfactory.gen_alphanumeric(),
            hover=fauxfactory.gen_alphanumeric(),
            system="Request",
            request="InspectMe",
        )
        request.addfinalizer(button.delete_if_exists)

    # Check for UI and SSUI destinations.
    for context in [ViaUI, ViaSSUI]:
        with appliance.context.use(context):
            nav_to = ssui_nav if context is ViaSSUI else ui_nav

            # Navigate to VM Details page of service
            view = nav_to(service, "VMDetails")

            # Check button group and button displayed or not
            custom_button_group = Dropdown(view, button_group.text)
            assert custom_button_group.is_displayed
            assert custom_button_group.has_item(button.text)
开发者ID:apagac,项目名称:cfme_tests,代码行数:50,代码来源:test_service_vm_custom_button.py


示例4: test_custom_button_quotes

def test_custom_button_quotes(appliance, provider, setup_provider, dialog, request):
    """ Test custom button and group allows quotes or not

    Polarion:
        assignee: ndhandre
        initialEstimate: 1/6h
        caseimportance: medium
        caseposneg: positive
        testtype: nonfunctional
        startsin: 5.8
        casecomponent: CustomButton
        tags: custom_button
        setup: Simple TextInput service dialog
        testSteps:
            1. Create custom button group with single quote in name like "Group's"
            2. Create a custom button with quote in name like "button's"
            3. Navigate to object Details page
            4. Check for button group and button
            5. Select/execute button from group dropdown for selected entities
            6. Fill dialog and submit Check for the flash message related to button execution

    Bugzilla:
        1646905
    """
    # ToDo: collect test for 5.9; If developer backport BZ-1646905
    collection = appliance.collections.button_groups
    group = collection.create(
        text="Group's", hover="Group's Hover", type=getattr(collection, "PROVIDER")
    )
    request.addfinalizer(group.delete_if_exists)

    button = group.buttons.create(
        text="Button's",
        hover="Button's Hover",
        dialog=dialog,
        system="Request",
        request="InspectMe",
    )
    request.addfinalizer(button.delete_if_exists)

    view = navigate_to(provider, "Details")
    custom_button_group = Dropdown(view, group.hover)
    assert custom_button_group.has_item(button.text)
    custom_button_group.item_select(button.text)

    dialog_view = view.browser.create_view(TextInputDialogView, wait='60s')
    dialog_view.service_name.fill("Custom Button Execute")

    dialog_view.submit.click()
    view.flash.assert_message("Order Request was Submitted")
开发者ID:mkoura,项目名称:cfme_tests,代码行数:50,代码来源:test_buttons.py


示例5: test_custom_button_display_service_obj

def test_custom_button_display_service_obj(
    request, appliance, context, display, objects, button_group
):
    """ Test custom button display on a targeted page

    Polarion:
        assignee: ndhandre
        initialEstimate: 1/4h
        caseimportance: critical
        caseposneg: positive
        testtype: functional
        startsin: 5.8
        casecomponent: CustomButton
        tags: custom_button
        testSteps:
            1. Create custom button group with the Object type
            2. Create a custom button with specific display
            3. Navigate to object type page as per display selected [For service SSUI]
            4. Single entity: Details page of the entity
            5. List: All page of the entity
            6. Single and list: Both All and Details page of the entity
            7. Check for button group and button

    Bugzilla:
        1650066
    """

    group, obj_type = button_group

    with appliance.context.use(ViaUI):
        button = group.buttons.create(
            text=fauxfactory.gen_alphanumeric(),
            hover=fauxfactory.gen_alphanumeric(),
            display_for=display,
            system="Request",
            request="InspectMe",
        )
        request.addfinalizer(button.delete_if_exists)

    with appliance.context.use(context):
        navigate_to = ssui_nav if context is ViaSSUI else ui_nav
        for destination in DISPLAY_NAV[display]:
            obj = objects[obj_type][destination][0]
            dest_name = objects[obj_type][destination][1]
            view = navigate_to(obj, dest_name)
            custom_button_group = Dropdown(view, group.text)
            assert custom_button_group.is_displayed
            assert custom_button_group.has_item(button.text)
开发者ID:niyazRedhat,项目名称:integration_tests,代码行数:48,代码来源:test_service_objects.py


示例6: test_custom_button_events_cloud_obj

def test_custom_button_events_cloud_obj(request, dialog, setup_objs, button_group, btn_dialog):
    """Test custom button events

    Polarion:
        assignee: ndhandre
        caseimportance: medium
        initialEstimate: 1/4h
        caseposneg: positive
        testtype: functional
        startsin: 5.10
        casecomponent: CustomButton
        tags: custom_button
        testSteps:
            1. Create a Button Group
            2. Create custom button [with dialog/ without dialog]
            2. Execute button from respective location
            3. Assert event count

    Bugzilla:
        1668023
        1702490
        1680525
    """
    group, obj_type = button_group
    dialog_ = dialog if btn_dialog else None

    button = group.buttons.create(
        text="btn_{}".format(fauxfactory.gen_alphanumeric(3)),
        hover="btn_hover{}".format(fauxfactory.gen_alphanumeric(3)),
        dialog=dialog_,
        system="Request",
        request="InspectMe",
    )
    request.addfinalizer(button.delete_if_exists)

    for setup_obj in setup_objs:
        initial_count = len(setup_obj.get_button_events())
        view = navigate_to(setup_obj, "Details")
        custom_button_group = Dropdown(view, group.hover)
        custom_button_group.item_select(button.text)

        if btn_dialog:
            dialog_view = view.browser.create_view(TextInputDialogView, wait="10s")
            dialog_view.submit.click()

        view.browser.refresh()
        current_count = len(setup_obj.get_button_events())
        assert current_count == (initial_count + 1)
开发者ID:apagac,项目名称:cfme_tests,代码行数:48,代码来源:test_cloud_objects.py


示例7: test_custom_button_display_infra_obj

def test_custom_button_display_infra_obj(request, display, setup_obj, button_group):
    """ Test custom button display on a targeted page

    Polarion:
        assignee: ndhandre
        initialEstimate: 1/4h
        caseimportance: critical
        caseposneg: positive
        testtype: functional
        startsin: 5.8
        casecomponent: CustomButton
        tags: custom_button
        testSteps:
            1. Create custom button group with the Object type
            2. Create a custom button with specific display
            3. Navigate to object type page as per display selected
            4. Single entity: Details page of the entity
            5. List: All page of the entity
            6. Single and list: Both All and Details page of the entity
            7. Check for button group and button
    """

    group, obj_type = button_group
    button = group.buttons.create(
        text=fauxfactory.gen_alphanumeric(),
        hover=fauxfactory.gen_alphanumeric(),
        display_for=display,
        system="Request",
        request="InspectMe",
    )
    request.addfinalizer(button.delete_if_exists)

    for destination in DISPLAY_NAV[display]:
        obj = setup_obj.parent if destination == "All" else setup_obj

        # Note: For VM, custom button not display on All page but only VM page.
        if obj_type == "VM_INSTANCE" and destination == "All":
            destination = "VMsOnly"

        # Note: For VM Template, custom button not display on All page but only TemplatesOnly.
        if obj_type == "TEMPLATE_IMAGE" and destination == "All":
            destination = "TemplatesOnly"

        view = navigate_to(obj, destination)
        custom_button_group = Dropdown(view, group.hover)
        assert custom_button_group.is_displayed
        assert custom_button_group.has_item(button.text)
开发者ID:sbulage,项目名称:integration_tests,代码行数:47,代码来源:test_infra_objects.py


示例8: checks

def checks(obj_type_conf):
    for obj_type, conf in obj_type_conf.items():
        gp, button, obj = conf
        obj.browser.refresh()  # before start checks refresh browser
        assert gp.exists
        assert button.exists

        view = navigate_to(button, "Details")
        assert view.text.text == button.text
        assert view.hover.text == button.hover

        for destination in ["All", "Details"]:
            # Note: For VM, custom button not display on All page but only VM page.
            nav_obj = obj.parent if destination == "All" else obj
            if obj_type == "VM_INSTANCE" and destination == "All":
                destination = "VMsOnly"

            view = navigate_to(nav_obj, destination)
            custom_button_group = Dropdown(view, gp.hover)
            assert custom_button_group.is_displayed
            assert custom_button_group.has_item(button.text)
开发者ID:mkoura,项目名称:cfme_tests,代码行数:21,代码来源:test_import_export.py


示例9: test_custom_button_text_display

def test_custom_button_text_display(appliance, context, serv_button_group, service):
    """ Test custom button text display on option

    Polarion:
        assignee: ndhandre
        initialEstimate: 1/6h
        caseimportance: medium
        caseposneg: positive
        testtype: functional
        startsin: 5.9
        casecomponent: CustomButton
        tags: custom_button
        testSteps:
            1. Appliance with Service
            2. Create custom button `Group` or `Button` without display option
            3. Check Group/Button text display or not on UI and SSUI.

    Bugzilla:
        1650066
        1659452
    """

    my_service = MyService(appliance, name=service.name)
    button, group = serv_button_group

    with appliance.context.use(context):
        navigate_to = ssui_nav if context is ViaSSUI else ui_nav
        destinations = (
            ["Details"]
            if (BZ(1650066).blocks and context is ViaSSUI)
            else ["All", "Details"]
        )
        for destination in destinations:
            view = navigate_to(my_service, destination)
            custom_button_group = Dropdown(view, group.text)
            if group.display is True:
                assert "" in custom_button_group.items
            else:
                assert custom_button_group.read() == ""
开发者ID:niyazRedhat,项目名称:integration_tests,代码行数:39,代码来源:test_service_objects.py


示例10: test_custom_button_automate

def test_custom_button_automate(appliance, request, submit, setup_objs, button_group):
    """ Test custom button for automate and requests count as per submit

    Polarion:
        assignee: ndhandre
        initialEstimate: 1/4h
        caseimportance: high
        caseposneg: positive
        testtype: functional
        startsin: 5.9
        casecomponent: CustomButton
        tags: custom_button
        testSteps:
            1. Create custom button group with the Object type
            2. Create a custom button with specific submit option and Single and list display
            3. Navigate to object type pages (All and Details)
            4. Check for button group and button
            5. Select/execute button from group dropdown for selected entities
            6. Check for the proper flash message related to button execution
            7. Check automation log requests. Submitted as per selected submit option or not.
            8. Submit all: single request for all entities execution
            9 One by one: separate requests for all entities execution

    Bugzilla:
        1628224, 1642147
    """

    group, obj_type = button_group
    button = group.buttons.create(
        text=fauxfactory.gen_alphanumeric(),
        hover=fauxfactory.gen_alphanumeric(),
        display_for="Single and list",
        submit=submit,
        system="Request",
        request="InspectMe",
    )
    request.addfinalizer(button.delete_if_exists)
    for setup_obj in setup_objs:
        for destination in ["All", "Details"]:
            obj = setup_obj.parent if destination == "All" else setup_obj

            view = navigate_to(obj, destination)
            custom_button_group = Dropdown(view, group.hover)
            assert custom_button_group.has_item(button.text)

            # Entity count depends on the destination for `All` available entities and
            # `Details` means a single entity.
            # To-Do: remove Manager check as BZ-1642147 fix
            if destination == "All":
                try:
                    paginator = view.paginator
                except AttributeError:
                    paginator = view.entities.paginator
                entity_count = min(paginator.items_amount, paginator.items_per_page)

                # Work around for  BZ-1642147
                try:
                    if "Manager" in setup_obj.name:
                        entity_count = 1
                except AttributeError:
                    pass

                paginator.check_all()
            else:
                entity_count = 1

            # Clear the automation log
            assert appliance.ssh_client.run_command(
                'echo -n "" > ' "/var/www/miq/vmdb/log/automation.log"
            )
            custom_button_group.item_select(button.text)
            view.flash.assert_message('"{}" was executed'.format(button.text))

            # Submit all: single request for all entity execution
            # One by one: separate requests for all entity execution
            expected_count = 1 if submit == "Submit all" else entity_count
            try:
                wait_for(
                    log_request_check,
                    [appliance, expected_count],
                    timeout=300,
                    message="Check for expected request count",
                    delay=10,
                )
            except TimedOutError:
                assert False, "Expected {} requests not found in automation log".format(
                    str(expected_count)
                )
开发者ID:mkoura,项目名称:cfme_tests,代码行数:88,代码来源:test_cloud_objects.py


示例11: test_custom_button_dialog

def test_custom_button_dialog(appliance, dialog, request, setup_objs, button_group):
    """ Test custom button with dialog and InspectMe method

    Polarion:
        assignee: ndhandre
        initialEstimate: 1/4h
        caseimportance: high
        caseposneg: positive
        testtype: functional
        startsin: 5.9
        casecomponent: CustomButton
        tags: custom_button
        testSteps:
            1. Simple TextInput service dialog
            2. Create custom button group with the Object type
            3. Create a custom button with service dialog
            4. Navigate to object Details page
            5. Check for button group and button
            6. Select/execute button from group dropdown for selected entities
            7. Fill dialog and submit
            8. Check for the proper flash message related to button execution

    Bugzilla:
        1635797, 1555331, 1574403, 1640592
    """

    group, obj_type = button_group

    # Note: No need to set display_for dialog only work with Single entity
    button = group.buttons.create(
        text=fauxfactory.gen_alphanumeric(),
        hover=fauxfactory.gen_alphanumeric(),
        dialog=dialog,
        system="Request",
        request="InspectMe",
    )
    request.addfinalizer(button.delete_if_exists)

    for setup_obj in setup_objs:
        view = navigate_to(setup_obj, "Details")
        custom_button_group = Dropdown(view, group.hover)
        assert custom_button_group.has_item(button.text)
        custom_button_group.item_select(button.text)

        dialog_view = view.browser.create_view(TextInputDialogView, wait="10s")
        dialog_view.service_name.fill("Custom Button Execute")

        # Clear the automation log
        assert appliance.ssh_client.run_command(
            'echo -n "" > /var/www/miq/vmdb/log/automation.log'
        )

        # Submit order request
        dialog_view.submit.click()
        view.flash.assert_message("Order Request was Submitted")

        # Check for request in automation log
        try:
            wait_for(
                log_request_check,
                [appliance, 1],
                timeout=300,
                message="Check for expected request count",
                delay=20,
            )
        except TimedOutError:
            assert False, "Expected 1 requests not found in automation log"
开发者ID:mkoura,项目名称:cfme_tests,代码行数:67,代码来源:test_cloud_objects.py


示例12: test_custom_button_automate

def test_custom_button_automate(request, appliance, context, submit, objects, button_group):
    """ Test custom button for automate and requests count as per submit

    Polarion:
        assignee: ndhandre
        initialEstimate: 1/4h
        caseimportance: high
        caseposneg: positive
        testtype: functional
        startsin: 5.9
        casecomponent: CustomButton
        tags: custom_button
        testSteps:
            1. Create custom button group with the Object type
            2. Create a custom button with specific submit option and Single and list display
            3. Navigate to object type pages (All and Details)
            4. Check for button group and button
            5. Select/execute button from group dropdown for selected entities
            6. Check for the proper flash message related to button execution
            7. Check automation log requests. Submitted as per selected submit option or not.
            8. Submit all: single request for all entities execution
            9. One by one: separate requests for all entities execution

    Bugzilla:
        1650066
    """

    group, obj_type = button_group
    with appliance.context.use(ViaUI):
        button = group.buttons.create(
            text=fauxfactory.gen_alphanumeric(),
            hover=fauxfactory.gen_alphanumeric(),
            display_for="Single and list",
            submit=submit,
            system="Request",
            request="InspectMe",
        )
        request.addfinalizer(button.delete_if_exists)

    with appliance.context.use(context):
        navigate_to = ssui_nav if context is ViaSSUI else ui_nav

        # BZ-1650066: no custom button on All page
        destinations = (
            ["Details"]
            if context == ViaSSUI and BZ(1650066, forced_streams=["5.9", "5.10"]).blocks
            else ["All", "Details"]
        )
        for destination in destinations:
            obj = objects[obj_type][destination][0]
            dest_name = objects[obj_type][destination][1]
            view = navigate_to(obj, dest_name)
            custom_button_group = Dropdown(view, group.text)
            assert custom_button_group.has_item(button.text)

            # Entity count depends on the destination for `All` available entities and
            # `Details` means a single entity.

            if destination == "All":
                try:
                    paginator = view.paginator
                except AttributeError:
                    paginator = view.entities.paginator

                entity_count = min(paginator.items_amount, paginator.items_per_page)
                view.entities.paginator.check_all()
            else:
                entity_count = 1

            # Clear the automation log
            assert appliance.ssh_client.run_command(
                'echo -n "" > /var/www/miq/vmdb/log/automation.log'
            )

            custom_button_group.item_select(button.text)

            # SSUI not support flash messages
            if context is ViaUI:
                view.flash.assert_message('"{button}" was executed'.format(button=button.text))

            # Submit all: single request for all entity execution
            # One by one: separate requests for all entity execution
            expected_count = 1 if submit == "Submit all" else entity_count
            try:
                wait_for(
                    log_request_check,
                    [appliance, expected_count],
                    timeout=600,
                    message="Check for expected request count",
                    delay=20,
                )
            except TimedOutError:
                assert False, "Expected {count} requests not found in automation log".format(
                    count=str(expected_count)
                )
开发者ID:mkoura,项目名称:cfme_tests,代码行数:95,代码来源:test_service_objects.py


示例13: test_custom_button_automate_infra_obj

def test_custom_button_automate_infra_obj(appliance, request, submit, setup_obj, button_group):
    """ Test custom button for automate and requests count as per submit

    Polarion:
        assignee: ndhandre
        initialEstimate: 1/4h
        caseimportance: high
        caseposneg: positive
        testtype: functional
        startsin: 5.9
        casecomponent: CustomButton
        tags: custom_button
        testSteps:
            1. Create custom button group with the Object type
            2. Create a custom button with specific submit option and Single and list display
            3. Navigate to object type pages (All and Details)
            4. Check for button group and button
            5. Select/execute button from group dropdown for selected entities
            6. Check for the proper flash message related to button execution
            7. Check automation log requests. Submitted as per selected submit option or not.
            8. Submit all: single request for all entities execution
            9. One by one: separate requests for all entities execution

    Bugzilla:
        1628224
    """

    group, obj_type = button_group
    button = group.buttons.create(
        text=fauxfactory.gen_alphanumeric(),
        hover=fauxfactory.gen_alphanumeric(),
        display_for="Single and list",
        submit=submit,
        system="Request",
        request="InspectMe",
    )
    request.addfinalizer(button.delete_if_exists)

    for destination in ["All", "Details"]:
        obj = setup_obj.parent if destination == "All" else setup_obj

        # Note: For VM, custom button not display on `All page` but only `VM page`.
        if obj_type == "VM_INSTANCE" and destination == "All":
            destination = "VMsOnly"

        # Note: For VM Template, custom button not display on All page but only TemplatesOnly.
        if obj_type == "TEMPLATE_IMAGE" and destination == "All":
            destination = "TemplatesOnly"

        view = navigate_to(obj, destination)
        custom_button_group = Dropdown(view, group.hover)
        assert custom_button_group.has_item(button.text)

        # Entity count depends on the destination for `All` available entities and
        # `Details` means a single entity.
        if destination in ["All", "VMsOnly", "TemplatesOnly"]:
            try:
                paginator = view.paginator
            except AttributeError:
                paginator = view.entities.paginator

            entity_count = min(paginator.items_amount, paginator.items_per_page)
            paginator.check_all()
        else:
            entity_count = 1

        # Clear the automation log
        assert appliance.ssh_client.run_command(
            'echo -n "" > /var/www/miq/vmdb/log/automation.log'
        )

        custom_button_group.item_select(button.text)

        diff = "executed" if appliance.version < "5.10" else "launched"
        view.flash.assert_message('"{btn}" was {diff}'.format(btn=button.text, diff=diff))

        # Submit all: single request for all entity execution
        # One by one: separate requests for all entity execution
        expected_count = 1 if submit == "Submit all" else entity_count
        try:
            wait_for(
                log_request_check,
                [appliance, expected_count],
                timeout=600,
                message="Check for expected request count",
                delay=20,
            )
        except TimedOutError:
            assert False, "Expected {} requests not found in automation log".format(
                str(expected_count)
            )
开发者ID:sbulage,项目名称:integration_tests,代码行数:91,代码来源:test_infra_objects.py


示例14: test_custom_button_dialog_service_obj

def test_custom_button_dialog_service_obj(
    appliance, dialog, request, context, objects, button_group
):
    """ Test custom button with dialog and InspectMe method

    Polarion:
        assignee: ndhandre
        initialEstimate: 1/4h
        caseimportance: medium
        caseposneg: positive
        testtype: functional
        startsin: 5.9
        casecomponent: CustomButton
        tags: custom_button
        testSteps:
            1. Create custom button group with the Object type
            2. Create a custom button with service dialog
            3. Navigate to object Details page
            4. Check for button group and button
            5. Select/execute button from group dropdown for selected entities
            6. Fill dialog and submit
            7. Check for the proper flash message related to button execution

    Bugzilla:
        1574774
    """
    group, obj_type = button_group
    with appliance.context.use(ViaUI):
        button = group.buttons.create(
            text="btn_{}".format(fauxfactory.gen_alphanumeric(3)),
            hover="btn_hover_{}".format(fauxfactory.gen_alphanumeric(3)),
            dialog=dialog,
            system="Request",
            request="InspectMe",
        )
        request.addfinalizer(button.delete_if_exists)

    with appliance.context.use(context):
        navigate_to = ssui_nav if context is ViaSSUI else ui_nav

        obj = objects[obj_type]["Details"][0]
        dest_name = objects[obj_type]["Details"][1]
        view = navigate_to(obj, dest_name)
        custom_button_group = Dropdown(view, group.text)
        assert custom_button_group.has_item(button.text)

        # Clear the automation log
        assert appliance.ssh_client.run_command(
            'echo -n "" > /var/www/miq/vmdb/log/automation.log'
        )

        custom_button_group.item_select(button.text)
        _dialog_view = TextInputDialogView if context is ViaUI else TextInputDialogSSUIView
        dialog_view = view.browser.create_view(_dialog_view, wait="10s")
        assert dialog_view.service_name.fill("Custom Button Execute")
        dialog_view.submit.click()

        # SSUI not support flash messages
        if context is ViaUI:
            view.flash.assert_message("Order Request was Submitted")

        # check request in log
        try:
            wait_for(
                log_request_check,
                [appliance, 1],
                timeout=600,
                message="Check for expected request count",
                delay=20,
            )
        except TimedOutError:
            assert False, "Expected {count} requests not found in automation log".format(
                count=str(1)
            )
开发者ID:niyazRedhat,项目名称:integration_tests,代码行数:74,代码来源:test_service_objects.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python widgets.media_property函数代码示例发布时间:2022-05-26
下一篇:
Python xpath.quote函数代码示例发布时间: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