Exemplo n.º 1
0
 def verify_lig_scopes(cls, timeout=5, fail_if_false=True):
     ligs_list = CommonOperationLogicalInterconnectGroups.get_lig_list()
     for lig_name in ligs_list:
         logger.debug("selecting LIG: %s" % lig_name)
         lig_select_status = ui_lib.wait_for_element_and_click(
             GeneralScopesElements.ID_LIG_TABLE % lig_name, timeout,
             fail_if_false)
         logger.debug("the lig_select_status is %s" % lig_select_status)
         if lig_select_status is False:
             logger._warn("Failed to click LIG: {0}".format(lig_name))
             return ui_lib.fail_test("Failed to click LIG")
         else:
             logger.debug(
                 "'{0}' LIG is selected Successfully ".format(lig_name))
         msg = 'No scopes'
         return ui_lib.wait_for_element_text_match(
             GeneralScopesElements.ID_SCOPE_MESSAGE, msg, fail_if_false)
Exemplo n.º 2
0
 def verify_li_scopes(cls, timeout=5, fail_if_false=True):
     LI_list = CommonOperationLogicalInterconnect.get_li_list()
     logger.debug("the LI list is %s" % LI_list)
     for LI_name in LI_list:
         logger.debug("selecting LI: %s" % LI_name)
         LI_select_status = ui_lib.wait_for_element_and_click(
             GeneralScopesElements.ID_LI_TABLE % LI_name, timeout,
             fail_if_false)
         logger.debug("the LI_select_status is %s" % LI_select_status)
         if LI_select_status is False:
             logger._warn("Failed to click LI: {0}".format(LI_name))
             return ui_lib.fail_test("Failed to click the element")
         else:
             logger.debug(
                 "'{0}' LI is selected Successfully".format(LI_name))
         msg = 'No scopes'
         return ui_lib.wait_for_element_text_match(
             GeneralScopesElements.ID_SCOPE_MESSAGE, msg, fail_if_false)
Exemplo n.º 3
0
 def verify_network_scopes(cls, timeout=5, fail_if_false=True):
     Networks_list = CommonOperationNetworks.get_network_list()
     for network_name in Networks_list:
         logger.debug("selecting Network: %s" % network_name)
         network_select_status = ui_lib.wait_for_element_and_click(
             GeneralScopesElements.ID_NETWORK_TABLE % network_name, timeout,
             fail_if_false)
         logger.debug("the network_select_status is %s" %
                      network_select_status)
         if network_select_status is False:
             logger._warn(
                 "Failed to click Network: {0}".format(network_name))
             return ui_lib.fail_test("Failed to click the element")
         else:
             logger.debug("'{0}' Network is selected Successfully".format(
                 network_name))
         msg = 'No scopes'
         return ui_lib.wait_for_element_text_match(
             GeneralScopesElements.ID_SCOPE_MESSAGE, msg, fail_if_false)
def is_contents_section_empty():
    """
        Verify if the Rack Table in System Profile Edit page is empty
    """

    if not ui_lib.wait_for_element_visible(systemprofilesPage.ID_PAGE_LABEL):
        navigate()
    if not ui_lib.wait_for_element_visible(
            systemprofilesPage.ID_LABEL_CONTENTS):
        navigateOverview()
    logger._log_to_console_and_log_file(
        "\n\t- Verifying if contents section is empty,\n\t once there are no racks associated to the System Profile."
    )
    if not (ui_lib.wait_for_element_text_match(
            systemprofilesPage.OVERVIEW_CONTENTS,
            mantraConstants.EMPTY_OVERVIEW_CONTENTS_MESSAGE)):
        ui_lib.fail_test(
            "System Profile Contents was not empty or was not able to retrieve data. Check the screenshot.",
            captureScreenshot=True)
Exemplo n.º 5
0
 def verify_enclosure_scopes(cls, timeout=5, fail_if_false=True):
     ENCLOSURES_list = _BaseCommonOperationEnclosures.get_enclosure_list(
         timeout=5)
     for ENCLOSURES_name in ENCLOSURES_list:
         logger.debug("selecting ENCLOSURE: %s" % ENCLOSURES_name)
         ENCLOSURES_select_status = ui_lib.wait_for_element_and_click(
             GeneralScopesElements.ID_ENCLOSURE_TABLE % ENCLOSURES_name,
             timeout, fail_if_false)
         logger.debug("the ENCLOSURES_select_status is %s" %
                      ENCLOSURES_select_status)
         if ENCLOSURES_select_status is False:
             logger._warn(
                 "Failed to click ENCLOSURE: {0}".format(ENCLOSURES_name))
             return ui_lib.fail_test("Failed to click the element")
         else:
             logger.debug("'{0}' ENCLOSURE is selected Successfully".format(
                 ENCLOSURES_name))
         msg = 'No scopes'
         return ui_lib.wait_for_element_text_match(
             GeneralScopesElements.ID_SCOPE_MESSAGE, msg, fail_if_false)
Exemplo n.º 6
0
 def verify_interconnects_scopes(cls, timeout=5, fail_if_false=True):
     INTERCONNECTS_list = CommonOperationInterconnects.get_interconnect_list(
     )
     for INTERCONNECTS_name in INTERCONNECTS_list:
         logger.debug("selecting INTERCONNECTS: %s" % INTERCONNECTS_name)
         INTERCONNECTS_select_status = ui_lib.wait_for_element_and_click(
             GeneralScopesElements.ID_INTERCONNECTS_TABLE %
             INTERCONNECTS_name, timeout, fail_if_false)
         logger.debug("the INTERCONNECTS_select_status is %s" %
                      INTERCONNECTS_select_status)
         if INTERCONNECTS_select_status is False:
             logger._warn("Failed to click INTERCONNECTS: {0}".format(
                 INTERCONNECTS_name))
             return ui_lib.fail_test("Failed to click the element")
         else:
             logger.debug(
                 "'{0}' INTERCONNECTS is selected Successfully".format(
                     INTERCONNECTS_name))
         msg = 'No scopes'
         return ui_lib.wait_for_element_text_match(
             GeneralScopesElements.ID_SCOPE_MESSAGE, msg, fail_if_false)
Exemplo n.º 7
0
 def verify_serverhw_scopes(cls, timeout=5, fail_if_false=True):
     ui_lib.wait_for_element(GeneralScopesElements.ID_SERVERHW_TABLE)
     SERVERHW_list = CommonOperationServerHardware.get_server_hardware_list(
     )
     for SERVERHW_name in SERVERHW_list:
         logger._log_to_console_and_log_file("selecting SERVERHW: %s" %
                                             SERVERHW_name)
         SERVERHW_select_status = ui_lib.wait_for_element_and_click(
             GeneralScopesElements.ID_SERVERHW_TABLE % SERVERHW_name, 10,
             fail_if_false)
         logger.debug("the SERVERHW_select_status is %s" %
                      SERVERHW_select_status)
         if SERVERHW_select_status is False:
             logger._warn(
                 "Failed to click SERVERHW: {0}".format(SERVERHW_name))
             return ui_lib.fail_test("Failed to click the element")
         else:
             logger._log_to_console_and_log_file(
                 "'{0}' SERVERHW is selected Successfully".format(
                     SERVERHW_name))
     msg = 'No scopes'
     return ui_lib.wait_for_element_text_match(
         GeneralScopesElements.ID_SCOPE_MESSAGE, msg, fail_if_false)
def add_localgoldenimage(self, *testdata):
    """ Select Add-Golden-Image
        Example:
        | `Select Add-Golden-Image`      |     |
    """
    navigate()
    if ui_lib.wait_for_element_and_click(i3sgoldenimagePage.ID_ADD_GI):
        ui_lib.wait_for_element_visible(i3sgoldenimagePage.ID_ADD_GI_PAGE)
        logging._log_to_console_and_log_file(
            "Successfully opened Add-golden-image page")

        s2l = ui_lib.get_s2l()
        error = 0
        return_data = ""

        if not s2l._is_element_present(i3sgoldenimagePage.ID_ADD_GI_PAGE):
            navigate()

        testdata = list(testdata[0])
        logging._log_to_console_and_log_file(type(testdata))

        for gi in testdata:
            # if gi.name not in testdata:
            # logger._warn("LS '%s' does not exist" % gi.name)
            # error += 1
            # continue

            ui_lib.wait_for_element_and_input_text(
                i3sgoldenimagePage.ID_INPUT_NAME, gi.name)

            ui_lib.wait_for_element_and_input_text(
                i3sgoldenimagePage.ID_INPUT_DESCRIPTION, gi.description)

            ui_lib.wait_for_element_and_click(
                i3sgoldenimagePage.RADIOBUTTON_SELECT_LOCAL_SOURCE)
            sleep(3)

            # if  ui_lib.wait_for_element_visible(i3sgoldenimagePage.CLICK_BROWSE_BUTTON, PerfConstants.FIRMWARE_ADD_BUTTON_TIME):
            ui_lib.wait_for_element_visible(
                i3sgoldenimagePage.CLICK_BROWSE_BUTTON,
                PerfConstants.FIRMWARE_ADD_BUTTON_TIME)
            s2l.click_element(i3sgoldenimagePage.CHOOSE_FILE)
            ui_lib.wait_for_element_visible(
                i3SImageBundlePage.ID_BTN_CHOOSE_FILE,
                PerfConstants.FIRMWARE_CHOOSE_BUTTON_TIME)
            s2l.choose_file(i3sgoldenimagePage.CHOOSE_FILE,
                            "C:\Users\sasankot\Downloads\hpesxi.zip")
            if ntnative.NativeOsKeywords.send_keys_to_native_window(
                    "{TAB}{TAB}{TAB}{ENTER}"):
                logging._log_to_console_and_log_file(
                    "Able to close the window...")
            else:
                logging._log_to_console_and_log_file(
                    "Not Able to close the window ...")
                return False

            if ui_lib.wait_for_element_visible(
                    i3sgoldenimagePage.ID_ADD_GI_BUTTON):
                logging._log_to_console_and_log_file("Able to find Add Button")
                ui_lib.wait_for_element_and_click(
                    i3sgoldenimagePage.ID_ADD_GI_BUTTON)
            else:
                logging._log_to_console_and_log_file(
                    "Not able to find Add Button")
                return False

            logging._log_to_console_and_log_file(
                "Adding GI in to the DB please wait ...")
            # sleep(180)

            if ui_lib.wait_for_element_text_match(
                    i3sgoldenimagePage.ID_STATUS_GI_ERROR, "Unknown"):
                logging._log_to_console_and_log_file(
                    "Failed to Add-golden-image")
                return False

            # ui_lib.wait_for_element_and_click(i3sgoldenimagePage.ID_CANCEL_GI_BUTTON)
            elif ui_lib.wait_for_element_text_match(
                    i3sgoldenimagePage.ID_STATUS_GI, "ok"):
                logging._log_to_console_and_log_file(
                    "Golden Image Added successfully.")
                return True
            else:
                logging._log_to_console_and_log_file("unknown reason")
                return False
        return
Exemplo n.º 9
0
 def verify_sans_title(cls, sans, timeout=10, fail_if_false=True):
     logger.info('verifying [ SANS title= %s ] is visible' % sans)
     ui_lib.wait_for_element_text_match(GeneralSANsElements.ID_SANS_TITLE, sans, timeout=5)
 def verify_interconnect_bay_configuration_icm_type(cls, enc_no, switch_no, expect_value, timeout=5, fail_if_false=True):
     locator = VerifyEnclosureGroupElements.ID_TEXT_ENG_SELECTED_INTERCONNECT_TYPE % (enc_no, switch_no)
     item_name = "Enclosure group interconnect type"
     ui_lib.wait_for_element_text_match(locator=locator, regex=expect_value, timeout=timeout, fail_if_false=False)
     return FusionUIBase.verify_element_text(item_name=item_name, locator=locator, expect_value=expect_value, timeout=timeout, fail_if_false=fail_if_false)
 def verify_os_deployment_settings_network_type(cls, expect_value, timeout=5, fail_if_false=True):
     locator = VerifyEnclosureGroupElements.ID_TEXT_DEPLOYMENT_NETWORK_TYPE
     item_name = "Deployment network type"
     ui_lib.wait_for_element_text_match(locator=locator, regex=expect_value, timeout=timeout, fail_if_false=False)
     return FusionUIBase.verify_element_text(item_name=item_name, locator=locator, expect_value=expect_value, timeout=timeout, fail_if_false=fail_if_false)
 def verify_power_mode(cls, expect_value, timeout=5, fail_if_false=True):
     locator = VerifyEnclosureGroupElements.ID_TEXT_POWER_MODE
     item_name = "Power mode"
     ui_lib.wait_for_element_text_match(locator=locator, regex=expect_value, timeout=timeout, fail_if_false=False)
     return FusionUIBase.verify_element_text(item_name=item_name, locator=locator, expect_value=expect_value, timeout=timeout, fail_if_false=fail_if_false)
 def verify_general_used_by(cls, expect_value, timeout=5, fail_if_false=True):
     locator = VerifyEnclosureGroupElements.ID_TEXT_GENERAL_USED_BY
     item_name = "Used by"
     ui_lib.wait_for_element_text_match(locator=locator, regex=expect_value, timeout=timeout, fail_if_false=False)
     return FusionUIBase.verify_element_text(item_name=item_name, locator=locator, expect_value=expect_value, timeout=timeout, fail_if_false=fail_if_false)
 def verify_general_ipv4_address(cls, expect_value, timeout=5, fail_if_false=True):
     locator = VerifyEnclosureGroupElements.ID_TEXT_GENERAL_IPV4_ADDRESS
     item_name = "IPv4 management address"
     ui_lib.wait_for_element_text_match(locator=locator, regex=expect_value, timeout=timeout, fail_if_false=False)
     return FusionUIBase.verify_element_text(item_name=item_name, locator=locator, expect_value=expect_value, timeout=timeout, fail_if_false=fail_if_false)