From 71b005978868602966fa7a0236f9cad270ca5713 Mon Sep 17 00:00:00 2001 From: xiao-hesheng Date: Fri, 22 Dec 2023 09:13:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=85=8D=E9=80=81=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...44\272\244_2_0\345\214\273\351\231\242.py" | 15 ++++- ...2_\345\267\262\345\256\214\346\210\220.py" | 62 +++++++++++++++++++ common/common_func.py | 4 ++ data/a6_mdm3_dp/data | 2 + report/summary.html | 6 +- 5 files changed, 83 insertions(+), 6 deletions(-) create mode 100644 "air_case/a6_mdm3_dp/a7_4\344\273\243\351\205\215\351\200\201\344\270\213\345\215\225\345\210\227\350\241\250\346\225\260\346\215\256\346\237\245\350\257\242_\345\267\262\345\256\214\346\210\220.air/a7_4\344\273\243\351\205\215\351\200\201\344\270\213\345\215\225\345\210\227\350\241\250\346\225\260\346\215\256\346\237\245\350\257\242_\345\267\262\345\256\214\346\210\220.py" diff --git "a/air_case/a6_mdm3_dp/a7_3\350\256\242\345\215\225\351\205\215\351\200\201\346\217\220\344\272\244_2_0\345\214\273\351\231\242.air/a7_3\350\256\242\345\215\225\351\205\215\351\200\201\346\217\220\344\272\244_2_0\345\214\273\351\231\242.py" "b/air_case/a6_mdm3_dp/a7_3\350\256\242\345\215\225\351\205\215\351\200\201\346\217\220\344\272\244_2_0\345\214\273\351\231\242.air/a7_3\350\256\242\345\215\225\351\205\215\351\200\201\346\217\220\344\272\244_2_0\345\214\273\351\231\242.py" index 4d6adedd..51d03aa9 100644 --- "a/air_case/a6_mdm3_dp/a7_3\350\256\242\345\215\225\351\205\215\351\200\201\346\217\220\344\272\244_2_0\345\214\273\351\231\242.air/a7_3\350\256\242\345\215\225\351\205\215\351\200\201\346\217\220\344\272\244_2_0\345\214\273\351\231\242.py" +++ "b/air_case/a6_mdm3_dp/a7_3\350\256\242\345\215\225\351\205\215\351\200\201\346\217\220\344\272\244_2_0\345\214\273\351\231\242.air/a7_3\350\256\242\345\215\225\351\205\215\351\200\201\346\217\220\344\272\244_2_0\345\214\273\351\231\242.py" @@ -36,8 +36,9 @@ def select1(): headers = commonFuc().get_business_data(module, "json_headers2", commonFuc().get_business_data(module, "json_contentType"), token, projectCode) - number=commonFuc().randomString(5) - request_body = commonFuc().get_business_data(module, "payload9_3",id1,id1,number,id2,id2) + sourceVersion=0 + # request_body = commonFuc().get_business_data(module, "payload9_3",id1,id1,rand_num,rand_num,id2,id2) + request_body = commonFuc().get_business_data(module, "payload9_3",id1,id1,sourceVersion,id2,id2) print('request_body',request_body) # 发送请求 @@ -50,6 +51,14 @@ def select1(): if code==0: commonFuc().check_text_exist(code,result) else: - commonFuc().check_text_exist('error', result) + # commonFuc().check_text_exist('error', result) + sourceVersion=commonFuc().analysis_json('sourceVersion',request_body) + + sourceVersion=int(sourceVersion)+1 + request_body = commonFuc().get_business_data(module, "payload9_3", id1, id1, sourceVersion,id2, id2) + print(request_body) + result = commonFuc().http_post(url, request_body, headers) + print(result) + commonFuc().analysis_json('code',result) select1() diff --git "a/air_case/a6_mdm3_dp/a7_4\344\273\243\351\205\215\351\200\201\344\270\213\345\215\225\345\210\227\350\241\250\346\225\260\346\215\256\346\237\245\350\257\242_\345\267\262\345\256\214\346\210\220.air/a7_4\344\273\243\351\205\215\351\200\201\344\270\213\345\215\225\345\210\227\350\241\250\346\225\260\346\215\256\346\237\245\350\257\242_\345\267\262\345\256\214\346\210\220.py" "b/air_case/a6_mdm3_dp/a7_4\344\273\243\351\205\215\351\200\201\344\270\213\345\215\225\345\210\227\350\241\250\346\225\260\346\215\256\346\237\245\350\257\242_\345\267\262\345\256\214\346\210\220.air/a7_4\344\273\243\351\205\215\351\200\201\344\270\213\345\215\225\345\210\227\350\241\250\346\225\260\346\215\256\346\237\245\350\257\242_\345\267\262\345\256\214\346\210\220.py" new file mode 100644 index 00000000..3ff31ddc --- /dev/null +++ "b/air_case/a6_mdm3_dp/a7_4\344\273\243\351\205\215\351\200\201\344\270\213\345\215\225\345\210\227\350\241\250\346\225\260\346\215\256\346\237\245\350\257\242_\345\267\262\345\256\214\346\210\220.air/a7_4\344\273\243\351\205\215\351\200\201\344\270\213\345\215\225\345\210\227\350\241\250\346\225\260\346\215\256\346\237\245\350\257\242_\345\267\262\345\256\214\346\210\220.py" @@ -0,0 +1,62 @@ +# -*- encoding=utf8 -*- +from common.fileUtls import FileUtils + +__author__ = "xiaohesheng" + +""" +case_tag:api,mdm-web,a7_4代配送下单列表数据查询_已完成,id2291,id2291-37,sit,on +主数据平台:a7_4代配送下单列表数据查询_已完成 +""" + +from common.common_func import commonFuc +from airtest.core.api import using +import sys +module = "a6_mdm3_dp" +def select1(): + pro_path = commonFuc().get_pro_path() + sys.path.append(pro_path + r'\\air_case\\a6_mdm3_dp\\a1企业登录.air') + using(pro_path + r'\\air_case\\a6_mdm3_dp\\a1企业登录.air') + from a1企业登录 import e_login + token, projectCode, uxid, corpId, e_name = e_login() + # # 获取医院corpId + # sys.path.append(pro_path + r'\\air_case\\a4_mdm3_cm\\a1供货关系申请_客户类型_医院_登录_医院登录获取医院id.air') + # using(pro_path + r'\\air_case\\a4_mdm3_cm\\a1供货关系申请_客户类型_医院_登录_医院登录获取医院id.air') + # from a1供货关系申请_客户类型_医院_登录_医院登录获取医院id import h_login + # h_token, h_projectCode, h_uxid, h_corpId, h_name = h_login() + """ + 场景:a7_4代配送下单列表数据查询_已完成 + 用例名称:a7_4代配送下单列表数据查询_已完成 + 输入:无 + 输出:"rtn_msg": 0 + """ + module = "a6_mdm3_dp" + #a6_4代配送下单列表数据查询_待确认查询3 + url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "purchase_page_url") + # 获取请求头信息 + headers = commonFuc().get_business_data(module, "json_headers2", + commonFuc().get_business_data(module, "json_contentType"), token, + projectCode) + goodsname = commonFuc().randomString(5) + request_body = commonFuc().get_business_data(module, "payload9_4") + # request_body = commonFuc().get_business_data(module, "payload10_1") + + # 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) + data1=commonFuc().analysis_json('data',data) + if code==0 and total>=1: + id1 = commonFuc().analysis_json('id', data1[0]) + print(id1) + id2 = commonFuc().analysis_json('id', data1[1]) + print(id2) + commonFuc().check_text_exist(code, result) + return id1, id2 + else: + commonFuc().check_text_exist('error', result) +select1() + diff --git a/common/common_func.py b/common/common_func.py index d19ca967..3ad5a0f4 100644 --- a/common/common_func.py +++ b/common/common_func.py @@ -514,6 +514,10 @@ class commonFuc(object): import random s = "".join(random.sample(string.ascii_letters + string.digits + "!@#$%^&*()", n)) return s + def random_int(self): + import random + rand_num = random.randint(1, 999999) + return rand_num # 打开网页 def openBrowser(self, url, chrome): diff --git a/data/a6_mdm3_dp/data b/data/a6_mdm3_dp/data index c5e8da93..b2df9eca 100644 --- a/data/a6_mdm3_dp/data +++ b/data/a6_mdm3_dp/data @@ -89,6 +89,8 @@ json_headers2: { "payload9_1": {"pageNum":1,"pageSize":50,"orderBy":"last_modified desc, order_no desc","queryObject":{"dateValue":["",""],"hosId":"h0028","orderNo":"","provId":"p10d95","pageType":2,"tabIdx":"2","startDate":"","endDate":""}} "payload9_2": {"id":"","purBillId":"%s","sourceId":"%s","sourceVersion":1,"version":0,"billMode":"20","hosVersion":3,"createUser":"GYQX-SPD:user-19669","createUserName":"浙江高仰医疗","lastModifiedUser":"GYQX-SPD:user-19669","detailList":[{"sourceDetailId":"%s","hosGoodsId":"h034700001984","mdmGoodsCode":"11658124","goodsCode":"00001984","certificateCode":"鄂准药监器20231044114","pkgDefId":null,"provGoodsId":null,"replPkgQty":799,"settlement":3,"batchCode":"333","productDate":"2023-12-01","expdtDate":"2024-02-25","distrPkgQty":1,"disabledFlag":0,"distrQty":1,"ext":{"ygptCode":"","transCond":"","storageCond":"2~8℃保存","erpCode":"11658124"},"edit":true,"barcodeList":[],"viewId":"%sROW0"}]} "payload9_3": {"id":"","purBillId":"%s","sourceId":"%s","sourceVersion":"%s","version":0,"billMode":"66","hosVersion":2,"createUser":"GYQX-SPD:user-19669","createUserName":"浙江高仰医疗","lastModifiedUser":"GYQX-SPD:user-19669","detailList":[{"sourceDetailId":"%s","hosGoodsId":"h0028|hosGood-880444","mdmGoodsCode":null,"goodsCode":"880444","certificateCode":"京械注准203420915218","pkgDefId":"h0028000217","provGoodsId":"provGood-1939432","replPkgQty":6,"settlement":0,"batchCode":"1","productDate":"2023-12-01","expdtDate":"2023-12-31","distrPkgQty":1,"disabledFlag":0,"distrQty":10,"ext":{"ygptCode":"","transCond":"0-15℃","storageCond":"0-30℃","erpCode":"11658060"},"edit":true,"barcodeList":[],"viewId":"%sROW0"}]} +"payload9_4": {"pageNum":1,"pageSize":50,"orderBy":"last_modified desc, order_no desc","queryObject":{"dateValue":["",""],"provId":"p10d95","pageType":2,"hosIdList":["h0347","h0028"],"tabIdx":"3","startDate":"","endDate":""}} + checkDict: {'code': 0, 'msg': None, 'tag': None, 'data': 0} checkDict1: {'code': 1100000, 'msg': '暂时没有定义异码,中文描述为:审核失败', 'tag': '/mdmService:gyqx.spd.mdm.access.service.impl.Supply diff --git a/report/summary.html b/report/summary.html index 3d80c911..bc6757f7 100644 --- a/report/summary.html +++ b/report/summary.html @@ -56,7 +56,7 @@ 1 1 - 0分7秒 + 0分3秒 100.0% @@ -72,9 +72,9 @@ - a7_3订单配送提交_2_0医院 + a7_4代配送下单列表数据查询_已完成 成功 - 7.3 + 3.298 xiaohesheng -- GitLab