def test_003_api_78dk_platform_urge_member_addMemberUser(self): """ Time :2019-09-27 author : 闫红 desc :添加一个催收人员_v1.5.2,正常添加 """ # userUuid = loginAction.global_dict.get('userUuid') res = json.loads( WebAction.test_api_78dk_platform_urge_user_addMemberUser( useruuid=userUuid)) if flag: Assertion.verity(res['code'], '10000') Assertion.verity(res['msg'], '成功') else: Assertion.verity(res['code'], '20000') Assertion.verity(res['msg'], '该用户已经是催收人员,重复的提交!')
def test_api_manage_versionManage_VersionIssue(versionuuid): """ 版本发布 :param versionuuid: 版本uuid(Y),string :return: response.text """ start_time = time.time() MysqlClent.update(MysqlClent.get_conn(), 't_rap', 'is_exe = "Y"', 'id = 679') requesturl = baseUrl + "/api/manage/versionManage/VersionIssue" LOGGER.info("版本发布请求地址:【{}】".format(requesturl)) params = dict() params["versionUuid"] = versionuuid LOGGER.info("版本发布请求头参数:【{}】".format(API_TEST_HEADERS)) LOGGER.info("版本发布请求参数:【{}】".format(params)) response = rq.post(requesturl, data=json.dumps(params), headers=API_TEST_HEADERS, timeout=TIMEOUT) LOGGER.info("请求结果参数:【{}】".format(response.text)) Assertion.verity(response.status_code, 200, "状态码检查") LOGGER.info("请求接口耗时:【{}】".format(time.time() - start_time)) return response.text
def test_api_manage_dictionary_getChannels(platform): """ 获取对应平台的渠道 :param platform: 平台(1 iOS、2 Android),string :return: response.text """ start_time = time.time() MysqlClent.update(MysqlClent.get_conn(), 't_rap', 'is_exe = "Y"', 'id = 683') requesturl = baseUrl + "/api/manage/dictionary/getChannels" LOGGER.info("获取对应平台的渠道请求地址:【{}】".format(requesturl)) params = dict() params["platform"] = platform LOGGER.info("获取对应平台的渠道请求头参数:【{}】".format(API_TEST_HEADERS)) LOGGER.info("获取对应平台的渠道请求参数:【{}】".format(params)) response = rq.post(requesturl, data=json.dumps(params), headers=API_TEST_HEADERS, timeout=TIMEOUT) LOGGER.info("请求结果参数:【{}】".format(response.text)) Assertion.verity(response.status_code, 200, "状态码检查") LOGGER.info("请求接口耗时:【{}】".format(time.time() - start_time)) return response.text
def test_auditing_applicant_viewApplicantInfo(orderid): """ 审核详情_申请人信息_第五个模块 :param orderid: 订单id,number :return: response.text """ start_time = time.time() MysqlClent.update(MysqlClent.get_conn(), 't_rap', 'is_exe = "Y"', 'id = 2603') requesturl = baseUrl + "/auditing/applicant/viewApplicantInfo" LOGGER.info("审核详情_申请人信息_第五个模块请求地址:【{}】".format(requesturl)) params = dict() params["orderId"] = orderid LOGGER.info("审核详情_申请人信息_第五个模块请求头参数:【{}】".format(API_TEST_HEADERS)) LOGGER.info("审核详情_申请人信息_第五个模块请求参数:【{}】".format(params)) response = rq.post(requesturl, data=json.dumps(params), headers=API_TEST_HEADERS, timeout=TIMEOUT) LOGGER.info("请求结果参数:【{}】".format(response.text)) Assertion.verity(response.status_code, 200, "状态码检查") LOGGER.info("请求接口耗时:【{}】".format(time.time() - start_time)) return response.text
def test_021_api_78dk_app_process_savePersonInfo_liveregion_not_exits( self): """ 保存基本信息 :return: """ res = json.loads( AppAction.test_api_78dk_app_process_savePersonInfo( contactlist=contactlist, datumtypeeducationid=datum_type_education_id, datumtypehousingid=datum_type_housing_id, datumtypemarryid=datum_type_marry_id, livecity=live_city, livecityname=live_city_name, livedetail=live_detail, liveprovince=live_province, liveprovincename=live_province_name, liveregion=fake.ean8(), liveregionname=live_region_name, email='', iswork='', contractuuid=contract_uuid)) Assertion.verity(res['code'], 'S0003')
def test_22api_78dk_platform_tm_first_saveSupplementImage(self): # 电核时-----提交或编辑补录资料 -----只有审核员自己审核的订单才能进行编辑审核 sql = 'SELECT tc.* FROM Tbl_Contract tc LEFT JOIN Tbl_TelephoneCheckLog ttl ' \ 'ON tc.contract_uuid=ttl.contract_uuid WHERE ttl.contract_uuid IS NULL ' \ 'AND tc.telephone_check=\'telephone_check_pending\' ' \ 'AND tc.first_check=\'first_check_pass\' ORDER BY tc.id ASC;' contract_uuid_d = MysqlClent.executed_all(loginAction.DB, sql) # {'backGroundSupplementImages': '补录资料实体', 'supplementImageType': '后台编辑或提交类型', 'contractUuid': '合同UUID'} backGroundSupplementImages = [{ "imageName": "装修合同照片自动上传电核", "key": "YHZXHTZP", "url": "2db6/99882db693a9aabc1f7a54ce7a5e1b4a805a.png" }] res = PlatformAction.test_api_78dk_platform_tm_first_saveSupplementImage( backgroundsupplementimages=backGroundSupplementImages, contractuuid=contract_uuid, supplementimagetype='supplement_image_type_submit', auditchecktype='audit_check_telephone') Assertion.verity(json.loads(res)['msg'], '成功') Assertion.verity(json.loads(res)['code'], '10000')
def test_system_dictionary_query(type): """ xqh_审核拒绝理由-查询 :param type: 型 ( 风控还是 业务),string :return: response.text """ start_time = time.time() MysqlClent.update(MysqlClent.get_conn(), 't_rap', 'is_exe = "Y"', 'id = 2612') requesturl = baseUrl + "/system/dictionary/query" LOGGER.info("xqh_审核拒绝理由-查询请求地址:【{}】".format(requesturl)) params = dict() params["type"] = type LOGGER.info("xqh_审核拒绝理由-查询请求头参数:【{}】".format(API_TEST_HEADERS)) LOGGER.info("xqh_审核拒绝理由-查询请求参数:【{}】".format(params)) response = rq.post(requesturl, data=json.dumps(params), headers=API_TEST_HEADERS, timeout=TIMEOUT) LOGGER.info("请求结果参数:【{}】".format(response.text)) Assertion.verity(response.status_code, 200, "状态码检查") LOGGER.info("请求接口耗时:【{}】".format(time.time() - start_time)) return response.text
def test_custom_getWarnTrend(userid): """ 获取报警趋势自定义数据(编辑用) :param userid: 用户id,number :return: response.text """ start_time = time.time() MysqlClent.update(MysqlClent.get_conn(), 't_rap', 'is_exe = "Y"', 'id = 1545') requesturl = baseUrl + "/custom/getWarnTrend" LOGGER.info("获取报警趋势自定义数据(编辑用)请求地址:【{}】".format(requesturl)) params = dict() params["userId"] = userid LOGGER.info("获取报警趋势自定义数据(编辑用)请求头参数:【{}】".format(API_TEST_HEADERS)) LOGGER.info("获取报警趋势自定义数据(编辑用)请求参数:【{}】".format(params)) response = rq.post(requesturl, data=json.dumps(params), headers=API_TEST_HEADERS, timeout=TIMEOUT) LOGGER.info("请求结果参数:【{}】".format(response.text)) Assertion.verity(response.status_code, 200, "状态码检查") LOGGER.info("请求接口耗时:【{}】".format(time.time() - start_time)) return response.text
def test_api_78dk_app_auth_addContacts(contacts): """ 添加联系人 :param contacts: 联系人数组,array<object> :return: response.text """ start_time = time.time() MysqlClent.update(MysqlClent.get_conn(), 't_rap', 'is_exe = "Y"', 'id = 1411') requesturl = baseUrl + "/api/78dk/app/auth/addContacts" LOGGER.info("添加联系人请求地址:【{}】".format(requesturl)) params = dict() params["contacts"] = contacts LOGGER.info("添加联系人请求头参数:【{}】".format(API_TEST_HEADERS)) LOGGER.info("添加联系人请求参数:【{}】".format(params)) response = rq.post(requesturl, data=json.dumps(params), headers=API_TEST_HEADERS, timeout=TIMEOUT) LOGGER.info("请求结果参数:【{}】".format(response.text)) Assertion.verity(response.status_code, 200, "状态码检查") LOGGER.info("请求接口耗时:【{}】".format(time.time() - start_time)) return response.text
def test_dataHandle_updateMonitorNow(id): """ 立即更新数据 :param id: 自定义数据id,string :return: response.text """ start_time = time.time() MysqlClent.update(MysqlClent.get_conn(), 't_rap', 'is_exe = "Y"', 'id = 1516') requesturl = baseUrl + "/dataHandle/updateMonitorNow" LOGGER.info("立即更新数据请求地址:【{}】".format(requesturl)) params = dict() params["id"] = id LOGGER.info("立即更新数据请求头参数:【{}】".format(API_TEST_HEADERS)) LOGGER.info("立即更新数据请求参数:【{}】".format(params)) response = rq.post(requesturl, data=json.dumps(params), headers=API_TEST_HEADERS, timeout=TIMEOUT) LOGGER.info("请求结果参数:【{}】".format(response.text)) Assertion.verity(response.status_code, 200, "状态码检查") LOGGER.info("请求接口耗时:【{}】".format(time.time() - start_time)) return response.text
def test_custom_deleteWarnDistribution(id): """ 删除报警分布自定义数据 :param id: 自定义数据Id,number :return: response.text """ start_time = time.time() MysqlClent.update(MysqlClent.get_conn(), 't_rap', 'is_exe = "Y"', 'id = 1531') requesturl = baseUrl + "/custom/deleteWarnDistribution" LOGGER.info("删除报警分布自定义数据请求地址:【{}】".format(requesturl)) params = dict() params["id"] = id LOGGER.info("删除报警分布自定义数据请求头参数:【{}】".format(API_TEST_HEADERS)) LOGGER.info("删除报警分布自定义数据请求参数:【{}】".format(params)) response = rq.post(requesturl, data=json.dumps(params), headers=API_TEST_HEADERS, timeout=TIMEOUT) LOGGER.info("请求结果参数:【{}】".format(response.text)) Assertion.verity(response.status_code, 200, "状态码检查") LOGGER.info("请求接口耗时:【{}】".format(time.time() - start_time)) return response.text
def test_051_api_78dk_platform_mm_base_store_updateStore(self): # 修改门店 global store_uuid sql = 'manager_name="' + store_name + '" and state ="enabled"' store_uuid = xqkj_query.get_info('Tbl_Store', 'store_uuid', sql)[0] global_dict.set( store_uuid=xqkj_query.get_info('Tbl_Store', 'store_uuid', sql)[0]) res = PlatformAction.test_api_78dk_platform_mm_base_store_updateStore( businessaddress='经营地址', businessaddressgpsloction='GPS地址', managername=store_name, managerphone='18911390729', merchantuuid=merchant_uuid, storeuuid=store_uuid, province=510000, city=510100, region=510104, provincename='', cityname='', regionname='', storename='storeNamebbbbbbbbb') Assertion.verity(json.loads(res)['code'], '10000') Assertion.verity(json.loads(res)['msg'], '成功')
def test_016_api_78dk_app_process_repayPlanCalculator_true(self): """ 还款计划试算 :return: """ global productDetailUuid, store_uuid productDetailUuid = loginAction.global_dict.get('productDetailUuid') store_uuid = loginAction.global_dict.get('store_uuid') res = json.loads( AppAction.test_api_78dk_app_process_repayPlanCalculator( isdiscount='true', loanamount=10000, productdetailconfiguuid=productDetailConfigUuid, productdetailuuid=productDetailUuid, storeuuid=store_uuid)) Assertion.verity(res['code'], '10000') Assertion.verityContain(res['data'], 'handlingFee') Assertion.verityContain(res['data'], 'lastPayDate') Assertion.verityContain(res['data'], 'number') Assertion.verityContain(res['data'], 'principal') Assertion.verityContain(res['data'], 'totalHandlingFee') Assertion.verityContain(res['data'], 'totalMoney') Assertion.verityContain(res['data'], 'totalPrincipal')
def test_api_taobao_verifycode(code, reqid, token): """ 3、校验短信验证码 :param reqid: 会话id(必填),string :param code: 验证码(必填),string :param token: 分配的token参数(必填),string :return: response.text """ start_time = time.time() MysqlClent.update(MysqlClent.get_conn(), 't_rap', 'is_exe = "Y"', 'id = 1027') requesturl = baseUrl + "/api/taobao/verifycode" LOGGER.info("3、校验短信验证码请求地址:【{}】".format(requesturl)) params = dict() params["code"] = code params["reqId"] = reqid params["token"] = token LOGGER.info("3、校验短信验证码请求头参数:【{}】".format(API_TEST_HEADERS)) LOGGER.info("3、校验短信验证码请求参数:【{}】".format(params)) response = rq.get(requesturl, data=json.dumps(params), headers=API_TEST_HEADERS, timeout=TIMEOUT) LOGGER.info("请求结果参数:【{}】".format(response.json())) Assertion.verity(response.status_code, 200, "状态码检查") LOGGER.info("请求接口耗时:【{}】".format(time.time() - start_time)) return response.text
def test_api_78dk_app_h5_clickAdd(linkuuid): """ 页面点击统计 :param linkuuid: 链接uuid(Y),string :return: response.text """ start_time = time.time() MysqlClent.update(MysqlClent.get_conn(), 't_rap', 'is_exe = "Y"', 'id = 1685') requesturl = baseUrl + "/api/78dk/app/h5/clickAdd" LOGGER.info("页面点击统计请求地址:【{}】".format(requesturl)) params = dict() params["linkUuid"] = linkuuid LOGGER.info("页面点击统计请求头参数:【{}】".format(API_TEST_HEADERS)) LOGGER.info("页面点击统计请求参数:【{}】".format(params)) response = rq.post(requesturl, data=json.dumps(params), headers=API_TEST_HEADERS, timeout=TIMEOUT) LOGGER.info("请求结果参数:【{}】".format(response.text)) Assertion.verity(response.status_code, 200, "状态码检查") LOGGER.info("请求接口耗时:【{}】".format(time.time() - start_time)) return response.text
def test_api_78dk_app_base_portrait(headpic): """ 头像保存 :param headpic: 七牛返回的key值,string :return: response.text """ start_time = time.time() MysqlClent.update(MysqlClent.get_conn(), 't_rap', 'is_exe = "Y"', 'id = 1415') requesturl = baseUrl + "/api/78dk/app/base/portrait" LOGGER.info("头像保存请求地址:【{}】".format(requesturl)) params = dict() params["headPic"] = headpic LOGGER.info("头像保存请求头参数:【{}】".format(API_TEST_HEADERS)) LOGGER.info("头像保存请求参数:【{}】".format(params)) response = rq.post(requesturl, data=json.dumps(params), headers=API_TEST_HEADERS, timeout=TIMEOUT) LOGGER.info("请求结果参数:【{}】".format(response.text)) Assertion.verity(response.status_code, 200, "状态码检查") LOGGER.info("请求接口耗时:【{}】".format(time.time() - start_time)) return response.text
def test_16api_78dk_platform_tm_first_saveSupplementImage(self): # 初审时-----提交或编辑补录资料 -----只有审核员自己审核的订单才能进行编辑审核 sql = '' contract_uuid_d = MysqlClent.executed_all(loginAction.DB, sql) backGroundSupplementImages = [{ "imageName": "装修合同照片自动上传初审", "key": "YHZXHTZP", "url": "2db6/99882db693a9aabc1f7a54ce7a5e1b4a805a.png" }] res = PlatformAction.test_api_78dk_platform_tm_first_saveSupplementImage( supplementimagetype='supplement_image_type_submit', auditchecktype='audit_check_first', backgroundsupplementimages=backGroundSupplementImages, contractuuid=contract_uuid) Assertion.verity(json.loads(res)['msg'], '成功') Assertion.verity(json.loads(res)['code'], '10000') Assertion.verity(json.loads(res)['data']['newImageName'], '新图片名称') Assertion.verity(json.loads(res)['data']['newImageUuid'], '新补录的图片UUID') Assertion.verity( json.loads(res)['data']['originalImageUuid'], '需要补录的图片UUID')
def test_api_78dk_app_login_mobleFlag(mobile): """ 登录判断手机号 :param mobile: 手机号, :return: response.text """ start_time = time.time() MysqlClent.update(MysqlClent.get_conn(), 't_rap', 'is_exe = "Y"', 'id = 1421') requesturl = baseUrl + "/api/78dk/app/login/mobleFlag" LOGGER.info("登录判断手机号请求地址:【{}】".format(requesturl)) params = dict() params["mobile"] = mobile LOGGER.info("登录判断手机号请求头参数:【{}】".format(API_TEST_HEADERS)) LOGGER.info("登录判断手机号请求参数:【{}】".format(params)) response = rq.post(requesturl, data=json.dumps(params), headers=API_TEST_HEADERS, timeout=TIMEOUT) LOGGER.info("请求结果参数:【{}】".format(response.text)) Assertion.verity(response.status_code, 200, "状态码检查") LOGGER.info("请求接口耗时:【{}】".format(time.time() - start_time)) return response.text
def test_auditing_mauditaccept_searchScore(orderid): """ 评分详情 :param orderid: 订单id(Y),number :return: response.text """ start_time = time.time() MysqlClent.update(MysqlClent.get_conn(), 't_rap', 'is_exe = "Y"', 'id = 2606') requesturl = baseUrl + "/auditing/mauditaccept/searchScore" LOGGER.info("评分详情请求地址:【{}】".format(requesturl)) params = dict() params["orderId"] = orderid LOGGER.info("评分详情请求头参数:【{}】".format(API_TEST_HEADERS)) LOGGER.info("评分详情请求参数:【{}】".format(params)) response = rq.post(requesturl, data=json.dumps(params), headers=API_TEST_HEADERS, timeout=TIMEOUT) LOGGER.info("请求结果参数:【{}】".format(response.text)) Assertion.verity(response.status_code, 200, "状态码检查") LOGGER.info("请求接口耗时:【{}】".format(time.time() - start_time)) return response.text
def test_api_78dk_app_auth_executeAuth(executetype): """ 执行运营商或电商认证 :param executetype: 电商认证0,运营商认证1,string :return: response.text """ start_time = time.time() MysqlClent.update(MysqlClent.get_conn(), 't_rap', 'is_exe = "Y"', 'id = 1429') requesturl = baseUrl + "/api/78dk/app/auth/executeAuth" LOGGER.info("执行运营商或电商认证请求地址:【{}】".format(requesturl)) params = dict() params["executeType"] = executetype LOGGER.info("执行运营商或电商认证请求头参数:【{}】".format(API_TEST_HEADERS)) LOGGER.info("执行运营商或电商认证请求参数:【{}】".format(params)) response = rq.post(requesturl, data=json.dumps(params), headers=API_TEST_HEADERS, timeout=TIMEOUT) LOGGER.info("请求结果参数:【{}】".format(response.text)) Assertion.verity(response.status_code, 200, "状态码检查") LOGGER.info("请求接口耗时:【{}】".format(time.time() - start_time)) return response.text
def test_auditing_goodsInfo_viewPartnerInfo(orderid): """ xqh_详情(商户信息) :param orderid: 订单号, :return: response.text """ start_time = time.time() MysqlClent.update(MysqlClent.get_conn(), 't_rap', 'is_exe = "Y"', 'id = 2613') requesturl = baseUrl + "/auditing/goodsInfo/viewPartnerInfo" LOGGER.info("xqh_详情(商户信息)请求地址:【{}】".format(requesturl)) params = dict() params["orderId"] = orderid LOGGER.info("xqh_详情(商户信息)请求头参数:【{}】".format(API_TEST_HEADERS)) LOGGER.info("xqh_详情(商户信息)请求参数:【{}】".format(params)) response = rq.get(requesturl, data=json.dumps(params), headers=API_TEST_HEADERS, timeout=TIMEOUT) LOGGER.info("请求结果参数:【{}】".format(response.text)) Assertion.verity(response.status_code, 200, "状态码检查") LOGGER.info("请求接口耗时:【{}】".format(time.time() - start_time)) return response.text
def test_api_78dk_app_common_uploadAddressBook(addressbookjson): """ 上传通讯录 :param addressbookjson: 通讯录json数据,string :return: response.text """ start_time = time.time() MysqlClent.update(MysqlClent.get_conn(), 't_rap', 'is_exe = "Y"', 'id = 1430') requesturl = baseUrl + "/api/78dk/app/common/uploadAddressBook" LOGGER.info("上传通讯录请求地址:【{}】".format(requesturl)) params = dict() params["addressBookJson"] = addressbookjson LOGGER.info("上传通讯录请求头参数:【{}】".format(API_TEST_HEADERS)) LOGGER.info("上传通讯录请求参数:【{}】".format(params)) response = rq.post(requesturl, data=json.dumps(params), headers=API_TEST_HEADERS, timeout=TIMEOUT) LOGGER.info("请求结果参数:【{}】".format(response.text)) Assertion.verity(response.status_code, 200, "状态码检查") LOGGER.info("请求接口耗时:【{}】".format(time.time() - start_time)) return response.text
def test_003_role_addRole_del_role(self): """ Time :2019-06-18 author : 罗林 desc :新增角色数据 """ global org_code org_code = loginAction.global_dict.get('org_code_one') rs1 = FinanceAction.test_role_addRole(orgcode=org_code, count='', remark=fake.text(20), id='', name=del_role_name) Assertion.verity(json.loads(rs1)['code'], 'F2000') Assertion.verity(json.loads(rs1)['message'], '请求成功') Assertion.verity(json.loads(rs1)['data']['orgCode'], org_code) Assertion.verity(json.loads(rs1)['data']['name'], del_role_name) global del_role_id del_role_id = json.loads(rs1)['data']['id']
def test_api_78dk_app_common_queryDicItemList(dicttypecode): """ 根据字典类型Code返回字典条目列表 :param dicttypecode: 字典类型编号(Y),string :return: response.text """ start_time = time.time() MysqlClent.update(MysqlClent.get_conn(), 't_rap', 'is_exe = "Y"', 'id = 1432') requesturl = baseUrl + "/api/78dk/app/common/queryDicItemList" LOGGER.info("根据字典类型Code返回字典条目列表请求地址:【{}】".format(requesturl)) params = dict() params["dictTypeCode"] = dicttypecode LOGGER.info("根据字典类型Code返回字典条目列表请求头参数:【{}】".format(API_TEST_HEADERS)) LOGGER.info("根据字典类型Code返回字典条目列表请求参数:【{}】".format(params)) response = rq.post(requesturl, data=json.dumps(params), headers=API_TEST_HEADERS, timeout=TIMEOUT) LOGGER.info("请求结果参数:【{}】".format(response.text)) Assertion.verity(response.status_code, 200, "状态码检查") LOGGER.info("请求接口耗时:【{}】".format(time.time() - start_time)) return response.text
def test_001_api_78dk_platform_urge_addMessage(self): """ Time :2019-09-29 author : 闫红 desc :电话催收信息提交-v1.5.2,忘记还款 """ global app_user_uuid, contract_uuid contract_uuid = loginAction.global_dict.get('contract_uuid') app_user_uuid = loginAction.get_user_uuid() xqkj_query.get_bill_overdue(contract_uuid=contract_uuid, user_uuid=app_user_uuid) # app_user_uuid = "bb9a44e01ce44b56a0f1aa3d7c7d478f" res = json.loads( WebAction.test_api_78dk_platform_urge_addMessage( communicatee='testAPI', condition='testAPI', remark='testAPI', useruuid=app_user_uuid, overduereason="forget_repay", datalist=[], replyrepaytime='')) Assertion.verity(res['code'], '10000') Assertion.verity(res['msg'], '成功')
def test_api_78dk_app_common_queryQiNiuToken(type): """ 获取七牛token :param type: string,string :return: response.text """ start_time = time.time() MysqlClent.update(MysqlClent.get_conn(), 't_rap', 'is_exe = "Y"', 'id = 1433') requesturl = baseUrl + "/api/78dk/app/common/queryQiNiuToken" LOGGER.info("获取七牛token请求地址:【{}】".format(requesturl)) params = dict() params["type"] = type LOGGER.info("获取七牛token请求头参数:【{}】".format(API_TEST_HEADERS)) LOGGER.info("获取七牛token请求参数:【{}】".format(params)) response = rq.post(requesturl, data=json.dumps(params), headers=API_TEST_HEADERS, timeout=TIMEOUT) LOGGER.info("请求结果参数:【{}】".format(response.text)) Assertion.verity(response.status_code, 200, "状态码检查") LOGGER.info("请求接口耗时:【{}】".format(time.time() - start_time)) return response.text
def test_api_manage_user_logout(mytoken): """ 登出 :param mytoken: 登陆返回的用户token,存在hearder里面,string :return: response.text """ start_time = time.time() MysqlClent.update(MysqlClent.get_conn(), 't_rap', 'is_exe = "Y"', 'id = 681') requesturl = baseUrl + "/api/manage/user/logout" LOGGER.info("登出请求地址:【{}】".format(requesturl)) params = dict() params["MyToken"] = mytoken LOGGER.info("登出请求头参数:【{}】".format(API_TEST_HEADERS)) LOGGER.info("登出请求参数:【{}】".format(params)) response = rq.post(requesturl, data=json.dumps(params), headers=API_TEST_HEADERS, timeout=TIMEOUT) LOGGER.info("请求结果参数:【{}】".format(response.text)) Assertion.verity(response.status_code, 200, "状态码检查") LOGGER.info("请求接口耗时:【{}】".format(time.time() - start_time)) return response.text
def test_api_78dk_app_auth_isDebitCard(cardno): """ 验证是否为借记卡 :param cardno: 银行卡号(Y),string :return: response.text """ start_time = time.time() MysqlClent.update(MysqlClent.get_conn(), 't_rap', 'is_exe = "Y"', 'id = 1529') requesturl = baseUrl + "/api/78dk/app/auth/isDebitCard" LOGGER.info("验证是否为借记卡请求地址:【{}】".format(requesturl)) params = dict() params["cardNo"] = cardno LOGGER.info("验证是否为借记卡请求头参数:【{}】".format(API_TEST_HEADERS)) LOGGER.info("验证是否为借记卡请求参数:【{}】".format(params)) response = rq.post(requesturl, data=json.dumps(params), headers=API_TEST_HEADERS, timeout=TIMEOUT) LOGGER.info("请求结果参数:【{}】".format(response.text)) Assertion.verity(response.status_code, 200, "状态码检查") LOGGER.info("请求接口耗时:【{}】".format(time.time() - start_time)) return response.text
def test_cuser_update(companyid, id, useremail, username, userphone): """ 编辑管理员 :return: response.text """ start_time = time.time() MysqlClent.update(MysqlClent.get_conn(), 't_rap', 'is_exe = "Y"', 'id = 13') requesturl = baseUrl + "/cuser/update" LOGGER.info("编辑管理员请求地址:【{}】".format(requesturl)) params = dict() params["companyId"] = companyid params["id"] = id params["userEmail"] = useremail params["userName"] = username params["userPhone"] = userphone params["licence"] = LICENCES LOGGER.info("编辑管理员请求头参数:【{}】".format(API_TEST_HEADERS)) LOGGER.info("编辑管理员请求参数:【{}】".format(params)) response = rq.post(requesturl, params=params, headers=API_TEST_HEADERS, timeout=TIMEOUT) LOGGER.info("请求结果参数:【{}】".format(response.text)) Assertion.verity(response.status_code, 200, "状态码检查") LOGGER.info("请求接口耗时:【{}】".format(time.time() - start_time)) return response.text
def test_001_api_78dk_platform_urge_collectionPersonnelList_null(self): """ Time :2019-09-27 author : 闫红 desc :催收人员管理列表-搜索-v1.5.2,搜索分案状态为空的所有人员 """ res = json.loads(WebAction.test_api_78dk_platform_urge_user_collectionPersonnelList( divisionstate='', email='', mobile='', name='', pagesize=100, pagecurrent=1)) Assertion.verity(res['code'], '10000') Assertion.verity(res['msg'], '成功') global mobile, name, platformUserProfileUuid, flag, userEmail userEmail = loginAction.super_email flag = True try: datalist = res['data']['dataList'] except: datalist = [] for data in datalist: if data['email'] == userEmail: mobile = data['mobile'] name = data['name'] platformUserProfileUuid = data['platformUserProfileUuid'] flag = False