Пример #1
0
def alert_subscription():
    """
    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:
        'verify Alert Subscription pop up window appears'
        element = ui_controls.ui_element(get_obj_identifier('alert_subscription_lbl'))
        if(element is None):
            flag1 = False
        else:
            flag1 = True
        if g.platform == 'ios':
            'Click skip button'
            flag2 = ui_controls.button(get_obj_identifier('alert_subscription_skip_btn'))
            time.sleep(10)
        else:
            'Click OK button'
            flag2 = ui_controls.button(get_obj_identifier('alert_subscription_ok_btn'))
            time.sleep(10)

        status = False if not (flag1 and flag2) else True
    except Exception as excp:
        traceback.print_exc()
        msg += str(excp)
        status = False
    return status, msg
Пример #2
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
Пример #3
0
def accept_ssl_certificate():
    """
    This function is used for clicking accept button on SSL Certificate window

    Function Owner : Abdul_G_Shaik

    Date created : 06/09/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:
        'verify SSL certificate pop up window appears'
        element = ui_controls.ui_element(
            get_obj_identifier('addOme_certificate_win'))
        print 'alert is verified'
        if (element is None):
            flag1 = False
        else:
            flag1 = True

        'Click accept button'
        flag2 = ui_controls.button(
            get_obj_identifier('addOme_certificate_accept_btn'))
        time.sleep(5)
        #flag3 = ui_controls.button(get_obj_identifier('sve_opt'))

        status = False if not (flag1 and flag2) else True
    except Exception as excp:
        traceback.print_exc()
        msg += str(excp)
        status = False
    return status, msg
Пример #4
0
def click_add_ome():
    """
    This function is used for clicking OME button

    Function Owner : Abdul_G_Shaik

    Date created : 06/09/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 == 'ios':
            'Click on add idrac button'
            time.sleep(5)
            flag1 = ui_controls.button(get_obj_identifier('add_ome_btn'))
            print 'OME button clicked on lower bar'

            #'Verify page name changes to OME'
            #flag2 = ui_controls.label(get_obj_identifier('add_ome_lbl'))
            #time.sleep(5)
            'Click Add device button'
            #if flag2:
                #time.sleep(5)
                #flag3 = ui_controls.button(get_obj_identifier('ome_add_btn'))
                #print 'Add Icon (+) clicked'
                #time.sleep(5)
        else:
            'Click on + button'
            time.sleep(5)
            flag1 = ui_controls.button(get_obj_identifier('ome_add_btn'))
            print 'plus button clicked'
            #flag2 =   ui_controls.button(get_obj_identifier('open_manage_esntials_elmnt'))
            #print 'OpenManage essentials element'
       

        status = False if not (flag1) else True
    except Exception as excp:
        traceback.print_exc()
        msg += str(excp)
        status = False
    return status, msg
Пример #5
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
Пример #6
0
    def test_1200_1(self):
        """
        @testcase: Testcase_1200
        """
        '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'
        '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'
        '####################################################################################'
        '####################################################################################'
        '***************************Work Flow when VNC is enabled & bvnc is not installed'
        '####################################################################################'
        '####################################################################################'
        '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'
        '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'
        
        '#####################################################################################'
        'Add code below to Enable VNC & set password & set SSLEncryptionBitLength to Disabled '
        '#####################################################################################'
#         idrac_lib.apply_vnc_attributes('Enable', 1, idrac_ip, idrac_userName, idrac_password,
#                         windows_ip, windows_username, windows_password)
#          idrac_lib.apply_vnc_attributes('Password', 'calvin', idrac_ip, idrac_userName, idrac_password,
#                        windows_ip, windows_username, windows_password)
#         idrac_lib.apply_vnc_attributes('SSLEncryptionBitLength', 'Disabled', idrac_ip, idrac_userName, idrac_password,
#                       windows_ip, windows_username, windows_password)
        '#####################################################################################'
        'Verify license agreement screen and accept license'
        #step_1 = obj_omm.step_verify_license_agreement_screenname
        #step_15 = obj_omm.step_accept_license
        
        'Verify share app Data screen and do not share'
        #step_3 = obj_omm.step_verify_share_appData_screenname
        #step_16 = obj_omm.step_dont_share
        
        'Verify create password screen and create password'
        #step_5 = obj_omm.step_verify_createPassword_screen
        #step_17 = obj_omm.step_create_password
        
        'Verify demo mode screen and continue to OMM'
        #step_7 = obj_omm.step_verify_demomode_screenname
        #step_18 = obj_omm.step_trydemo_continue
       
        step_0 = obj_omm.step_add_idrac      
        'To launch Virtual Console from iDRAC home page'
        time.sleep(8)
        step_1 = obj_omm.step_launchVirtualConsole
        
        'To verify Virtual Console Alert message'
        step_2 = obj_omm.step_virtualConsoleAlertHandle
        
        'To install bvnc app'
        step_3 = obj_omm.step_install_bvnc_app
        
        'Stop the driver'
        step_4 = obj_common.step_stopDriver
        
        'Start driver to start app again'
        step_5 = obj_common.step_startDriver
    
           
        'Launch Virtual console after bvnc install'
        step_6 = obj_omm.step_launchVirtualConsole
        
        'Configure virtual console settings after bvnc install'
        step_7 = obj_omm.step_configureLaunchVirtualConsole
        
        'Verify the Alert on launching VNC'
        step_8 = obj_omm.step_verifylaunchVNCAlert
        
        'Verifying VNC Viewer'
        step_9 = obj_omm.step_verifyVNCViewer
        
        'Stop the driver'
        step_10 = obj_common.step_stopDriver
        
        'Start the driver again to launch bvnc for second time'
        step_11 = obj_common.step_startDriver

        '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'
        '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'
        '####################################################################################'
        '####################################################################################'
        '***************************Work flow when vnc is already installed'
        '####################################################################################'
        '####################################################################################'
        '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'
        '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'


        'Launch Virtual Console after bvnc install & after establishing handshake'
        step_12 = obj_omm.step_launchVirtualConsole
        
        'Configure vnc settings after establishing handshake'
        step_13 = obj_omm.step_configureLaunchVirtualConsole
        
        'View VNC Viewer after establishing hand shake'
        step_14 = obj_omm.step_verifyVNCViewer

         
#         'Flow when VNC is disabled'
#         '##### Code to disable VNC to be added ####'
#         idrac_lib.apply_vnc_attributes('Enable', 0, idrac_ip, idrac_userName, idrac_password,
#                       windows_ip, windows_username, windows_password)
#          
#         'Flow when encryption is set to 128-bit or higher '
#         idrac_lib.apply_vnc_attributes('SSLEncryptionBitLength', '128-bit or higher', idrac_ip, idrac_userName, idrac_password,
#                       windows_ip, windows_username, windows_password)
         
#         'Flow when encryption is set to 168-bit or higher'
#         idrac_lib.apply_vnc_attributes('SSLEncryptionBitLength', '168-bit or higher', idrac_ip, idrac_userName, idrac_password,
#                       windows_ip, windows_username, windows_password)
#         
#         'Flow when encryption is set to 256-bit or higher'
#         idrac_lib.apply_vnc_attributes('SSLEncryptionBitLength', '256-bit or higher', idrac_ip, idrac_userName, idrac_password,
#                       windows_ip, windows_username, windows_password)
#         
#         'Flow when encryption is set to AutoNegotiation'
#         idrac_lib.apply_vnc_attributes('SSLEncryptionBitLength', 'Auto Negotiate', idrac_ip, idrac_userName, idrac_password,
#                       windows_ip, windows_username, windows_password)
        
        if self.driver_start_status:
            
            testcase_parameters = {'startServer': False, 'stopServer': False}
            '#####################################################################################'
            'Add merged code to  login to OMM & navigate to the specific idrac page'
            '#####################################################################################'
            time.sleep(15)
            ui_controls.text_box('id=com.dell.omm:id/enter_password_enter_id', value='Dell')
            ui_controls.button('id=com.dell.omm:id/login_button_id')
            ui_controls.button('id=com.dell.omm:id/top_text')
            time.sleep(50)
            '#####################################################################################'
            
            'Execute steps to launch VNC & install bvnc'
            self.run_steps(step_0,step_1,step_2,step_3, step_4, step_5,
                           step_args=[self, testcase_parameters], continue_on_fail=True)

            '#####################################################################################'
            'Add merged code to  login to OMM & navigate to the specific idrac page'
            '#####################################################################################'        
            time.sleep(5)
            ui_controls.text_box('id=com.dell.omm:id/enter_password_enter_id', value='Dell')
            ui_controls.button('id=com.dell.omm:id/login_button_id')
            ui_controls.button('id=com.dell.omm:id/top_text')
            time.sleep(50)
            '#####################################################################################' 
            
            'Execute steps to launch VNC Viewer'
            self.run_steps(step_6, step_7, step_8, step_9, step_10, step_11,
                           step_args=[self, testcase_parameters], continue_on_fail=False)
 
 
            '#####################################################################################'
            'Add merged code to  login to OMM & navigate to the specific idrac page'
            '#####################################################################################'  
            ui_controls.text_box('id=com.dell.omm:id/enter_password_enter_id', value='Dell')
            ui_controls.button('id=com.dell.omm:id/login_button_id')
            ui_controls.button('id=com.dell.omm:id/top_text')
            time.sleep(45)
            '#####################################################################################'  
 
             
            'Execute steps to launch VNC Viewer when bvnc is already installed'
            self.run_steps(step_12, step_13, step_14,
                           step_args=[self, testcase_parameters], continue_on_fail=False)
            
        else:
            self.fail("Failed to start driver")       
Пример #7
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