def test_login_01(self, action): """ 测试获取登陆状态 :param action: :return: """ conf = Config.Config() data = ApprovesPage() test = Assert.Assertions() request = Request.Request(action) urls = data.url params = data.data host = conf.host_debug req_url = 'http://' + host headers = data.header api_url = req_url + urls[0]['approvers_list'] # print(api_url, urls, params) response = request.post_request(api_url, params[0], headers[0]) # print(response) with allure.step('校验结果'): allure.attach('校验返回code', '预期code:{0},实际code:{1}'.format(response['code'], 200)) assert test.assert_code(response['code'], 200) allure.attach('校验返回message', '预期msg:{0},实际msg:{1}'.format(response['body']['errorMessage'], '成功')) assert test.assert_text(response['body']['errorMessage'], '成功') Consts.RESULT_LIST.append('True')
def tokenGet(): handle_yaml = Yaml_Data.HandleYaml() yaml_dict = handle_yaml.file_load() def_name = sys._getframe().f_code.co_name test_assert = Assert.Assertions(def_name) logger.info("开始执行脚本%s:\n", def_name) opera_url = server_ip( 'uat1') + yaml_dict['test_config_token']['token_url'] # print(opera_url) """ 测试http://10.88.2.23:12342/app/access_token接口 """ opera_result = RequestsHandler().post_Req( url=opera_url, json=yaml_dict['test_config_token']['token_headers'], data=yaml_dict['test_config_token']['token_params']) sting_response = opera_result.content.decode() # 返回的请求结果 json_response = dict_style(sting_response) # 请求结果转换为json格式 value = (json_response['data']['accessToken']) # 获取请求结果中的token值 token = 'bearer ' + value handle_yaml.file_dump(name='headers', key='Authorization', value=token) # 写入组合后的token值 test_assert.assert_code(json_response['code'], yaml_dict['code']) # 断言请求的code值 test_assert.assert_body(json_response, 'message', yaml_dict['message']) # 断言请求的message值 Consts.RESULT_LIST.append('pass') # 接口执行结果为pass
def test_rl_add(): def_name = sys._getframe().f_code.co_name test_Assert = Assert.Assertions(def_name) logger.info("开始执行脚本%s:\n", def_name) # url = 'http://testcalapi.hellogeek.com/feedBack/add' url = server_ip('realse') + yamldict['test_rl_add']['url'] r = RequestsHandler().post_Req(url=url, json=yamldict['test_rl_add']['json'], headers=yamldict['test_rl_add']['headers']) sting_response = r.content.decode() # json_response = dict_style(sting_response) # assert json_response['code'] == 0 # try: # assert json_response['code'] == 0 # logger.info("code状态码返回正确:%s ----> PASS", json_response['code']) # except Exception: # logger.info("code状态码返回错误:%s ----> FAIL", json_response['code']) # # assert json_response['msg'] == '执行成功' # try: # assert json_response['msg'] == '执行成功' # logger.info("msg信息返回正确:%s ----> PASS", json_response['msg']) # except Exception: # logger.info("msg信息返回错误:%s ----> FAIL", json_response['msg']) json_response = dict_style(sting_response) # json_response = json.loads(sting_response) test_Assert.assert_code(json_response['code'], 0) test_Assert.assert_body(json_response, 'msg', '执行成功') Consts.RESULT_LIST.append('pass')
def test_basic_01(self, action): """ 用例描述:未登陆状态下查看基础设置 """ asert = Assert.Assertions() #发送请求 respon = LoadFiles.assembed_request() code = respon.__getattribute__('status_code') #测试断言 assert asert.assert_code(code, 200) Consts.RESULT_LIST.append('True')
def test_rl_common(): def_name = sys._getframe().f_code.co_name test_Assert = Assert.Assertions(def_name) logger.info("开始执行脚本%s:\n", def_name) url = server_ip('realse') + yamldict['test_rl_common']['url'] r = RequestsHandler().get_Req( url=url, params='', headers=yamldict['test_rl_common']['headers']) sting_response = r.content.decode() json_response = dict_style(sting_response) test_Assert.assert_code(json_response['code'], 0) test_Assert.assert_body(json_response, 'msg', '执行成功') Consts.RESULT_LIST.append('pass')
def test_operation_list(): def_name = sys._getframe().f_code.co_name test_Assert = Assert.Assertions(def_name) logger.info("开始执行脚本%s:\n", def_name) opera_url = server_ip('realse') + yamldict['test_operation_list']['url'] opera_result = RequestsHandler().get_Req( url=opera_url, params=yamldict['test_operation_list']["params"], headers=yamldict['test_operation_list']["headers"]) sting_response = opera_result.content.decode() json_response = dict_style(sting_response) test_Assert.assert_code(json_response['code'], 0) test_Assert.assert_body(json_response, 'msg', '执行成功') Consts.RESULT_LIST.append('pass')
def companyLoginOn(): def_name = sys._getframe().f_code.co_name test_Assert = Assert.Assertions(def_name) logger.info("开始执行脚本%s:\n", def_name) driver = webdriver.Chrome() driver.maximize_window() driver.get(url_forward) # 登陆页面 login(driver) # 首页 waitUntilDisplay(driver, loginOn.link_home_css.value) homeText = driver.find_element_by_css_selector(loginOn.link_home_css.value) test_Assert.assert_text_ui(homeText.text, '首页') logger.info("中小微企业金融服务聚合平台登录成功!") driver.quit()
def test_companyRegister(): if runMode == 'UI': def_name = sys._getframe().f_code.co_name test_Assert = Assert.Assertions(def_name) logger.info("开始执行脚本%s:\n", def_name) if jenkins: option = webdriver.ChromeOptions() option.add_argument('headless') # 浏览器不提供可视化页面 option.add_argument('no-sandbox') # 以最高权限运行 option.add_argument('--start-maximized') # 最大化运行(全屏窗口)设置元素定位比较准确 option.add_argument('--disable-gpu') # 谷歌文档提到需要加上这个属性来规避bug option.add_argument('--window-size=1920,1080') # 设置浏览器分辨率(窗口大小) driver = webdriver.Chrome(options=option) else: driver = webdriver.Chrome(executable_path=driverPath) driver.maximize_window() driver.get(url_ui_register) # db中清除已注册的账户 deleteInforMobile() logger.info("对已注册的账户进行删除操作") sleep(1) waitUntilClick(driver, loginOn.btn_agree_css.value) driver.find_element_by_css_selector( loginOn.btn_agree_css.value).click() waitUntilDisplay(driver, loginOn.input_act_css.value) driver.find_element_by_css_selector( loginOn.input_act_css.value).send_keys(act) driver.find_element_by_css_selector( loginOn.input_pwd_css.value).send_keys(pwd) driver.find_element_by_css_selector( loginOn.input_conPwd_css.value).send_keys(pwd) waitUntilClick(driver, loginOn.btn_phoneCode_css.value) sleep(2) flushDb() driver.find_element_by_css_selector( loginOn.btn_phoneCode_css.value).click() while 1: message = getPhoneMessage().get("regMes") if message is None: sleep(0.5) continue else: break driver.find_element_by_css_selector( loginOn.input_phoneCode_css.value).send_keys( message.strip().strip('"')) waitUntilClick(driver, loginOn.btn_agreeReg.value) driver.find_element_by_css_selector(loginOn.btn_agreeReg.value).click() title = driver.title test_Assert.assert_text_ui(title, '中小微企业金融服务聚合平台') logger.info("注册成功,返回到登陆页面") sleep(1) driver.quit() else: # touch(Template(r"C:\Users\shaojunshuai\PycharmProjects\AutoTest-python\Auto_Test\test_data\picture\id_5.png")) logger.info("小程序自动化测试开始") startWeinxin() deleteInforMobile() # 删除个人信息 # clearCache() picture_dir1 = os.getcwd() + '\\test_data\\picture\\id_9.png' touch(Template(picture_dir1)) waiteForClick(mobileDriver(text='允许')) waiteForClick(mobileDriver(text='授权手机号')) waiteForClick(mobileDriver(text='允许')) # companyPassForgetForward(act) logger.info("小程序个人实名认证页面") # 上传身份证正反面 waiteForClick(mobileDriver(text='请上传身份证头像面')) waiteForClick(mobileDriver(text='所有图片')) waiteForClick(mobileDriver(text='自动化测试专用相册')) mobileDriver("android.widget.LinearLayout").offspring( "com.tencent.mm:id/dm6").child("com.tencent.mm:id/f4b")[3].child( "com.tencent.mm:id/dm0").click() waiteForClick(mobileDriver(text='完成')) sleep(3) waiteForClick(mobileDriver(text='请上传身份证国徽面')) waiteForClick(mobileDriver(text='所有图片')) waiteForClick(mobileDriver(text='自动化测试专用相册')) mobileDriver("android.widget.LinearLayout").offspring( "com.tencent.mm:id/dm6").child("com.tencent.mm:id/f4b")[2].child( "com.tencent.mm:id/dm8").click() waiteForClick(mobileDriver(text='完成')) sleep(1) waiteForClick(mobileDriver(text='提交认证')) # 活体认证欺诈性校验 getVerification() # 等待直到元素消失 while True: if mobileDriver(text='身份证有效期至').exists(): break else: continue picture_dir = os.getcwd() + '\\test_data\\picture\\id_6.png' touch(Template(picture_dir))
def test_businessInforReg(): if runMode == 'UI': def_name = sys._getframe().f_code.co_name test_Assert = Assert.Assertions(def_name) logger.info("开始执行脚本%s:\n", def_name) if jenkins: option = webdriver.ChromeOptions() option.add_argument('headless') # 浏览器不提供可视化页面 option.add_argument('no-sandbox') # 以最高权限运行 option.add_argument('--start-maximized') # 最大化运行(全屏窗口)设置元素定位比较准确 option.add_argument('--disable-gpu') # 谷歌文档提到需要加上这个属性来规避bug option.add_argument('--window-size=1920,1080') # 设置浏览器分辨率(窗口大小) driver = webdriver.Chrome(options=option) else: driver = webdriver.Chrome(executable_path=driverPath) driver.maximize_window() driver.get(url_forward) # 登陆页面 login(driver) waitUntilDisplay(driver, path_businessInfoReg.txt_aut_css.value) txt_auTitle = driver.find_element_by_css_selector( path_businessInfoReg.txt_aut_css.value).text test_Assert.assert_text_ui(txt_auTitle, '企业基本资料') logger.info("企业基本资料画面正常显示") # 企业证件 el = driver.find_element_by_css_selector( path_businessInfoReg.input_companyName_css.value) el.send_keys('诚泰融资租赁(上海)有限公司') waitUntilDisplay_xpath(driver, path_businessInfoReg.display_name_xpath.value) el.send_keys(Keys.ENTER) sleep(1) driver.find_element_by_css_selector( path_businessInfoReg.input_legalIdCard_css.value).send_keys(idNum) driver.find_element_by_css_selector( path_businessInfoReg.input_legalPhone_css.value).send_keys( "17621198933") while True: try: driver.find_element_by_css_selector( path_businessInfoReg.sel_province_css.value).click() sleep(0.5) driver.find_element_by_xpath("//*[text() = '河北省']").click() break except: continue sleep(0.5) while True: try: driver.find_element_by_css_selector( path_businessInfoReg.sel_city_css.value).click() sleep(0.5) driver.find_element_by_xpath("//*[text() = '邯郸市']").click() break except: continue sleep(0.5) while True: try: driver.find_element_by_css_selector( path_businessInfoReg.sel_area_css.value).click() sleep(0.5) driver.find_element_by_xpath("//*[text() = '复兴区']").click() break except: continue sleep(1) driver.find_element_by_css_selector( path_businessInfoReg.input_contractAddress_css.value).send_keys( "金砖大厦10楼") driver.find_element_by_css_selector( path_businessInfoReg.input_legalPersonPostCode_css.value ).send_keys("200120") picture_dir = os.getcwd() + '\\test_data\\picture\\id_3.jpg' driver.find_element_by_css_selector( path_businessInfoReg.upload_legalPersonCertificate_css.value ).send_keys(picture_dir) # 生成随机银行号码 bankNO = random.randint(0, 99999999999999) driver.find_element_by_css_selector( path_businessInfoReg.upload_legalPersonBankNo_css.value).send_keys( str(bankNO)) sleep(0.5) while True: try: driver.find_element_by_css_selector( path_businessInfoReg.sel_bankName_css.value).click() sleep(0.5) driver.find_element_by_xpath( "/html/body/div[6]/div/div/div/div[2]/div[1]/div/div/div[3]" ).click() break except: continue sleep(0.5) while True: try: # 法定代表人信息 driver.find_element_by_css_selector( path_businessInfoReg.sel_country_css.value).click() sleep(1) driver.find_element_by_xpath( "/html/body/div[7]/div/div/div/div[2]/div[1]/div/div/div[2]" ).click() break except: continue sleep(0.5) picture_dir2 = os.getcwd() + '\\test_data\\picture\\id_1.jpg' picture_dir3 = os.getcwd() + '\\test_data\\picture\\id_2.jpg' picture_dir4 = os.getcwd() + '\\test_data\\picture\\id_4.jpg' driver.find_element_by_css_selector( path_businessInfoReg.sel_idCard1_css.value).send_keys(picture_dir2) driver.find_element_by_css_selector( path_businessInfoReg.sel_idCard2_css.value).send_keys(picture_dir3) # 实际控制人信息 sleep(1) driver.find_element_by_css_selector( path_businessInfoReg.radio_controlPerson_css.value).click() driver.find_element_by_css_selector( path_businessInfoReg.upload_controlPersonId1_css.value).send_keys( picture_dir2) driver.find_element_by_css_selector( path_businessInfoReg.upload_controlPersonId2_css.value).send_keys( picture_dir3) driver.find_element_by_css_selector( path_businessInfoReg.upload_controlPersonFamPic_css.value ).send_keys(picture_dir4) sleep(1) driver.find_element_by_css_selector( path_businessInfoReg.radio_legalPerson_css.value).click() waitUntilClick(driver, path_businessInfoReg.bth_submit_css.value) driver.find_element_by_css_selector( path_businessInfoReg.bth_submit_css.value).click() waitUntilDisplay(driver, path_businessInfoReg.text_atCof_css.value) txt_startAuTitle = driver.find_element_by_css_selector( path_businessInfoReg.text_atCof_css.value).text test_Assert.assert_text_ui(txt_startAuTitle, '请确认协议内容') logger.info("协议确认画面正常显示") waitUntilClick_xpath( driver, '//*[@id="root"]/div/div[2]/div/div[2]/div/div/div/div[1]/div/button' ) sleep(2) driver.find_element_by_xpath( path_businessInfoReg.checkBox_agree_xpath.value).click() waitUntilClick(driver, path_businessInfoReg.btn_Certification_css.value) driver.find_element_by_css_selector( path_businessInfoReg.btn_Certification_css.value).click() waitUntilDisplay(driver, path_businessInfoReg.text_atMid_css.value) txt_middleAuTitle = driver.find_element_by_css_selector( path_businessInfoReg.text_atMid_css.value).text test_Assert.assert_text_ui(txt_middleAuTitle, '认证中') logger.info("企业信息认证中画面正常显示") # 活体认证欺诈性校验 getVerification_ui(RequestURL, act) WebDriverWait(driver, 1200).until( EC.presence_of_element_located( (By.CSS_SELECTOR, path_businessInfoReg.text_bank_css.value))) driver.find_element_by_css_selector( path_businessInfoReg.input_moneyNum_css.value).send_keys('0.5') driver.find_element_by_css_selector( path_businessInfoReg.btn_middleCnf_css.value).click() sleep(3) waitUntilDisplay(driver, path_businessInfoReg.txt_examine_css.value) txt_examineAuTitle = driver.find_element_by_css_selector( path_businessInfoReg.txt_examine_css.value).text test_Assert.assert_text_ui(txt_examineAuTitle, '审核中') logger.info("企业信息审核中画面正常显示") driver.find_element_by_css_selector( path_businessInfoReg.btn_primary_css.value).click() # 登陆页面 waitUntilDisplay(driver, path_businessInfoReg.txt_aut_css.value) txt_auTitle = driver.find_element_by_css_selector( path_businessInfoReg.txt_aut_css.value).text test_Assert.assert_text_ui(txt_auTitle, '企业基本资料') logger.info("企业基本资料画面正常显示") driver.quit() else: logger.info('企业认证画面') waiteForClick(mobileDriver(text='我的')) waiteForClick(mobileDriver(text='企业认证')) sleep(1) waiteForClick(mobileDriver(text='*上传营业执照').parent().child()[2].child()) waiteForClick(mobileDriver(text='所有图片')) waiteForClick(mobileDriver(text='自动化测试专用相册')) mobileDriver("android.widget.LinearLayout").offspring( "com.tencent.mm:id/dm6").child("com.tencent.mm:id/f4b")[1].child( "com.tencent.mm:id/dm8").click() waiteForClick(mobileDriver(text='完成')) sleep(2) waiteForClick(mobileDriver(text='*邮政编码').parent().child()[2]) text("123456") mobileDriver(text='*邮政编码').click() mobileDriver(text='法人代表证件').drag_to(mobileDriver(text='企业证件照'), 0.5) waiteForClick( mobileDriver(text='*我是').parent().child()[2].child().child()) waiteForClick( mobileDriver(text='*法人代表归属地').parent().child()[2].child()) waiteForClick(mobileDriver(text='中国境内')) sleep(2) waiteForClick( mobileDriver(text='*实控人身份').parent().child()[2].child().child()) waiteForClick( mobileDriver(text='*实控人户口本主页').parent().child()[2].child()) waiteForClick(mobileDriver(text='所有图片')) waiteForClick(mobileDriver(text='自动化测试专用相册')) mobileDriver("android.widget.LinearLayout").offspring( "com.tencent.mm:id/dm6").child("com.tencent.mm:id/f4b")[0].child( "com.tencent.mm:id/dm8").click() waiteForClick(mobileDriver(text='完成')) sleep(2) waiteForClick( mobileDriver( text='*实控人婚姻状况').parent().child()[2].child().child()[1]) waiteForClick(mobileDriver(text='*对公银行账号').parent().child()[2]) bankNO = random.randint(0, 99999999999999) text(str(bankNO)) mobileDriver(text='*对公银行账号').click() waiteForClick( mobileDriver(text='*对公开户银行').parent().child()[2].child().child()) waiteForClick(mobileDriver(text='鞍山银行')) waiteForClick(mobileDriver(text='下一步')) logger.info('平台服务协议画面') waiteForClick(mobileDriver(text='我已阅读并同意')) waiteForClick(mobileDriver(text='请输入打款金额')) text('0.1') waiteForClick(mobileDriver(text='收到的金额')) waiteForClick(mobileDriver(text='确认提交')) sleep(3) waiteForClick(mobileDriver(name='com.tencent.mm:id/dc')) # 更改企业名称 updateNameCompany()
def test_backstage_examine(): def_name = sys._getframe().f_code.co_name test_Assert = Assert.Assertions(def_name) logger.info("开始执行脚本%s:\n", def_name) if jenkins: option = webdriver.ChromeOptions() option.add_argument('headless') # 浏览器不提供可视化页面 option.add_argument('no-sandbox') # 以最高权限运行 option.add_argument('--start-maximized') # 最大化运行(全屏窗口)设置元素定位比较准确 option.add_argument('--disable-gpu') # 谷歌文档提到需要加上这个属性来规避bug option.add_argument('--window-size=1920,1080') # 设置浏览器分辨率(窗口大小) driver = webdriver.Chrome(options=option) else: driver = webdriver.Chrome(executable_path=driverPath) driver.maximize_window() driver.get(url_back) act = yamldict['test_backStageUserList']['company_user'] pwd = yamldict['test_backStageUserList']['company_user_pass'] # 登陆页面 backStageLogin(driver, act, pwd, 0) updateNameCompany() sleep(2) driver.find_element_by_xpath( path_backstage_examine.btn_bussMan_xpath.value).click() sleep(1) driver.find_element_by_xpath( path_backstage_examine.btn_bussList_xpath.value).click() sleep(1) elList = driver.find_elements_by_xpath( path_backstage_examine.btn_bussListName_xpath.value) index = 0 for i in range(len(elList)): path = path_backstage_examine.btn_bussListName_xpath.value + '[' + str( i + 1) + ']/' + 'td' + '[' + str(1) + ']' text = driver.find_element_by_xpath(path).text if text == businessName: index = i break bussPath = path_backstage_examine.btn_bussListName_xpath.value + '[' + str( index + 1) + ']' + '/td[8]' + '/span/a' driver.find_elements_by_xpath(bussPath)[0].click() sleep(0.5) waitUntilDisplay(driver, path_backstage_examine.txt_userInfor_css.value) userInforTxt = driver.find_element_by_css_selector( path_backstage_examine.txt_userInfor_css.value).text test_Assert.assert_text_ui(userInforTxt, "用户基本信息") logger.info('成功进入企业信息审核画面') driver.find_element_by_css_selector( path_backstage_examine.input_examine_css.value).send_keys('企业审核通过') driver.find_element_by_css_selector( path_backstage_examine.btn_code_css.value).click() while 1: message = getPhoneMessage().get("Audit") if message is None: sleep(0.5) continue else: break driver.find_element_by_css_selector( path_backstage_examine.input_code_css.value).send_keys( message.strip().strip('"')) driver.find_element_by_css_selector( path_backstage_examine.btn_examinePass_css.value).click() sleep(1) logger.info("企业认证通过") driver.quit()
def test_infoReg(): if runMode == 'UI': def_name = sys._getframe().f_code.co_name test_Assert = Assert.Assertions(def_name) logger.info("开始执行脚本%s:\n", def_name) # 对个人信息企业信息进行删除操作 deletePerInforAndComInfor() logger.info("对个人信息企业信息进行删除操作") if jenkins: option = webdriver.ChromeOptions() option.add_argument('headless') # 浏览器不提供可视化页面 option.add_argument('no-sandbox') # 以最高权限运行 option.add_argument('--start-maximized') # 最大化运行(全屏窗口)设置元素定位比较准确 option.add_argument('--disable-gpu') # 谷歌文档提到需要加上这个属性来规避bug option.add_argument('--window-size=1920,1080') # 设置浏览器分辨率(窗口大小) driver = webdriver.Chrome(options=option) else: driver = webdriver.Chrome(executable_path=driverPath) driver.maximize_window() driver.get(url_forward) # 登陆页面 login(driver) waitUntilDisplay(driver, loginOn.link_home_css.value) sleep(1) homeText = driver.find_element_by_css_selector( loginOn.link_home_css.value) test_Assert.assert_text_ui(homeText.text, '首页') logger.info("进入登陆页面") name = yamldict['test_personalInfoRegList']['name'] idNum = yamldict['test_personalInfoRegList']['id_card'] BaseFunction.waitUntilClick(driver, path_personalInfoReg.btn_aut_css.value) picture_dir = os.getcwd() pcture_dirOne = '\\test_data\\picture\\id_1.jpg' pcture_dirTwo = '\\test_data\\picture\\id_2.jpg' driver.find_element_by_css_selector( path_personalInfoReg.file_idPicture1_css.value).send_keys( picture_dir + pcture_dirOne) BaseFunction.waitUntilDisplay( driver, path_personalInfoReg.btn_uplaodPicture1_css.value) driver.find_element_by_css_selector( path_personalInfoReg.file_idPicture2_css.value).send_keys( picture_dir + pcture_dirTwo) BaseFunction.waitUntilDisplay( driver, path_personalInfoReg.btn_uplaodPicture2_css.value) waitUntilClick(driver, path_personalInfoReg.btn_aut_css.value) sleep(3) driver.find_element_by_css_selector( path_personalInfoReg.btn_aut_css.value).click() getVerification_ui(RequestURL, act) BaseFunction.waitUntilDisplay( driver, path_personalInfoReg.txt_auting_css.value) text_auting = driver.find_element_by_css_selector( path_personalInfoReg.txt_auting_css.value).text test_Assert.assert_text_ui(text_auting, '认证中') logger.info("实名认证中画面显示") text_name_css = driver.find_element_by_css_selector( path_personalInfoReg.txt_name_css.value).text txt_idNum_css = driver.find_element_by_css_selector( path_personalInfoReg.txt_idNum_css.value).text text_phoneNum_css = driver.find_element_by_css_selector( path_personalInfoReg.txt_phoneNum_css.value).text test_Assert.assert_text_ui(text_name_css, name) test_Assert.assert_text_ui(txt_idNum_css, idNum) test_Assert.assert_text_ui(text_phoneNum_css, act) WebDriverWait(driver, 1200).until( EC.presence_of_element_located( (By.CSS_SELECTOR, path_personalInfoReg.txt_actSucess_css.value))) text_actSucess = driver.find_element_by_css_selector( path_personalInfoReg.txt_actSucess_css.value).text test_Assert.assert_text_ui(text_actSucess, "认证成功") logger.info("实名认证成功画面显示") driver.find_element_by_css_selector( path_personalInfoReg.btn_actInfor_css.value).click() titleText = driver.find_element_by_css_selector( path_personalInfoReg.txt_aut_css.value) test_Assert.assert_text_ui(titleText.text, '实名认证') logger.info("点击查看认证信息按钮,跳转到实名认证画面") driver.quit()