当前位置: 首页>>代码示例>>Python>>正文


Python PD_DebugLog.stepinfo方法代码示例

本文整理汇总了Python中Common.Utils.PD_DebugLog.stepinfo方法的典型用法代码示例。如果您正苦于以下问题:Python PD_DebugLog.stepinfo方法的具体用法?Python PD_DebugLog.stepinfo怎么用?Python PD_DebugLog.stepinfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Common.Utils.PD_DebugLog的用法示例。


在下文中一共展示了PD_DebugLog.stepinfo方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: pd_login

# 需要导入模块: from Common.Utils import PD_DebugLog [as 别名]
# 或者: from Common.Utils.PD_DebugLog import stepinfo [as 别名]
 def pd_login(self, driver, username, password):
     '''
     Use default configurations in shared_config file to login PD
     '''
         
     pd_browser_client = driver
 
     PD_DebugLog.stepinfo("Login PowerDirector")
     PD_DebugLog.debug_print("client browser title is " + pd_browser_client.title)
     assert "PowerDirector" in pd_browser_client.title
     PD_DebugLog.info_print("Page title: " + pd_browser_client.title)
 
     uid_input = pd_browser_client.find_element_by_id("uid")
     uid_input.send_keys(username)
     p_input = pd_browser_client.find_element_by_id("pword")
     p_input.send_keys(password)
     login_button = pd_browser_client.find_element_by_xpath("/html/body/div/form/div/p[4]/input")
     login_button.click()
     expect_welcome_panel = pd_browser_client.find_element_by_id("user_panel")
     welcome_text = "PowerDirector"
 
     try:
        if welcome_text in expect_welcome_panel.text:
             PD_DebugLog.debug_print(expect_welcome_panel.text)
     except:
         raise Login_Error("Login fails")
         pd_browser_client.quit()
 
     return pd_browser_client
开发者ID:xhan-shannon,项目名称:WebAutotest,代码行数:31,代码来源:Connect.py

示例2: test_upload_iso

# 需要导入模块: from Common.Utils import PD_DebugLog [as 别名]
# 或者: from Common.Utils.PD_DebugLog import stepinfo [as 别名]
 def test_upload_iso(self):
     u'''注册平台 后,需要上传ISO镜像用于安装虚拟机'''
     
     u'''???平台注册后,有什么标志可以用来检测判断已经成功注册'''
     # Step 1: 登陆PD Web界面(用户名密码在配置文件tests-shared.cfg)
     PD_DebugLog.stepinfo(Messages.LOGIN_POWERDIRECTOR) #"Login PowerDirector"
     pd_client_browser = self.driver
     pd_client_browser.implicitly_wait(30)
     pd_client_browser.maximize_window()
     
     # Login and pass in with username, password, server and port
     self.pd_login()
     
     # Step 2: 选择上传镜像快捷按钮
     print("select and click the upload image button")
     PD_DebugLog.stepinfo(Messages.SELECT_CLICK_UPLOAD_IMG)
     pd_browser_main_map = Main_Browser_UIMap(pd_client_browser)
     upload_iso_btn = pd_browser_main_map.get_upload_iso_btn()
     upload_iso_btn.click()
     time.sleep(TestSpeedControl.TEST_STEP_INTERVAL)
     
     # Step 3: verify the text of the header in the popup window 
     pd_register_vg_uimap = Upload_ISO_UIMap(pd_client_browser)
     expect_title = u"上传镜像"
     print("The title is: " + pd_register_vg_uimap.get_header().text)
     assert expect_title == pd_register_vg_uimap.get_header().text
     time.sleep(1)
         
     # Step 4: input the image name    
     image_name_input = pd_register_vg_uimap.get_image_name_input()
     image_name_input.send_keys('E:\\VMWare\\ubuntu_server\\start-download.iso')
     
     # Step 5: select iso radio button
     # ... the default selection is iso ...
     next_btn = pd_register_vg_uimap.get_next_button()
     time.sleep(1)
 
     # Step 6: select Toolkit 
     # ... default Toolkit ...
     time.sleep(1)  
     
     # Step 7: select OS name 
     pd_register_vg_uimap.select_osname_by_name("IBM ToolKit v54")
     time.sleep(1)
 
   
     next_btn.click()
     time.sleep(0.5)
开发者ID:xhan-shannon,项目名称:WebAutotest,代码行数:50,代码来源:UploadISO.py

示例3: test_powerdown_vm_normally

# 需要导入模块: from Common.Utils import PD_DebugLog [as 别名]
# 或者: from Common.Utils.PD_DebugLog import stepinfo [as 别名]
    def test_powerdown_vm_normally(self):
        u'''删除指定的已经存在虚拟机'''
        #
        # The id starts from 1.
        vm_id = 4   
        vm_name = "AutoTest_VM%02d" % vm_id
        vm_name = "PD3_Cluster_VM123"
        host_name = "localhost"


        '''
        Find the virtual machine first,
        Then, decide if it is running.
        If yes, shutdown the virtual machine.
        The third is to delete it.
        And at the same to watch history or task bar to detect if the deletion is running or finished.  
        
        '''
        
        # Step 1: Login and pass in with username, password, server and port
        pd_client_browser = self.pd_login()
        time.sleep(TestSpeedControl.TEST_STEP_INTERVAL)
        self.pd_client_browser = pd_client_browser
        
        # Step 2: Make sure the host resource tab is selected
        PD_DebugLog.stepinfo("click and select the host resource tab")
        
        pd_browser_main_map = Main_Browser_UIMap(pd_client_browser)
        self.pd_browser_main_map = pd_browser_main_map
        
        platform_resource_tab = pd_browser_main_map.get_platform_resource_tab()
        platform_resource_tab.click()
        time.sleep(TestSpeedControl.TEST_STEP_INTERVAL)
        
        # Step 3: Got the directory tree frame and check all the levels
        # travel around the leaves elements
        sub_tree = pd_browser_main_map.get_platform_sub_menu_tree()
        
        if type(sub_tree) is list:
            sub_menu_tree_elem = sub_tree[0]
        else:
            sub_menu_tree_elem = sub_tree
            
        platform_tree = Submenu_Tree(sub_menu_tree_elem)
        
        PD_DebugLog.debug_print("The tree id is: " + platform_tree.get_submenu_tree_id())
        
        tree_node = TreeNode(sub_menu_tree_elem)
        elemts = tree_node.get_all_child_nodes()
        
        if type(elemts) is list:
            fst_lvl_node_elm = elemts[0]
        else:
            fst_lvl_node_elm = elemts
        fst_lvl_node = TreeNode(fst_lvl_node_elm)
        PD_DebugLog.info_print("First level child node text is :" + fst_lvl_node.get_node_title() )      
        
        #platform_tree.travel_around_child_nodes()
        utils_misc.set_script_timeout(pd_client_browser, 0.2)
        pd_client_browser.implicitly_wait(6)
        elem = platform_tree.find_element_by_vmname(vm_name)
        if elem:
            elem_node = TreeNode(elem[0])
            PD_DebugLog.info_print("Find the elem, the title is " + elem_node.get_node_title())
            elem_node.click()
        time.sleep(TestSpeedControl.TEST_STEP_INTERVAL)
        
        utils_misc.restore_script_timeout(pd_client_browser)
        
        vm_summary_page = VM_Summary_UIMap(pd_client_browser)
        
        #task_startup_abouttime = time.time()
        # The testcase running machine time is not same as the AIX machine under test.  
        vm_summary_page.execute_powerdown_system(True)
        
        # Step 4: Check the vm current status, it would turn into "in shutdown progress"
        check_return = utils_misc.wait_for(vm_summary_page.is_vm_in_powerdown_progress, 10, 0.2, 0.1, "Check if vm goes into shutdown status")
        self.assert_(check_return, "After execution of shutdown action, vm must go into 'in shutdown progess'")
        
        if check_return:
            # find the task item to get the item information: starttime, name and description
            # Then to watch when it disappears
            # The end, check it in the history of task to get the final status, success or fail.
            # If it failed, get the failure description.
            
            # Step 5: to check task status and wait the task finishes
            # if popup_task is not open, click the button again
            
            task_type = u'断电'
            utils_misc.wait_for(self.shutdown_task_appears, 10, 0, 0.1, "Shutdown vm task should appear in current tasks list")
            taskstarttime = self.get_task_starttime(task_type, vm_name, host_name)
            utils_misc.wait_for(self.shutdown_task_disappears, 10, 0, 0.1, "Shutdown vm task should finish and go into the history tasks list")
            status,fail_desc = self.get_task_status_from_history_task(task_type, vm_name, host_name, taskstarttime)

            if status == Messages.FAIL_STATUS_STR:
                self.fail("The task failed: " + fail_desc)
            else:
                PD_DebugLog.debug_print("The task finished successfully.")
                             
         
#.........这里部分代码省略.........
开发者ID:xhan-shannon,项目名称:WebAutotest,代码行数:103,代码来源:PowerdownVM.py

示例4: register_platform_prc

# 需要导入模块: from Common.Utils import PD_DebugLog [as 别名]
# 或者: from Common.Utils.PD_DebugLog import stepinfo [as 别名]
    def register_platform_prc(self, caller_func_name, platform_ip, platform_name):
        '''
        The procedure is for registering platform and at the same time to check if 
        the platform and ip are already existing.
        '''
        def _action_on_trigger_element(_element):
            _element.click()
            
            
        logging.debug("Test RegisterPlatform debug info")
        # Step 1: Login and pass in with username, password, server and port
        PD_DebugLog.stepinfo("Login PowerDirector")
        pd_login_username = self.shared_config.get('DEFAULT', 'pd_login_username')
        pd_login_password = self.shared_config.get('DEFAULT', 'pd_login_password')
        
        pd_client_browser = PD_Login.login(self.driver, pd_login_username, pd_login_password)
        
        # Todo:
        # Need check if the current ip and platform is already registered
        # 1) click the tree nodes, expand the node
        # 2) jump to the summary frame page
        
        platform_ip_existing = self.check_if_platform_ip_existing(pd_client_browser, 
                                                                  platform_ip, 
                                                                  platform_name)
     
        # If the function is called by register_platform_check case
        cur_test_func_name = caller_func_name
        PD_DebugLog.debug_print("The current test function is: " + cur_test_func_name)
        if cur_test_func_name.lower().endswith('check'):
            msg = "The platform and IP are not registered"
            self.assertTrue(platform_ip_existing, msg)
            return
        else:
            self.assertFalse(platform_ip_existing)
        
        # If not, the function is executed by the normal register procedure
        # And go on to next step
        
        # Step 2: Click the register_platform button
        print("select and click the register platform button")
        #reg_pltfm_btn = pd_client_browser.find_elements(By.XPATH, "//*[@id=\"link_register_platform\"]")
        #reg_pltfm_btn.click()
        pd_client_browser.switch_to.default_content()
        reg_pltfm_elm = pd_client_browser.find_element_by_id("link_register_platform")
        reg_pltfm_elm.click()
        time.sleep(1)
        
        # Step 3: input the information for platform registering 
        pd_browser_map = Register_Platfrom_Frame_UIMap(pd_client_browser)
        ip_register_input = pd_browser_map.get_ip_register_input()
        ip_register_input.send_keys(platform_ip)
        platform_name_input = pd_browser_map.get_platform_name_input()
        platform_name_input.send_keys(platform_name)
        
        #pd_browser_map.update_file_select_text("E:\\TEAMSUN\\Lic\\060556A_8246-L2D_111.LIC")
    
        username_input = pd_browser_map.get_username_input()
        username_input.send_keys("padmin") 
        password_input = pd_browser_map.get_userpasswd_input()
        password_input.send_keys("padmin") 
        
        
        lic_file_path = "E:\\TEAMSUN\\Lic\\060556A_8246-L2D_111.LIC"
        file_select_btn = pd_browser_map.get_file_select_btn()
        
        #select_file_btn_elm.click()
        th = threading.Thread(target = _action_on_trigger_element, args =[
                                  file_select_btn])
        th.start()
        time.sleep(1)
            
        # Call WindowFinder Class
        upload_file_dialog_title = "文件上传"
        enter_str = "{ENTER}"
        win = WindowFinder.WindowFinder()
        win.find_window_wildcard(".*Open file.*")
        win.set_foreground()
        result_status = True
        try:
            time.sleep(1)
            SendKeys.SendKeys(lic_file_path)
            time.sleep(1)
            SendKeys.SendKeys(enter_str)
            time.sleep(3)
            assert(not th.isAlive())
        except:
            result_status = False
        
        time.sleep(2)
     
    #     pd_client_browser.switch_to_window(parent_h)  
        
        time.sleep(2)
        try:
            submit_btn = pd_browser_map.get_submit_btn()
            #saved_wnd = pd_client_browser.current_window_handle
            submit_btn.click()
            #current_wnd = pd_client_browser.current_window_handle
            count_to_try = 10 #1000
#.........这里部分代码省略.........
开发者ID:xhan-shannon,项目名称:WebAutotest,代码行数:103,代码来源:RegisterPlatform.py

示例5: test_register_vm_ip_normally

# 需要导入模块: from Common.Utils import PD_DebugLog [as 别名]
# 或者: from Common.Utils.PD_DebugLog import stepinfo [as 别名]
    def test_register_vm_ip_normally(self):
        u'''为指定的已经存在虚拟机登记IP地址'''
        #
        # The id starts from 1.
        vm_id = 4   
        vm_name = "AutoTest_VM%02d" % vm_id
        vm_name = "PD3_Cluster_VM123"
        host_name = "localhost"
        vm_name = "JAVA_VM62"
        
        # Step 1: Login and pass in with username, password, server and port
        pd_client_browser = self.pd_login()
        time.sleep(TestSpeedControl.TEST_STEP_INTERVAL)
        self.pd_client_browser = pd_client_browser
        
        # Step 2: Make sure the host resource tab is selected
        PD_DebugLog.stepinfo("click and select the host resource tab")
        
        pd_browser_main_map = Main_Browser_UIMap(pd_client_browser)
        self.pd_browser_main_map = pd_browser_main_map
        
        platform_resource_tab = pd_browser_main_map.get_platform_resource_tab()
        platform_resource_tab.click()
        time.sleep(TestSpeedControl.TEST_STEP_INTERVAL)
        
        # Step 3: Got the directory tree frame and check all the levels
        # travel around the leaves elements
        sub_tree = pd_browser_main_map.get_platform_sub_menu_tree()
        
        if type(sub_tree) is list:
            sub_menu_tree_elem = sub_tree[0]
        else:
            sub_menu_tree_elem = sub_tree
            
        platform_tree = Submenu_Tree(sub_menu_tree_elem)
        
        PD_DebugLog.debug_print("The tree id is: " + platform_tree.get_submenu_tree_id())
        
        tree_node = TreeNode(sub_menu_tree_elem)
        elemts = tree_node.get_all_child_nodes()
        
        if type(elemts) is list:
            fst_lvl_node_elm = elemts[0]
        else:
            fst_lvl_node_elm = elemts
        fst_lvl_node = TreeNode(fst_lvl_node_elm)
        PD_DebugLog.info_print("First level child node text is :" + fst_lvl_node.get_node_title() )      
        
        #platform_tree.travel_around_child_nodes()
        utils_misc.set_script_timeout(pd_client_browser, 0.2)
        pd_client_browser.implicitly_wait(6)
        elem = platform_tree.find_element_by_vmname(vm_name)
        if elem:
            elem_node = TreeNode(elem[0])
            PD_DebugLog.info_print("Find the elem, the title is " + elem_node.get_node_title())
            elem_node.click()
        time.sleep(TestSpeedControl.TEST_STEP_INTERVAL)
        
        utils_misc.restore_script_timeout(pd_client_browser)
        
        vm_summary_page = self.vm_summary_page = VM_Summary_UIMap(pd_client_browser)
        
        # Step 4: expand the more actions bar
        
        vm_summary_page.expand_more_actions_bar()
        
        # Step 5: click Register IP button link
        vm_summary_page.click_register_IP_link()
        
        # Step 6: input the ip... value in the register ip form
        register_vm_ip_form = Register_VM_IP_Frame_UIMap(self.driver)
        register_vm_ip_form.get_ip_addr_input().send_keys("172.30.126.62")
        register_vm_ip_form.get_netmask_input().send_keys("255.255.255.0")
        register_vm_ip_form.get_gateway_input().send_keys("172.30.126.254")
        register_vm_ip_form.get_dns_input().send_keys("202.106.0.20")
        register_vm_ip_form.get_seconddns_input().send_keys("202.106.196.115")
        register_vm_ip_form.get_submit_btn().click()
        
        register_vm_ip_form.return_main_page()
        time.sleep(TestSpeedControl.TEST_STEP_INTERVAL)
        
        result = utils_misc.wait_for(self.determine_ip_is_set, 20, 1, 1, "The ip is not set successfully.")
        
        if not result:
            self.fail("The ip is not set successfully.")
        else:
            PD_DebugLog.info_print("The ip is set done.")
        
        
#         if not utils_misc.is_valid_ip(target_vm_ipaddr):
#             self.fail("Get VM IP failed")
#             
#         # Step 6: Check the vm current status, it would turn into "in shutdown progress"
#         ping_output = utils_misc.ping(target_vm_ipaddr)
#         PD_DebugLog.debug_print("Print the ping output : " + ping_output)
#         
#         if utils_misc.get_loss_ratio(ping_output) > 0:
#             self.fail("Ping failed" + ping_output)

        time.sleep(TestSpeedControl.TEST_STEP_INTERVAL)
#.........这里部分代码省略.........
开发者ID:xhan-shannon,项目名称:WebAutotest,代码行数:103,代码来源:RegisterVMIP.py

示例6: test_register_image

# 需要导入模块: from Common.Utils import PD_DebugLog [as 别名]
# 或者: from Common.Utils.PD_DebugLog import stepinfo [as 别名]
    def test_register_image(self):
        u'''
                         在PDHelper中配置了‘镜像库’地址和共享目录
                         注册平台 后,注册模板镜像用于安装虚拟机
         '''
        register_image_config = utils_misc.readconfig(self.__class__.__name__)
            
        u'''???平台注册后,有什么标志可以用来检测判断已经成功注册'''
        # Step 1: 登陆PD Web界面(用户名密码在配置文件tests-shared.cfg)
        PD_DebugLog.stepinfo(Messages.LOGIN_POWERDIRECTOR) #"Login PowerDirector"
        pd_client_browser = self.driver
        pd_client_browser.implicitly_wait(30)
        pd_client_browser.maximize_window()
        
        # :输入用户名,密码 Login and pass in with username, password, server and port
        self.pd_login()
        time.sleep(TestSpeedControl.TEST_STEP_INTERVAL)
        
        # Step 2: 选择镜像库标签
        PD_DebugLog.stepinfo(Messages.IMAGE_LIB)
        PD_DebugLog.stepinfo(Messages.SELECT_CLICK_IMAGELIB_TAB)
        pd_browser_main_map = Main_Browser_UIMap(pd_client_browser)
        imagelib_tab = pd_browser_main_map.get_image_library_tab()
        imagelib_tab.click()
        
        # 确认当前页面已经切换到镜像库页面
        # 通过检查左侧树形标题/html/body/div[2]/div/div[2]/div[3]/ul/li/span
        expect_title = u"镜像"
        PD_DebugLog.info_print(u"期望在左侧树形面板标题获得“镜像”文本")
        got_title = pd_browser_main_map.get_sub_menu_tree_title(
                        Main_Browser_UIMap.IMAGE)
        
        PD_DebugLog.debug_print("expect_title: " + expect_title)
        PD_DebugLog.debug_print("got_title: " + got_title)
        assert expect_title == got_title
        time.sleep(TestSpeedControl.TEST_STEP_INTERVAL)
        
        # Step 3: 选择镜像库标签->"注册镜像"链接
        pd_imagelib_summary_map = ImageLib_Summary_UIMap(pd_client_browser)
        pd_imagelib_summary_map.click_register_image_link()
        time.sleep(TestSpeedControl.TEST_STEP_INTERVAL)
        
        # Step 4: 在注册镜像对话框中输入镜像对应的目录名
        # Step 4: input the image or iso file name under the nfs template 
        #         directory.
        iso_image_file_name = register_image_config.get("images", "rh64_template_img")
        
        if not iso_image_file_name:
            iso_image_file_name = "RedHat_6.4_image"
        
        pd_image_register_uimap = Register_Image_Frame_UIMap(pd_client_browser)
        image_alias_input_elem = pd_image_register_uimap.get_image_alias_input()
        image_alias_input_elem.send_keys(iso_image_file_name)
        
        time.sleep(TestSpeedControl.TEST_STEP_INTERVAL)
        image_location_input_elem = pd_image_register_uimap.get_image_file_location_input()
        image_location_input_elem.send_keys(iso_image_file_name)
        time.sleep(TestSpeedControl.TEST_STEP_INTERVAL)
        
        # Step 5: select file type as ISO or IMG
        # Step 5: 选择文件类型为ISO或IMG 
        file_type_img_radiobtn = pd_image_register_uimap.get_file_type_img_radiobtn()
        
        if not file_type_img_radiobtn:
            raise ElemNotExisted
        
        file_type_img_radiobtn.click()
        time.sleep(TestSpeedControl.TEST_STEP_INTERVAL)
            
        # Step 6: select the proper OS type
        # Step 6: 选择合适的操作系统类型    
        os_type = register_image_config.get("images", "os_type")
        pd_image_register_uimap.select_ostype_by_value(os_type)
        
        time.sleep(TestSpeedControl.TEST_STEP_INTERVAL)
        os_name = register_image_config.get("images", "os_name")
        try:
            pd_image_register_uimap.select_osname_by_value(os_name)
        except:
            register_isoimage_fail_file = "register_isoimage_fail_file.png"
            utils_misc.save_screenshot(self.driver, self.testcasedir, 
                                       register_isoimage_fail_file)
            
        time.sleep(TestSpeedControl.TEST_STEP_INTERVAL)
        
        # Step 7: click submit
        # Step 7: 点击提交按钮
        submit_btn = pd_image_register_uimap.get_submit_btn()
        submit_btn.click()
        #time.sleep(TestSpeedControl.TEST_STEP_INTERVAL)
        
        # Step 8: verify alert is present 
        # Step 8: 确认成功对话框弹出
        #time.sleep(3)  # 等待时间不能太短
            
        # wait to alert dialog pops up
        orig_window_handles = self.driver.window_handles
        
        time_out = 100
        curtime = 0
#.........这里部分代码省略.........
开发者ID:xhan-shannon,项目名称:WebAutotest,代码行数:103,代码来源:RegisterIMG.py

示例7: test_ping_vm_normally

# 需要导入模块: from Common.Utils import PD_DebugLog [as 别名]
# 或者: from Common.Utils.PD_DebugLog import stepinfo [as 别名]
    def test_ping_vm_normally(self):
        u'''Ping指定的已经存在虚拟机'''
        #
        # The id starts from 1.
        vm_id = 4   
        vm_name = "AutoTest_VM%02d" % vm_id
        vm_name = "PD3_Cluster_VM123"
        host_name = "localhost"
        vm_name = "JAVA_VM62"

        '''
        Find the virtual machine first,
        Then, decide if it is running.
        If yes, shutdown the virtual machine.
        The third is to delete it.
        And at the same to watch history or task bar to detect if the deletion is running or finished.  
        
        '''
        
        # Step 1: Login and pass in with username, password, server and port
        pd_client_browser = self.pd_login()
        time.sleep(TestSpeedControl.TEST_STEP_INTERVAL)
        self.pd_client_browser = pd_client_browser
        
        # Step 2: Make sure the host resource tab is selected
        PD_DebugLog.stepinfo("click and select the host resource tab")
        
        pd_browser_main_map = Main_Browser_UIMap(pd_client_browser)
        self.pd_browser_main_map = pd_browser_main_map
        
        platform_resource_tab = pd_browser_main_map.get_platform_resource_tab()
        platform_resource_tab.click()
        time.sleep(TestSpeedControl.TEST_STEP_INTERVAL)
        
        # Step 3: Got the directory tree frame and check all the levels
        # travel around the leaves elements
        sub_tree = pd_browser_main_map.get_platform_sub_menu_tree()
        
        if type(sub_tree) is list:
            sub_menu_tree_elem = sub_tree[0]
        else:
            sub_menu_tree_elem = sub_tree
            
        platform_tree = Submenu_Tree(sub_menu_tree_elem)
        
        PD_DebugLog.debug_print("The tree id is: " + platform_tree.get_submenu_tree_id())
        
        tree_node = TreeNode(sub_menu_tree_elem)
        elemts = tree_node.get_all_child_nodes()
        
        if type(elemts) is list:
            fst_lvl_node_elm = elemts[0]
        else:
            fst_lvl_node_elm = elemts
        fst_lvl_node = TreeNode(fst_lvl_node_elm)
        PD_DebugLog.info_print("First level child node text is :" + fst_lvl_node.get_node_title() )      
        
        #platform_tree.travel_around_child_nodes()
        utils_misc.set_script_timeout(pd_client_browser, 0.2)
        pd_client_browser.implicitly_wait(6)
        elem = platform_tree.find_element_by_vmname(vm_name)
        if elem:
            elem_node = TreeNode(elem[0])
            PD_DebugLog.info_print("Find the elem, the title is " + elem_node.get_node_title())
            elem_node.click()
        time.sleep(TestSpeedControl.TEST_STEP_INTERVAL)
        
        utils_misc.restore_script_timeout(pd_client_browser)
        
        vm_summary_page = VM_Summary_UIMap(pd_client_browser)
        
        # in the vm summary page, locate the ip address label
        # And get the ip address value.  
        target_vm_ipaddr = vm_summary_page.get_vm_ip()
        
        if not utils_misc.is_valid_ip(target_vm_ipaddr):
            self.fail("Get VM IP failed")
            
        # Step 4: Check the vm current status, it would turn into "in shutdown progress"
        ping_output = utils_misc.ping(target_vm_ipaddr)
        PD_DebugLog.debug_print("Print the ping output : " + ping_output)
        
        if utils_misc.get_loss_ratio(ping_output) > 0:
            self.fail("Ping failed" + ping_output)

        time.sleep(TestSpeedControl.TEST_STEP_INTERVAL)
        
开发者ID:xhan-shannon,项目名称:WebAutotest,代码行数:88,代码来源:PingVM.py


注:本文中的Common.Utils.PD_DebugLog.stepinfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。