Beispiel #1
0
def eenter_ome_details(ome_ip, ome_username, ome_password):
    """
    This function is used for entering OME ip and credentials

    Function Owner : Abdul_G_Shaik

    Date created : 06/09/2016

    @@param ome_ip : (string) OME ip of system
    @param ome_userName : (string) OME user name
    @param ome_password : (string) OME password

    @return status : (bool) status of execution.if successful True else False
    @return msg : (string) step message in case of exception
    """
    msg, status = "", True

    try:
        'Click on + button'
        time.sleep(5)
        flag0 = ui_controls.button(get_obj_identifier('ome_add_btn'))
        print 'plus button clicked'

        'Enter OME application ip and credentials'
        flag1 = ui_controls.text_box(
            get_obj_identifier('addOme_ipHostname_txt'), ome_ip)
        flag2 = ui_controls.text_box(get_obj_identifier('addOme_username_txt'),
                                     ome_username)
        flag3 = ui_controls.text_box(get_obj_identifier('addOme_password_txt'),
                                     ome_password)
        ui_controls.hide_keyboard()
        time.sleep(5)
        'Click on + button'

        time.sleep(5)
        flag4 = ui_controls.Click(get_obj_identifier('addOme_add_btn'))
        print 'add ome button clicked'
        time.sleep(5)
        flag5 = ui_controls.Click(
            get_obj_identifier('addome_confirmation_yes_btn'))
        time.sleep(20)
        #flag6=ui_controls.Click(get_obj_identifier('save_btn'))
        time.sleep(5)
        flag7 = ui_controls.Click(get_obj_identifier('alert_ok_btn'))
        time.sleep(10)
        status = False if not (flag0 and flag1 and flag2 and flag3 and flag4
                               and flag5 and flag7) else True
    except Exception as excp:
        traceback.print_exc()
        msg += str(excp)
        status = False
    return status, msg
Beispiel #2
0
def jaff_a():
    """
    This function is used for selecting the Alert Subscription option

    Function Owner : Abdul_G_Shaik

    Date created : 06/10/2016

    @return status : (bool)status of execution.if successful True else False
    @return msg : (string) step message in case of exception
    """

    msg, status = "", True
    try:

        if g.platform == 'android':

            'Click on + button'
            time.sleep(5)
            flag1 = ui_controls.Click(get_obj_identifier('addOme_add_btn'))
            print 'add ome button clicked'
            flag2 = ui_controls.Click(
                get_obj_identifier('addome_confirmation_yes_btn'))

            time.sleep(5)
            flag6 = ui_controls.Click(get_obj_identifier('save_btn'))
            time.sleep(5)
            flag7 = ui_controls.Click(get_obj_identifier('alert_ok_btn'))
            flag = False if not (flag1 and flag2 and flag6 and flag7) else True
        else:

            'Click on add idrac button'
            time.sleep(5)
            flag1 = ui_controls.Click(get_obj_identifier('sve_opt'))

            flag = False if not (flag1) else True
        if not flag:
            return False, msg
        else:
            print "License agreement screen name is displayed properly"

    except Exception as excp:
        traceback.print_exc()
        msg += str(excp)
        return False, msg
    return True, msg
Beispiel #3
0
def ddelete_ome():
    """
    This function is used to delete OME ip

    Function Owner : Abdul_G_Shaik

    Date created : 23/06/2016

    @param ome_ip : (string) OME ip to be deleted

    @return status : (bool) status of execution.if successful True else False
    @return msg : (string) step message in case of exception
    """
    msg, status = "", True
    try:
        if g.platform == 'android':
            'Navigate to home screen'
            time.sleep(15)
            flag1 = navigate_home()

            'Select OME checkbox'
            flag2 = ui_controls.Click(get_obj_identifier('ome_select_chk'))
            print 'OME Selected'
           
            flag3 =ui_controls.button(get_obj_identifier('ome_delete_btn'))
          
            flag4 =ui_controls.button(get_obj_identifier('confirmdelete_yes_btn'))
            
        else:
            time.sleep(15)
            'Select configuration button'
            flag1 = ui_controls.button(get_obj_identifier('device_configuration_btn'))

            time.sleep(10)
            ' Select Edit Connection'
            flag2 = ui_controls.button(get_obj_identifier('omeconfiguration_editconnection_txtView'))

            'Click delete button'
            flag3 = ui_controls.button(get_obj_identifier('ome_delete_btn'))
            print 'Delete button clicked'
            time.sleep(5)

            #'Click yes button on popup'
           # flag4 = ui_controls.button(get_obj_identifier('confirmdelete_yes_btn'))
            time.sleep(5)
        status = False if not (flag1 and flag2 and flag3 and flag4) else True
    except Exception as excp:
        traceback.print_exc()
        status = False
        msg += str(excp)
    return status, msg
Beispiel #4
0
def enter_ome_values(ome_ip, ome_username, ome_password):
    """
    This function is used for entering OME ip and credentials

    Function Owner : Abdul_G_Shaik

    Date created : 06/09/2016

    @@param ome_ip : (string) OME ip of system
    @param ome_userName : (string) OME user name
    @param ome_password : (string) OME password

    @return status : (bool) status of execution.if successful True else False
    @return msg : (string) step message in case of exception
    """
    msg, status = "", True

    try:
        #flag0 = ui_controls.Click(get_obj_identifier('open_manage_esntials_elmnt'))
        #print 'openManage Essentials selected successfully'

        'Enter OME application ip and credentials'
        flag1 = ui_controls.text_box(get_obj_identifier('addOme_ipHostname_txt'),ome_ip)
        flag2 = ui_controls.text_box(get_obj_identifier('addOme_username_txt'),ome_username)
        flag3 = ui_controls.text_box(get_obj_identifier('addOme_password_txt'),ome_password)
        ui_controls.hide_keyboard()
        time.sleep(5)
        'Click add button'
        #flag4 = ui_controls.button(get_obj_identifier('addOme_add_btn'))
        print 'OME details entered successfully'
        #flag5 = ui_controls.Click(get_obj_identifier('yes_pop_up_btn'))
        #time.sleep(7)
        flag4 = ui_controls.Click(get_obj_identifier('save_btn'))
        #time.sleep(5)
        #flag7 = ui_controls.Click(get_obj_identifier('yes_pop_up_btn'))
        #flag7 = ui_controls.Click(get_obj_identifier('Ok_bttn'))
        #time.sleep(15)

        status = False if not (flag1 and flag2 and flag3) else True
    except Exception as excp:
        traceback.print_exc()
        msg += str(excp)
        status = False
    return status, msg
Beispiel #5
0
def aadd_ome_wizard():
    """
    This function is used for clicking idrac button

    Function Owner : Sudhish_Singh

    Date created : 

    @return status : (bool)status of execution.if successful True else False
    @return msg : (string) step message in case of exception
    """
    msg, status = "", True

    try:
        'Click on Plus button to launch Add OME wizard'
        time.sleep(5)
        ui_controls.Click(get_obj_identifier('ome_add_btn'))
        print 'plus button clicked Successfully'

        'Check for the existence of Add OME text'
        text_heading = ui_controls.text_view(get_obj_identifier('add_txt'))
        print "Current text value is==>"+str(text_heading)

        'To check if it is returning empty value here'
        if not text_heading:
            print "Add OME text does not exist and it is returning empty value."
            return False, msg

        'Comparing text retrieved from UI with Add OME text'
        if "Add".strip() == text_heading.strip():
            print ("Add OME text has been found!!!")
        else:
            print("Sorry!!!text has been mismatched,it should be Add OME")
            return False, msg

    except Exception as excp:
        traceback.print_exc()
        msg += str(excp)
        status = False
    return status, msg
Beispiel #6
0
def select_device_and_create_powertask():
    """
    This function is used to select a target MN to create the power task under OME from OMM.

    Function Owner : Sudhish_Singh

    Date created : 

    @return status : (bool)status of execution.if successful True else False
    @return msg : (string) step message in case of exception
    """
    msg, status = "", True

    try:
        time.sleep(10)
        'Click on Devices pie chart to navigate under ALl Devices'
        flag1 = ui_controls.button(get_obj_identifier('devices_health_piechart'))
        time.sleep(40)

        'Select RAC group and click on it during power task creation'

        flag2 = ui_controls.Click_MultipleUIElements_Selectpassedelement(get_obj_identifier('device_type_rac_powertask'),Elementnameforselection='RAC',elementidentifier='device_type_rac_powertask',elementname='RAC')
        time.sleep(40)

        'select the passed target device for power task creation'
        flag3 = ui_controls.Click_MultipleUIElements_Selectpassedelement(get_obj_identifier('powertask_target_mn'),Elementnameforselection='idrac',elementidentifier='powertask_target_mn',elementname='idrac8')
        time.sleep(5)
        'click on power option menu'
     
        flag4 = ui_controls.Click(get_obj_identifier('more_options_btn'))
        'Click on power button for navigating to power options page(reboot page)'
        flag5 = ui_controls.Click(get_obj_identifier('powertask_power_btn'))
        time.sleep(5)

        'First enter the task credentials here'
        #flag6 = ui_controls.text_box(get_obj_identifier('powertask_username_txt'),'Lexington123')
        #flag7 = ui_controls.text_box(get_obj_identifier('powertask_password_txt'),'administrator')
        flag6 = ui_controls.text_box(get_obj_identifier('powertask_username_txt'),'administrator')
        flag7 = ui_controls.text_box(get_obj_identifier('powertask_password_txt'),'Lexington123')
        ui_controls.hide_keyboard()
        time.sleep(5)

        'click on Enable All check box'
        flag8 = ui_controls.check_box(get_obj_identifier('powertask_enableall_checkbox'))
        time.sleep(5)

        'select appropriate power task for creation as per test case requirement'
        flag9 = ui_controls.check_box(get_obj_identifier('powertask_radio_poweron'))
        time.sleep(5)

        'Click on submit for creating the task under OME for same device'
        flag10 = ui_controls.Click(get_obj_identifier('powertask_submit_btn'))
        time.sleep(5)

        'Click on Yes button from confirm operation window'
        flag11 = ui_controls.Click(get_obj_identifier('powertask_confirmoperation_yes_btn'))
        time.sleep(5)

        #'Click on Task manager button to monitor task status under Task manager window'
        #flag11 = ui_controls.Click(get_obj_identifier('powertask_taskmgr_taskmanager_btn'))
        #time.sleep(5)
        'click on task manager on power task pop up'
        flag12 = ui_controls.Click(get_obj_identifier('taskmngr_btn'))

        'Here we will verify if Task Manager window has been launched successfully or not'
        flag13,msg = element_textvalidation('taskmanager_window','Task Manager')
        time.sleep(4)

        'Check for task name under Task Manager window'
        flag14,msg = element_textvalidation('powertask_name_taskmanager','Power On of idrac')


        status = False if not (flag1 and flag2 and flag3 and flag4 and flag5 and flag6 and flag7 and flag8 and flag9 and flag10 and flag11 and flag12 and flag13 and flag14) else True

        print status

    except Exception as excp:
        traceback.print_exc()
        msg += str(excp)
        status = False
    return status, msg