From 89f0b584e3dcbff9905deca1d2e4fdcdfe991dda Mon Sep 17 00:00:00 2001 From: xiao-hesheng Date: Mon, 11 Mar 2024 09:45:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=87=87=E8=B4=AD=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E6=A8=A1=E5=9D=97=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...41\347\263\212\346\237\245\350\257\242.py" | 2 +- ...02\345\270\270\346\237\245\350\257\242.py" | 104 ++++++++++++++++++ data/b3_herp3_purchase/data | 2 +- report/summary.html | 6 +- 4 files changed, 109 insertions(+), 5 deletions(-) create mode 100644 "air_case/b3_herp3_purchase/a_a8_\346\211\213\345\267\245\351\207\207\350\264\255\350\256\241\345\210\222_\346\267\273\345\212\240\344\272\247\345\223\201\351\241\265\351\235\242_\345\210\227\350\241\250\346\237\245\350\257\242_\346\235\241\344\273\266\346\237\245\350\257\242_\345\274\202\345\270\270\346\237\245\350\257\242.air/a_a8_\346\211\213\345\267\245\351\207\207\350\264\255\350\256\241\345\210\222_\346\267\273\345\212\240\344\272\247\345\223\201\351\241\265\351\235\242_\345\210\227\350\241\250\346\237\245\350\257\242_\346\235\241\344\273\266\346\237\245\350\257\242_\345\274\202\345\270\270\346\237\245\350\257\242.py" diff --git "a/air_case/b3_herp3_purchase/a_a7_\346\211\213\345\267\245\351\207\207\350\264\255\350\256\241\345\210\222_\346\267\273\345\212\240\344\272\247\345\223\201\351\241\265\351\235\242_\345\210\227\350\241\250\346\237\245\350\257\242_\346\235\241\344\273\266\346\237\245\350\257\242_\346\250\241\347\263\212\346\237\245\350\257\242.air/a_a7_\346\211\213\345\267\245\351\207\207\350\264\255\350\256\241\345\210\222_\346\267\273\345\212\240\344\272\247\345\223\201\351\241\265\351\235\242_\345\210\227\350\241\250\346\237\245\350\257\242_\346\235\241\344\273\266\346\237\245\350\257\242_\346\250\241\347\263\212\346\237\245\350\257\242.py" "b/air_case/b3_herp3_purchase/a_a7_\346\211\213\345\267\245\351\207\207\350\264\255\350\256\241\345\210\222_\346\267\273\345\212\240\344\272\247\345\223\201\351\241\265\351\235\242_\345\210\227\350\241\250\346\237\245\350\257\242_\346\235\241\344\273\266\346\237\245\350\257\242_\346\250\241\347\263\212\346\237\245\350\257\242.air/a_a7_\346\211\213\345\267\245\351\207\207\350\264\255\350\256\241\345\210\222_\346\267\273\345\212\240\344\272\247\345\223\201\351\241\265\351\235\242_\345\210\227\350\241\250\346\237\245\350\257\242_\346\235\241\344\273\266\346\237\245\350\257\242_\346\250\241\347\263\212\346\237\245\350\257\242.py" index 5cedb46f..b7892059 100644 --- "a/air_case/b3_herp3_purchase/a_a7_\346\211\213\345\267\245\351\207\207\350\264\255\350\256\241\345\210\222_\346\267\273\345\212\240\344\272\247\345\223\201\351\241\265\351\235\242_\345\210\227\350\241\250\346\237\245\350\257\242_\346\235\241\344\273\266\346\237\245\350\257\242_\346\250\241\347\263\212\346\237\245\350\257\242.air/a_a7_\346\211\213\345\267\245\351\207\207\350\264\255\350\256\241\345\210\222_\346\267\273\345\212\240\344\272\247\345\223\201\351\241\265\351\235\242_\345\210\227\350\241\250\346\237\245\350\257\242_\346\235\241\344\273\266\346\237\245\350\257\242_\346\250\241\347\263\212\346\237\245\350\257\242.py" +++ "b/air_case/b3_herp3_purchase/a_a7_\346\211\213\345\267\245\351\207\207\350\264\255\350\256\241\345\210\222_\346\267\273\345\212\240\344\272\247\345\223\201\351\241\265\351\235\242_\345\210\227\350\241\250\346\237\245\350\257\242_\346\235\241\344\273\266\346\237\245\350\257\242_\346\250\241\347\263\212\346\237\245\350\257\242.air/a_a7_\346\211\213\345\267\245\351\207\207\350\264\255\350\256\241\345\210\222_\346\267\273\345\212\240\344\272\247\345\223\201\351\241\265\351\235\242_\345\210\227\350\241\250\346\237\245\350\257\242_\346\235\241\344\273\266\346\237\245\350\257\242_\346\250\241\347\263\212\346\237\245\350\257\242.py" @@ -100,7 +100,7 @@ def test1(): print('list2', list2) for i in list2: # # 请求体 - request_body = commonFuc().get_business_data(module, "payload_9_1") + request_body = commonFuc().get_business_data(module, "payload_9_1",i) print('request_body', request_body) # 发送请求 result = commonFuc().http_post(url, request_body, headers) diff --git "a/air_case/b3_herp3_purchase/a_a8_\346\211\213\345\267\245\351\207\207\350\264\255\350\256\241\345\210\222_\346\267\273\345\212\240\344\272\247\345\223\201\351\241\265\351\235\242_\345\210\227\350\241\250\346\237\245\350\257\242_\346\235\241\344\273\266\346\237\245\350\257\242_\345\274\202\345\270\270\346\237\245\350\257\242.air/a_a8_\346\211\213\345\267\245\351\207\207\350\264\255\350\256\241\345\210\222_\346\267\273\345\212\240\344\272\247\345\223\201\351\241\265\351\235\242_\345\210\227\350\241\250\346\237\245\350\257\242_\346\235\241\344\273\266\346\237\245\350\257\242_\345\274\202\345\270\270\346\237\245\350\257\242.py" "b/air_case/b3_herp3_purchase/a_a8_\346\211\213\345\267\245\351\207\207\350\264\255\350\256\241\345\210\222_\346\267\273\345\212\240\344\272\247\345\223\201\351\241\265\351\235\242_\345\210\227\350\241\250\346\237\245\350\257\242_\346\235\241\344\273\266\346\237\245\350\257\242_\345\274\202\345\270\270\346\237\245\350\257\242.air/a_a8_\346\211\213\345\267\245\351\207\207\350\264\255\350\256\241\345\210\222_\346\267\273\345\212\240\344\272\247\345\223\201\351\241\265\351\235\242_\345\210\227\350\241\250\346\237\245\350\257\242_\346\235\241\344\273\266\346\237\245\350\257\242_\345\274\202\345\270\270\346\237\245\350\257\242.py" new file mode 100644 index 00000000..fb0dd1e8 --- /dev/null +++ "b/air_case/b3_herp3_purchase/a_a8_\346\211\213\345\267\245\351\207\207\350\264\255\350\256\241\345\210\222_\346\267\273\345\212\240\344\272\247\345\223\201\351\241\265\351\235\242_\345\210\227\350\241\250\346\237\245\350\257\242_\346\235\241\344\273\266\346\237\245\350\257\242_\345\274\202\345\270\270\346\237\245\350\257\242.air/a_a8_\346\211\213\345\267\245\351\207\207\350\264\255\350\256\241\345\210\222_\346\267\273\345\212\240\344\272\247\345\223\201\351\241\265\351\235\242_\345\210\227\350\241\250\346\237\245\350\257\242_\346\235\241\344\273\266\346\237\245\350\257\242_\345\274\202\345\270\270\346\237\245\350\257\242.py" @@ -0,0 +1,104 @@ +# -*- encoding=utf8 -*- +from common.timeUtils import timeUtils + +__author__ = "xiaohesheng" + +""" +case_tag:api,herp-web,a_a8_手工采购计划_添加产品页面_列表查询_条件查询_异常查询,id2297,id2297-8,sit,on +内网:a_a8_手工采购计划_添加产品页面_列表查询_条件查询_异常查询 +""" + +from common.common_func import commonFuc +from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system +from airtest.core.api import using +import sys + + +def test1(): + module = "b3_herp3_purchase" + """ + 场景:a_a7_手工采购计划_添加产品页面_列表查询_条件查询_模糊查询 + 用例名称:a_a7_手工采购计划_添加产品页面_列表查询_条件查询_模糊查询 + 输入:无 + 输出:"rtn_msg": {"code": 0, "msg": null, "data": true} + """ + # 内网登录 + username = commonFuc().get_business_data(module, "username") + # print('医院名称',username) + password = commonFuc().get_business_data(module, "password") + # print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + # 获取token和projectCode + token, projectCode, uxid, corpId, info = login_system(username, password).get_token() + # print( token,projectCode,uxid,corpId,info) + # + url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "mcmsBranchGoodsInfo_url") + print(url) + # 获取请求头信息 + headers = commonFuc().get_business_data(module, "json_headers2", + commonFuc().get_business_data(module, "json_contentType"), token, + commonFuc().get_business_data(module, "X-APP-CODE")) + print('headers', headers) + # # #获取日期 + # date1=timeUtils().get_time_hms(2) + # date2=timeUtils().get_time_add(-1) + # print(date1,date2) + # 按器械注册人模糊查询 + str = commonFuc().get_business_data(module, 'data3') + list2 = list(str.split(",")) + print('list2', list2) + for i in list2: + # # 请求体 + request_body = commonFuc().get_business_data(module, "payload_6_1", i) + print('request_body', request_body) + # 发送请求 + result = commonFuc().http_post(url, request_body, headers) + print('result', result) + # 断言 + code = commonFuc().analysis_json('code', result) + data = commonFuc().analysis_json('data', result) + total = commonFuc().analysis_json('total', data) + if code == 0 and total == 0: + commonFuc().check_text_exist(0, result) + else: + commonFuc().check_text_exist('error', result) + # 按产品名称/编号/简称模糊查询 + str = commonFuc().get_business_data(module, 'data3') + list2 = list(str.split(",")) + print('list2', list2) + for i in list2: + # # 请求体 + request_body = commonFuc().get_business_data(module, "payload_8_1", i) + print('request_body', request_body) + # 发送请求 + result = commonFuc().http_post(url, request_body, headers) + print('result', result) + # 断言 + code = commonFuc().analysis_json('code', result) + data = commonFuc().analysis_json('data', result) + total = commonFuc().analysis_json('total', data) + if code == 0 and total == 0: + commonFuc().check_text_exist(0, result) + else: + commonFuc().check_text_exist('error', result) + # 按进院供应商模糊查询 + str = commonFuc().get_business_data(module, 'data3') + list2 = list(str.split(",")) + print('list2', list2) + for i in list2: + # # 请求体 + request_body = commonFuc().get_business_data(module, "payload_9_2",i) + print('request_body', request_body) + # 发送请求 + result = commonFuc().http_post(url, request_body, headers) + print('result', i,result) + # 断言 + code = commonFuc().analysis_json('code', result) + data = commonFuc().analysis_json('data', result) + total = commonFuc().analysis_json('total', data) + if code == 0 and total == 0: + commonFuc().check_text_exist(0, result) + else: + commonFuc().check_text_exist('error', result) + + +test1() diff --git a/data/b3_herp3_purchase/data b/data/b3_herp3_purchase/data index 6a11913d..555b9abf 100644 --- a/data/b3_herp3_purchase/data +++ b/data/b3_herp3_purchase/data @@ -37,6 +37,6 @@ json_headers2: { "payload_6_1": {"queryObject":{"hosId":"h0347","branchId":"h0347-2011","goodsMfrsName":"%s","goodsName":"","purModes":["10"],"provName":"","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50} "payload_8_1": {"queryObject":{"hosId":"h0347","branchId":"h0347-2011","goodsMfrsName":"","goodsName":"%s","purModes":["10"],"provName":"","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50} "payload_9_1": {"queryObject":{"hosId":"h0347","branchId":"h0347-2011","goodsMfrsName":"","goodsName":"","purModes":["10"],"provName":"%s","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50} - +"payload_9_2": {"queryObject":{"hosId":"h0347","branchId":"h0347-2011","goodsMfrsName":"","goodsName":"","purModes":[],"provName":"%s","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50} checkDict2: {"code": 0,'msg': None,'data':1} diff --git a/report/summary.html b/report/summary.html index 2d554212..c80c3f40 100644 --- a/report/summary.html +++ b/report/summary.html @@ -56,7 +56,7 @@ 1 1 - 0分2秒 + 0分3秒 100.0% @@ -72,9 +72,9 @@ - a_a6_手工采购计划_添加产品页面_列表查询_条件查询_精确查询 + a_a7_手工采购计划_添加产品页面_列表查询_条件查询_模糊查询 成功 - 2.175 + 3.224 xiaohesheng -- GitLab