Esempio n. 1
0
def go_to_default_func(_):
    """This can change, because the title of the default dashboard is mutable. However, we can xpath
    there quite reliable, so we use it that way we extract the name from the tree directly.
    """
    t = "//li[@id='db_xx-1' or @id='dashboards_xx-1']/span/a"
    accordion.click("Dashboards")
    accordion.tree("Dashboards", "All Dashboards", sel.text(t).encode("utf-8"))
Esempio n. 2
0
def go_to_default_func(_):
    """This can change, because the title of the default dashboard is mutable. However, we can xpath
    there quite reliable, so we use it that way we extract the name from the tree directly.
    """
    t = "//li[@id='db_xx-1' or @id='dashboards_xx-1']/span/a"
    accordion.click("Dashboards")
    accordion.tree("Dashboards", "All Dashboards", sel.text(t).encode("utf-8"))
Esempio n. 3
0
 def step(self):
     accordion.click('Relationships')
     # Click by anchor title since text contains a dynamic component
     try:
         sel.click('//*[@id="stack_rel"]//a[@title="Show all Outputs"]')
     except NoSuchElementException:
         raise CandidateNotFound('No Outputs for stack, cannot navigate')
Esempio n. 4
0
 def step(self):
     accordion.click('Relationships')
     # Click by anchor title since text contains a dynamic component
     try:
         sel.click('//*[@id="stack_rel"]//a[@title="Show all Outputs"]')
     except NoSuchElementException:
         raise CandidateNotFound('No Outputs for stack, cannot navigate')
Esempio n. 5
0
def go_to_default_func(_):
    """This can change, because the title of the default dashboard is mutable. However, we can xpath
    there quite reliable, so we use it that way we extract the name from the tree directly.
    """
    t = {
        "5.3": "//div[@id='db_treebox']/ul/li[@id='db_root']/ul/li/"
               "span[contains(@class, 'dynatree-node') and img[contains(@src, 'dashboard')]]/a",
        version.LOWEST: "//div[@id='db_treebox']/div/table/tbody/tr/td/table/"
                        "tbody[tr[@title='All Dashboards']]/tr/td/table/tbody/"
                        "tr[td/img[contains(@src, 'dashboard')]]/td/span",
    }
    accordion.click("Dashboards")
    accordion.tree("Dashboards", "All Dashboards", sel.text(t).encode("utf-8"))
Esempio n. 6
0
def go_to_default_func(_):
    """This can change, because the title of the default dashboard is mutable. However, we can xpath
    there quite reliable, so we use it that way we extract the name from the tree directly.
    """
    t = {
        "5.3":
        "//div[@id='db_treebox']/ul/li[@id='db_root']/ul/li/"
        "span[contains(@class, 'dynatree-node') and img[contains(@src, 'dashboard')]]/a",
        version.LOWEST:
        "//div[@id='db_treebox']/div/table/tbody/tr/td/table/"
        "tbody[tr[@title='All Dashboards']]/tr/td/table/tbody/"
        "tr[td/img[contains(@src, 'dashboard')]]/td/span",
    }
    accordion.click("Dashboards")
    accordion.tree("Dashboards", "All Dashboards", sel.text(t).encode("utf-8"))
Esempio n. 7
0
from cfme.web_ui import Form, accordion, fill, flash, menu
from utils.update import Updateable

order_button = "//img[@title='Order this Service']"

service_order_form = Form(
    fields=[('dialog_service_name_field',
             "//tr/td[@title='ele_desc']/input[@id='service_name']"
             ), ('submit_button', "//img[@title='Submit']")])

accordion_tree = partial(accordion.tree, "Service Catalogs")

menu.nav.add_branch(
    'services_catalogs', {
        'service_catalogs': [
            lambda _: accordion.click('Service Catalogs'), {
                'service_catalog': [
                    lambda ctx: accordion_tree('All Services', ctx[
                        'catalog'], ctx['catalog_item'].name), {
                            'order_service_catalog':
                            lambda _: sel.click(order_button)
                        }
                ]
            }
        ]
    })


class ServiceCatalogs(Updateable):
    def __init__(self, service_name=None):
        self.service_name = service_name
Esempio n. 8
0
 def step(self):
     accordion.click('Relationships')
     # Click by anchor title since text contains a dynamic component
     sel.click('//*[@id="stack_rel"]//a[@title="Show all Resources"]')
Esempio n. 9
0
 def f(_):
     accordion.click(acc)
     visible_tree.click_path(tree)
Esempio n. 10
0
def _all_catalogitems_add_new(context):
    accordion_tree('All Catalog Items')
    cfg_btn('Add a New Catalog Item')
    provider_type = context['provider_type']
    sel.select("//select[@id='st_prov_type']", provider_type)


def _all_catalogbundle_add_new(context):
    accordion_tree('All Catalog Items')
    cfg_btn('Add a New Catalog Bundle')


menu.nav.add_branch(
    'services_catalogs', {
        'catalog_items': [
            lambda _: accordion.click('Catalog Items'), {
                'catalog_item_new':
                _all_catalogitems_add_new,
                'catalog_item': [
                    lambda ctx: accordion_tree('All Catalog Items', ctx[
                        'catalog'], ctx['catalog_item'].name), {
                            'catalog_item_edit':
                            lambda _: cfg_btn("Edit this Item")
                        }
                ]
            }
        ],
        'catalog_bundle': [
            lambda _: accordion.click('Catalog Items'), {
                'catalog_bundle_new':
                _all_catalogbundle_add_new,
Esempio n. 11
0
        ('stack_name', Input("stack_name")),
        ('resource_group', Select("//select[@id='resource_group']")),
        ('mode', Select("//select[@id='deploy_mode']")),
        ('vm_name', Input("param_virtualMachineName")),
        ('vm_user', Input("param_adminUserName")),
        ('vm_password', Input("param_adminPassword__protected")),
        ('vm_size', Select("//select[@id='param_virtualMachineSize']"))
    ])


menu.nav.add_branch(
    'services_catalogs',
    {
        'service_catalogs':
        [
            lambda _: accordion.click('Service Catalogs'),
            {
                'service_catalog':
                [
                    lambda ctx: accordion_tree(
                        'All Services', ctx['catalog'], ctx['catalog_item'].name),
                    {
                        'order_service_catalog': lambda _: sel.click(order_button)
                    }
                ]
            }
        ]
    }
)

Esempio n. 12
0
             Input("description")), (
                 'display_checkbox',
                 Input("display")), ('add_button', form_buttons.add)])


def _all_catalogs_add_new(_):
    if BZ(1213863).blocks:
        sel.pytest.skip("Blocker on the bug 1213863")
    catalog_tree('All Catalogs')
    cfg_btn('Add a New Catalog')


menu.nav.add_branch(
    'services_catalogs', {
        'catalogs': [
            lambda _: accordion.click('Catalogs'), {
                'catalog_new':
                _all_catalogs_add_new,
                'catalog': [
                    lambda ctx: catalog_tree('All Catalogs', ctx[
                        'catalog'].name), {
                            'catalog_edit': lambda _: cfg_btn("Edit this Item")
                        }
                ]
            }
        ]
    })


class Catalog(Updateable, Pretty):
    """Represents a Catalog"""
 def f(_):
     accordion.click(acc)
     visible_tree.click_path(tree)
                 "infra_archive_obj":
                 lambda ctx: visible_tree.click_path(ctx["archive_name"]
                                                     ),
             }
         ],
         "vm_templates_orphaned_branch": [
             lambda ctx: visible_tree.click_path('Orphaned'), {
                 "infra_orphan_obj":
                 lambda ctx: visible_tree.click_path(ctx["orphan_name"]
                                                     ),
             }
         ],
     }
 ],
 "infra_vms": [
     lambda _: accordion.click("VMs"), {
         "infra_vms_filter_folder": [
             lambda ctx: visible_tree.click_path(ctx["folder_name"]), {
                 "infra_vms_filter":
                 lambda ctx: visible_tree.click_path(ctx["filter_name"]
                                                     ),
             }
         ],
     }
 ],
 "infra_templates": [
     lambda _: accordion.click("Templates"), {
         "infra_templates_filter_folder": [
             lambda ctx: visible_tree.click_path(ctx["folder_name"]), {
                 "infra_templates_filter":
                 lambda ctx: visible_tree.click_path(ctx["filter_name"]
        ('edit_button', form_buttons.save),
    ])


def _orch_templates_create_dialog(context):
    accordion_tree('All Orchestration Templates',
        context['template_type'], context['template_name'])
    cfg_btn('Create Service Dialog from Orchestration Template')


menu.nav.add_branch(
    'services_catalogs',
    {
        'orchestration_templates':
        [
            lambda _: accordion.click('Orchestration Templates'),
            {
                'select_template':
                [
                    lambda ctx: accordion_tree('All Orchestration Templates',
                        ctx['template_type'], ctx['template_name']),
                    {'edit_template': lambda _: cfg_btn("Edit this Orchestration Template"),
                     'create_service_dialog': lambda _: cfg_btn("Create Service Dialog from "
                        "Orchestration Template")}
                ],
                'orch_template_type':
                [
                    lambda ctx: accordion_tree(
                        'All Orchestration Templates', ctx['template_type']),
                    {'create_new_template': lambda _: cfg_btn("Create new Orchestration Template")}
                ]
Esempio n. 16
0
    locators={
        'save_button': make_button("Save Changes"),
        'reset_button': make_button("Reset Changes"),
        'cancel_button': make_button("Cancel"),
        'add_button': make_button("Add"),
    },
    identifying_loc="//div[@id='buttons_on']/ul[@id='form_buttons']",
)

records_table = Table("//div[@id='records_div']/table[@class='style3']")

nav.add_branch("configuration",
    {
        "configuration_settings":
        [
            lambda _: accordion.click("Settings"),
            {
                "cfg_settings_region":
                lambda _: settings_tree.click_path("Region: Region"),

                "cfg_settings_defaultzone":
                lambda _: settings_tree.click_path("Region: Region", "Zones", "Default Zone"),

                "cfg_settings_schedules":
                [
                    lambda _: settings_tree.click_path("Region: Region", "Schedules"),
                    {
                        "cfg_settings_schedule":
                        [
                            lambda ctx: records_table.click_cell("name", ctx["schedule_name"]),
                            {
Esempio n. 17
0
            ('add_button', form_buttons.add)])


def _all_catalogs_add_new(_):
    if BZ(1213863).blocks:
        sel.pytest.skip("Blocker on the bug 1213863")
    catalog_tree('All Catalogs')
    cfg_btn('Add a New Catalog')


menu.nav.add_branch(
    'services_catalogs',
    {
        'catalogs':
        [
            lambda _: accordion.click('Catalogs'),
            {
                'catalog_new': _all_catalogs_add_new,
                'catalog':
                [
                    lambda ctx: catalog_tree('All Catalogs', ctx['catalog'].name),
                    {
                        'catalog_edit': lambda _: cfg_btn("Edit this Item")
                    }
                ]
            }
        ]
    }
)

Esempio n. 18
0
 def step(self):
     accordion.click('Relationships')
     # Click by anchor title since text contains a dynamic component
     sel.click('//*[@id="stack_rel"]//a[@title="Show all Resources"]')
Esempio n. 19
0
               "/div/div/div/div/div/div/pre/span")),
    ('add_button', form_buttons.add),
    ('edit_button', form_buttons.save),
])


def _orch_templates_create_dialog(context):
    accordion_tree('All Orchestration Templates', context['template_type'],
                   context['template_name'])
    cfg_btn('Create Service Dialog from Orchestration Template')


menu.nav.add_branch(
    'services_catalogs', {
        'orchestration_templates': [
            lambda _: accordion.click('Orchestration Templates'), {
                'select_template': [
                    lambda ctx: accordion_tree('All Orchestration Templates',
                                               ctx['template_type'], ctx[
                                                   'template_name']),
                    {
                        'edit_template':
                        lambda _: cfg_btn("Edit this Orchestration Template"),
                        'create_service_dialog':
                        lambda _: cfg_btn("Create Service Dialog from "
                                          "Orchestration Template")
                    }
                ],
                'orch_template_type': [
                    lambda ctx: accordion_tree('All Orchestration Templates',
                                               ctx['template_type']),
Esempio n. 20
0
    cfg_btn('Add a New Catalog Item')
    provider_type = context['provider_type']
    sel.select("//select[@id='st_prov_type']", provider_type)


def _all_catalogbundle_add_new(context):
    accordion_tree('All Catalog Items')
    cfg_btn('Add a New Catalog Bundle')


menu.nav.add_branch(
    'services_catalogs',
    {
        'catalog_items':
        [
            lambda _: accordion.click('Catalog Items'),
            {
                'catalog_item_new': _all_catalogitems_add_new,
                'catalog_item':
                [
                    lambda ctx: accordion_tree(
                        'All Catalog Items', ctx['catalog'], ctx['catalog_item'].name),
                    {
                        'catalog_item_edit': lambda _: cfg_btn("Edit this Item")
                    }
                ]
            }
        ],
        'catalog_bundle':
        [
            lambda _: accordion.click('Catalog Items'),
Esempio n. 21
0
                    }
                ],

                "vm_templates_orphaned_branch":
                [
                    lambda ctx: visible_tree.click_path('Orphaned'),
                    {
                        "infra_orphan_obj": lambda ctx: visible_tree.click_path(ctx["orphan_name"]),
                    }
                ],
            }
        ],

        "infra_vms":
        [
            lambda _: accordion.click("VMs"),
            {
                "infra_vms_filter_folder":
                [
                    lambda ctx: visible_tree.click_path(ctx["folder_name"]),
                    {
                        "infra_vms_filter": lambda ctx: visible_tree.click_path(ctx["filter_name"]),
                    }
                ],
            }
        ],

        "infra_templates":
        [
            lambda _: accordion.click("Templates"),
            {