Example #1
0
    def test_VOP_DL(self):  #用例注意test开头
        """
        登陆系统并切换到VOP
        :return:
        """
        homepage = HomePage(self.driver)
        list = BrowserEngine.readjson(self)
        user = list['username']
        pwd = list['passwd']
        homepage.input_username(user)
        homepage.input_password(pwd)

        homepage.click_login()
        time.sleep(2)
        homepage.get_windows_img()
        logger.info('loginpage已截图')

        try:
            elem = self.driver.find_element_by_id('timeInfo')
            #assert '' in homepage.get_page_title()  # 调用页面对象继承基类中的获取页面标题方法
            assert (user) in self.driver.page_source
            #self.assertEqual(str(elem.text), '李嘉华')
            print('Test Pass.')
        except Exception as e:
            print('Test Fail.', format(e))
            homepage.get_windows_img()
            raise AssertionError
Example #2
0
 def VOP_DL(self):
     """
     系统登录页面切换到VOP
     :return:
     """
     homepage = HomePage(self.driver)
     list = BrowserEngine.readjson(self)
     user = list['username']
     pwd = list['passwd']
     homepage.input_username(user)
     homepage.input_password(pwd)
     homepage.click_login()
     time.sleep(2)
     homepage.get_windows_img()
     logger.info('前置处理-登录')