def add_rack(rack_name):
    """
        Edit a system profile, adding a specific rack.
    """
    logger._log_to_console_and_log_file(
        "\n>>> Add rack \"%s\" to system profile." % rack_name)
    __open_edit_system_profile_page()
    # validating if rack is not already added to the system profile
    if ui_lib.wait_for_element_visible(systemprofilesPage.ID_LABEL_RACK_NAME %
                                       rack_name):
        ui_lib.wait_for_element_and_click(
            systemprofilesPage.ID_BUTTON_CANCEL_EDIT_SYSTEM_PROFILE)
        ui_lib.fail_test(
            "Rack \"%s\" cannot be added because it's already listed in rack's table"
            % rack_name)
    logger._log_to_console_and_log_file("\t-Clicking on \"Add rack\" button.")
    if not ui_lib.wait_for_element_and_click(
            systemprofilesPage.ID_BUTTON_ADD_RACK_FROM_EDIT_PAGE):
        ui_lib.wait_for_element_and_click(
            systemprofilesPage.ID_BUTTON_CANCEL_EDIT_SYSTEM_PROFILE)
        ui_lib.fail_test(
            "\"Add rack\" button is not available at Edit System Profile Page.",
            True)
    if not ui_lib.wait_for_element_and_click(
            systemprofilesPage.ID_ITEM_RACK_TO_BE_ADDED % rack_name):
        ui_lib.wait_for_element_and_click(
            systemprofilesPage.ID_BUTTON_CANCEL_EDIT_SYSTEM_PROFILE)
        ui_lib.fail_test("Rack named \"%s\" not found." % rack_name, True)
    ui_lib.wait_for_element_and_click(
        systemprofilesPage.ID_BUTTON_ADD_RACK_AND_CLOSE_PAGE)
    ui_lib.wait_for_element_and_click(
        systemprofilesPage.ID_BUTTON_EDIT_SYSTEM_PROFILE)
    ui_lib.wait_for_element_hidden(
        systemprofilesPage.ID_BUTTON_EDIT_SYSTEM_PROFILE,
        mantraSyncConstants.SYSTEM_PROFILE_TASK_TIMEOUT, True)
def remove_rack(rack_name):
    """
        Edit a system profile, removing a specific rack.
    """

    __open_edit_system_profile_page()
    if not __is_racks_table_empty():
        logger._log_to_console_and_log_file("\tRack(s) Found")
        logger._log_to_console_and_log_file("\tRemoving rack \"%s\"" %
                                            rack_name)
        if not ui_lib.wait_for_element_visible(
                systemprofilesPage.ID_LABEL_RACK_NAME % rack_name):
            ui_lib.wait_for_element_and_click(
                systemprofilesPage.ID_BUTTON_CANCEL_EDIT_SYSTEM_PROFILE)
            ui_lib.fail_test(
                "\tRack not found. Verify the rack name informed.")

        else:
            ui_lib.wait_for_element_and_click(
                systemprofilesPage.ID_BUTTON_REMOVE_RACK % rack_name)
            ui_lib.wait_for_element_and_click(
                systemprofilesPage.ID_BUTTON_EDIT_SYSTEM_PROFILE)
            ui_lib.wait_for_element_hidden(
                systemprofilesPage.ID_BUTTON_EDIT_SYSTEM_PROFILE,
                mantraSyncConstants.SYSTEM_PROFILE_TASK_TIMEOUT, True)
    else:
        ui_lib.wait_for_element_and_click(
            systemprofilesPage.ID_BUTTON_CANCEL_EDIT_SYSTEM_PROFILE)
        ui_lib.fail_test("\tNo Rack(s) Found. The Rack Table is empty.")
 def input_select_lig(cls, enc_no, switch_no, switch_lig, timeout=5):
     logger.debug("input and select logical interconnect group [ %s ] for <enclosure: %s, bay: %s>" % (switch_lig, enc_no, switch_no))
     ui_lib.wait_for_element_and_click(CreateEnclosureGroupElements.ID_COMBO_SEARCH_LIG % (enc_no, switch_no), timeout, fail_if_false=True)
     ui_lib.wait_for_element_and_click(CreateEnclosureGroupElements.ID_TBIRD_INPUT_LIG_CLEAR % (enc_no, switch_no), timeout, fail_if_false=True)
     ui_lib.wait_for_element_visible(CreateEnclosureGroupElements.ID_TBIRD_CHOOSE_LIG_LAYER % (enc_no, switch_no), timeout, fail_if_false=True)
     ui_lib.wait_for_element_and_click(CreateEnclosureGroupElements.ID_TBIRD_SELECT_OPTION_CHOOSE_LIG % (enc_no, switch_no, switch_lig), timeout, fail_if_false=True, js_click=True)
     ui_lib.wait_for_element_hidden(CreateEnclosureGroupElements.ID_TBIRD_CHOOSE_LIG_LAYER % (enc_no, switch_no), timeout, fail_if_false=True)
 def input_select_lig(cls, enc_no, switch_no, switch_lig, timeout=5):
     logger.debug("input and select logical interconnect group [ %s ] for <enclosure: %s, bay: %s>" % (switch_lig, enc_no, switch_no))
     BuiltIn().sleep(5)
     ui_lib.wait_for_element_and_input_text(CreateEnclosureGroupElements.ID_TBIRD_INPUT_CHOOSE_LIG % (enc_no, switch_no), switch_lig, timeout, fail_if_false=True)
     ui_lib.wait_for_element_visible(CreateEnclosureGroupElements.ID_TBIRD_CHOOSE_LIG_LAYER % (enc_no, switch_no), timeout, fail_if_false=True)
     ui_lib.wait_for_element_and_click(CreateEnclosureGroupElements.ID_TBIRD_SELECT_OPTION_CHOOSE_LIG % (enc_no, switch_no, switch_lig), timeout, fail_if_false=True, js_click=True)
     if ui_lib.wait_for_element_visible(EditEnclosureGroupElements.ID_TBIRD_TEXT_CHANGE_LIG_NOTIFICATION_HEADER, timeout, fail_if_false=False):
         msg_notification = ui_lib.get_text(EditEnclosureGroupElements.ID_TBIRD_TEXT_CHANGE_LIG_NOTIFICATION, timeout, fail_if_false=True)
         logger.info(msg_notification)
         ui_lib.wait_for_element_and_click(EditEnclosureGroupElements.ID_TBIRD_BUTTON_CHANGE_LIG_CONFIRM, timeout, fail_if_false=True)
     ui_lib.wait_for_element_hidden(CreateEnclosureGroupElements.ID_TBIRD_CHOOSE_LIG_LAYER % (enc_no, switch_no), timeout, fail_if_false=True)
Exemplo n.º 5
0
 def verify_create_plus_complete(cls, wait_timeout=10, fail_if_false=True):
     logger.debug("verify scope create+ complete")
     if not ui_lib.wait_for_element_hidden(
             VerifyScopesElements.ID_CREATE_SCOPE_FORM_MESSAGE,
             wait_timeout, False):
         ui_lib.fail_test("scope create failed")
     return ui_lib.wait_for_element_text(
         VerifyScopesElements.ID_INPUT_SCOPE_NAME, "", wait_timeout,
         fail_if_false)
Exemplo n.º 6
0
 def verify_create_plus_complete(cls, wait_timeout=10, fail_if_false=True):
     logger.debug("verify networkset create+ complete")
     if not ui_lib.wait_for_element_hidden(
             VerifyNetworkSetsElements.ID_CREATE_NETWORK_SET_FORM_MESSAGE,
             wait_timeout, False):
         ui_lib.fail_test("Network Set create failed")
     return ui_lib.wait_for_element_text(
         VerifyNetworkSetsElements.ID_INPUT_NETWORK_SET_NAME, "",
         wait_timeout, fail_if_false)
def rename_system_profile(new_system_profile_name):
    """
        Rename a system profile.
    """

    __open_edit_system_profile_page()
    logger._log_to_console_and_log_file(
        "\n-Renaming system profile to \"%s\"." % new_system_profile_name)
    ui_lib.wait_for_element_and_input_text(
        systemprofilesPage.ID_INPUT_SYSTEM_PROFILE_NAME,
        new_system_profile_name)
    ui_lib.wait_for_element_and_click(
        systemprofilesPage.ID_BUTTON_EDIT_SYSTEM_PROFILE)
    if not ui_lib.wait_for_element_hidden(
            systemprofilesPage.ID_BUTTON_EDIT_SYSTEM_PROFILE,
            mantraSyncConstants.SYSTEM_PROFILE_TASK_TIMEOUT):
        ui_lib.fail_test("Update system profile failed!",
                         captureScreenshot=True)