コード例 #1
0
def test_generic_object_with_service_button(appliance, generic_object,
                                            button_with_dialog):
    """
    Bugzilla:
        1729341
        1743266

    Polarion:
        assignee: jdupuy
        initialEstimate: 1/6h
        caseimportance: high
        caseposneg: positive
        testtype: functional
        startsin: 5.10
        casecomponent: GenericObjects
    """
    # add generic object to service
    myservice = MyService(
        appliance, name=generic_object.associations.get("services")[0].name)
    with appliance.context.use(ViaREST):
        myservice.add_resource_generic_object(generic_object)
    # now navigate to the details of the generic_object
    view = navigate_to(generic_object, "MyServiceDetails")
    view.toolbar.button(button_with_dialog.name).custom_button.click()
    view = generic_object.create_view(TextInputDialogView, wait=10)
    view.service_name.fill("Custom Button Execute")
    wait_for(lambda: not view.submit.disabled, timeout="10s")
    view.submit.click()

    # now for the actual test, make sure after hitting submit we're on the correct page
    try:
        generic_object.create_view(MyServiceGenericObjectInstanceView, wait=10)
    except TimedOutError:
        pytest.fail(
            "Could not wait for service's generic object view to displayed.")
コード例 #2
0
def test_generic_object_on_service_breadcrumb(appliance, generic_object):
    """
    Bugzilla:
        1741050

    Polarion:
        assignee: tpapaioa
        initialEstimate: 1/6h
        casecomponent: GenericObjects
        testSteps:
            1. Generate a service viewable under My Services
            2. Create Generic Object Class & Instance
            3. Assign the generic object instance to the service
            4. Navigate to the service
            5. Click on the generic object instances
            6. Check the breadcrumb link
        expectedResults:
            1.
            2.
            3.
            4.
            5.
            6. Breadcrumb should work properly
    """
    # add generic object to service
    myservice = MyService(appliance, name=generic_object.associations.get("services")[0].name)
    with appliance.context.use(ViaREST):
        myservice.add_resource_generic_object(generic_object)
    # now navigate to the details of the generic_object
    with appliance.context.use(ViaUI):
        view = navigate_to(generic_object, "MyServiceDetails")
        view.breadcrumb.click_location(myservice.name)
        assert not view.is_displayed
        view = myservice.create_view(MyServicesView)
        assert view.is_displayed