From 5735aaacefdf83abcb915c92a35dd053f2a18030 Mon Sep 17 00:00:00 2001 From: xiao-hesheng <xhs89@sina.com> Date: Tue, 12 Mar 2024 10:04:45 +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 --- ...5_\345\271\266\346\217\220\344\272\244.py" | 6 +- ...45\350\257\242\345\205\250\351\203\250.py" | 2 +- ...22\345\217\267\346\237\245\350\257\242.py" | 70 +++++++++++++++++++ ...66\351\227\264\346\237\245\350\257\242.py" | 61 ++++++++++++++++ data/b3_herp3_purchase/data | 3 + report/summary.html | 6 +- 6 files changed, 141 insertions(+), 7 deletions(-) create mode 100644 "air_case/b3_herp3_purchase/a_b6_\351\207\207\350\264\255\350\256\241\345\210\222_\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\240\271\346\215\256\351\207\207\350\264\255\350\256\241\345\210\222\345\217\267\346\237\245\350\257\242.air/a_b6_\351\207\207\350\264\255\350\256\241\345\210\222_\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\240\271\346\215\256\351\207\207\350\264\255\350\256\241\345\210\222\345\217\267\346\237\245\350\257\242.py" create mode 100644 "air_case/b3_herp3_purchase/a_b7_\351\207\207\350\264\255\350\256\241\345\210\222_\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\240\271\346\215\256\345\210\266\345\215\225\346\227\266\351\227\264\346\237\245\350\257\242.air/a_b7_\351\207\207\350\264\255\350\256\241\345\210\222_\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\240\271\346\215\256\345\210\266\345\215\225\346\227\266\351\227\264\346\237\245\350\257\242.py" diff --git "a/air_case/b3_herp3_purchase/a_b4_\351\207\207\350\264\255\350\256\241\345\210\222_\347\274\226\350\276\221_\345\205\250\351\203\250\345\205\263\351\227\255_\345\271\266\346\217\220\344\272\244.air/a_b4_\351\207\207\350\264\255\350\256\241\345\210\222_\347\274\226\350\276\221_\345\205\250\351\203\250\345\205\263\351\227\255_\345\271\266\346\217\220\344\272\244.py" "b/air_case/b3_herp3_purchase/a_b4_\351\207\207\350\264\255\350\256\241\345\210\222_\347\274\226\350\276\221_\345\205\250\351\203\250\345\205\263\351\227\255_\345\271\266\346\217\220\344\272\244.air/a_b4_\351\207\207\350\264\255\350\256\241\345\210\222_\347\274\226\350\276\221_\345\205\250\351\203\250\345\205\263\351\227\255_\345\271\266\346\217\220\344\272\244.py" index 36efa089..fedb5d17 100644 --- "a/air_case/b3_herp3_purchase/a_b4_\351\207\207\350\264\255\350\256\241\345\210\222_\347\274\226\350\276\221_\345\205\250\351\203\250\345\205\263\351\227\255_\345\271\266\346\217\220\344\272\244.air/a_b4_\351\207\207\350\264\255\350\256\241\345\210\222_\347\274\226\350\276\221_\345\205\250\351\203\250\345\205\263\351\227\255_\345\271\266\346\217\220\344\272\244.py" +++ "b/air_case/b3_herp3_purchase/a_b4_\351\207\207\350\264\255\350\256\241\345\210\222_\347\274\226\350\276\221_\345\205\250\351\203\250\345\205\263\351\227\255_\345\271\266\346\217\220\344\272\244.air/a_b4_\351\207\207\350\264\255\350\256\241\345\210\222_\347\274\226\350\276\221_\345\205\250\351\203\250\345\205\263\351\227\255_\345\271\266\346\217\220\344\272\244.py" @@ -53,8 +53,8 @@ def test1(): print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', result) data = commonFuc().analysis_json('data', result) id1 = commonFuc().analysis_json('id', data[0]) - id2= commonFuc().analysis_json('id', data[1]) - id3= commonFuc().analysis_json('id', data[2]) + id2 = commonFuc().analysis_json('id', data[1]) + id3 = commonFuc().analysis_json('id', data[2]) # ===================================== url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "herpService_purPlan_edit_url") @@ -65,7 +65,7 @@ def test1(): commonFuc().get_business_data(module, "X-APP-CODE")) print('headers', headers) # # 璇锋眰浣� - request_body = commonFuc().get_business_data(module, "payload16", id1,id2,id3) + request_body = commonFuc().get_business_data(module, "payload16", id1, id2, id3) # 鍙戦€佽姹� result = commonFuc().http_post(url, request_body, headers) print('resultbbbbbbbbbbbbbbbbbbbb', result) diff --git "a/air_case/b3_herp3_purchase/a_b5_\351\207\207\350\264\255\350\256\241\345\210\222_\345\210\227\350\241\250\346\237\245\350\257\242_\346\237\245\350\257\242\345\205\250\351\203\250.air/a_b5_\351\207\207\350\264\255\350\256\241\345\210\222_\345\210\227\350\241\250\346\237\245\350\257\242_\346\237\245\350\257\242\345\205\250\351\203\250.py" "b/air_case/b3_herp3_purchase/a_b5_\351\207\207\350\264\255\350\256\241\345\210\222_\345\210\227\350\241\250\346\237\245\350\257\242_\346\237\245\350\257\242\345\205\250\351\203\250.air/a_b5_\351\207\207\350\264\255\350\256\241\345\210\222_\345\210\227\350\241\250\346\237\245\350\257\242_\346\237\245\350\257\242\345\205\250\351\203\250.py" index 9ce00f65..e2df3954 100644 --- "a/air_case/b3_herp3_purchase/a_b5_\351\207\207\350\264\255\350\256\241\345\210\222_\345\210\227\350\241\250\346\237\245\350\257\242_\346\237\245\350\257\242\345\205\250\351\203\250.air/a_b5_\351\207\207\350\264\255\350\256\241\345\210\222_\345\210\227\350\241\250\346\237\245\350\257\242_\346\237\245\350\257\242\345\205\250\351\203\250.py" +++ "b/air_case/b3_herp3_purchase/a_b5_\351\207\207\350\264\255\350\256\241\345\210\222_\345\210\227\350\241\250\346\237\245\350\257\242_\346\237\245\350\257\242\345\205\250\351\203\250.air/a_b5_\351\207\207\350\264\255\350\256\241\345\210\222_\345\210\227\350\241\250\346\237\245\350\257\242_\346\237\245\350\257\242\345\205\250\351\203\250.py" @@ -53,7 +53,7 @@ def test1(): total = commonFuc().analysis_json('total', data) if code == 0 and len(data) >= 1 and total >= 0: commonFuc().check_text_exist(0, result) - return total + return data else: commonFuc().check_text_exist('error', result) diff --git "a/air_case/b3_herp3_purchase/a_b6_\351\207\207\350\264\255\350\256\241\345\210\222_\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\240\271\346\215\256\351\207\207\350\264\255\350\256\241\345\210\222\345\217\267\346\237\245\350\257\242.air/a_b6_\351\207\207\350\264\255\350\256\241\345\210\222_\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\240\271\346\215\256\351\207\207\350\264\255\350\256\241\345\210\222\345\217\267\346\237\245\350\257\242.py" "b/air_case/b3_herp3_purchase/a_b6_\351\207\207\350\264\255\350\256\241\345\210\222_\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\240\271\346\215\256\351\207\207\350\264\255\350\256\241\345\210\222\345\217\267\346\237\245\350\257\242.air/a_b6_\351\207\207\350\264\255\350\256\241\345\210\222_\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\240\271\346\215\256\351\207\207\350\264\255\350\256\241\345\210\222\345\217\267\346\237\245\350\257\242.py" new file mode 100644 index 00000000..cc7550e8 --- /dev/null +++ "b/air_case/b3_herp3_purchase/a_b6_\351\207\207\350\264\255\350\256\241\345\210\222_\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\240\271\346\215\256\351\207\207\350\264\255\350\256\241\345\210\222\345\217\267\346\237\245\350\257\242.air/a_b6_\351\207\207\350\264\255\350\256\241\345\210\222_\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\240\271\346\215\256\351\207\207\350\264\255\350\256\241\345\210\222\345\217\267\346\237\245\350\257\242.py" @@ -0,0 +1,70 @@ +# -*- encoding=utf8 -*- +from common.timeUtils import timeUtils + +__author__ = "xiaohesheng" + +""" +case_tag:api,herp-web,a_b6_閲囪喘璁″垝_鍒楄〃鏌ヨ_鏉′欢鏌ヨ_鏍规嵁閲囪喘璁″垝鍙锋煡璇�,id2297,id2297-16,sit,on +鍐呯綉:a_b6_閲囪喘璁″垝_鍒楄〃鏌ヨ_鏉′欢鏌ヨ_鏍规嵁閲囪喘璁″垝鍙锋煡璇� +""" + +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_b6_閲囪喘璁″垝_鍒楄〃鏌ヨ_鏉′欢鏌ヨ_鏍规嵁閲囪喘璁″垝鍙锋煡璇� + 鐢ㄤ緥鍚嶇О锛歛_b6_閲囪喘璁″垝_鍒楄〃鏌ヨ_鏉′欢鏌ヨ_鏍规嵁閲囪喘璁″垝鍙锋煡璇� + 杈撳叆锛氭棤 + 杈撳嚭锛�"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鍜宲rojectCode + token, projectCode, uxid, corpId, info = login_system(username, password).get_token() + # print( token,projectCode,uxid,corpId,info) + #================================= + #鑾峰彇閲囪喘璁″垝鍗曞彿 + pro_path = commonFuc().get_pro_path() + sys.path.append(pro_path + r'\\air_case\\b3_herp3_purchase\\a_b5_閲囪喘璁″垝_鍒楄〃鏌ヨ_鏌ヨ鍏ㄩ儴.air') + using(pro_path + r'\\air_case\\b3_herp3_purchase\\a_b5_閲囪喘璁″垝_鍒楄〃鏌ヨ_鏌ヨ鍏ㄩ儴.air') + from a_b5_閲囪喘璁″垝_鍒楄〃鏌ヨ_鏌ヨ鍏ㄩ儴 import test1 + result1 = test1() + # print('result1','aaaaaaaaaaaaa',result1) + data1= commonFuc().analysis_json('data', result1) + orderNo = commonFuc().analysis_json('orderNo', data1[0]) + #================================= + url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "herpService_purPlan_listVoPage_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) + # # 璇锋眰浣� + request_body = commonFuc().get_business_data(module, "payload17",orderNo) + # 鍙戦€佽姹� + 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 len(data) >= 1 and total == 1: + commonFuc().check_text_exist(0, result) + else: + commonFuc().check_text_exist('error', result) + + +test1() diff --git "a/air_case/b3_herp3_purchase/a_b7_\351\207\207\350\264\255\350\256\241\345\210\222_\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\240\271\346\215\256\345\210\266\345\215\225\346\227\266\351\227\264\346\237\245\350\257\242.air/a_b7_\351\207\207\350\264\255\350\256\241\345\210\222_\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\240\271\346\215\256\345\210\266\345\215\225\346\227\266\351\227\264\346\237\245\350\257\242.py" "b/air_case/b3_herp3_purchase/a_b7_\351\207\207\350\264\255\350\256\241\345\210\222_\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\240\271\346\215\256\345\210\266\345\215\225\346\227\266\351\227\264\346\237\245\350\257\242.air/a_b7_\351\207\207\350\264\255\350\256\241\345\210\222_\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\240\271\346\215\256\345\210\266\345\215\225\346\227\266\351\227\264\346\237\245\350\257\242.py" new file mode 100644 index 00000000..826d0a11 --- /dev/null +++ "b/air_case/b3_herp3_purchase/a_b7_\351\207\207\350\264\255\350\256\241\345\210\222_\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\240\271\346\215\256\345\210\266\345\215\225\346\227\266\351\227\264\346\237\245\350\257\242.air/a_b7_\351\207\207\350\264\255\350\256\241\345\210\222_\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\240\271\346\215\256\345\210\266\345\215\225\346\227\266\351\227\264\346\237\245\350\257\242.py" @@ -0,0 +1,61 @@ +# -*- encoding=utf8 -*- +from common.timeUtils import timeUtils + +__author__ = "xiaohesheng" + +""" +case_tag:api,herp-web,a_b7_閲囪喘璁″垝_鍒楄〃鏌ヨ_鏉′欢鏌ヨ_鏍规嵁鍒跺崟鏃堕棿鏌ヨ,id2297,id2297-17,sit,on +鍐呯綉:a_b7_閲囪喘璁″垝_鍒楄〃鏌ヨ_鏉′欢鏌ヨ_鏍规嵁鍒跺崟鏃堕棿鏌ヨ +""" + +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_b7_閲囪喘璁″垝_鍒楄〃鏌ヨ_鏉′欢鏌ヨ_鏍规嵁鍒跺崟鏃堕棿鏌ヨ + 鐢ㄤ緥鍚嶇О锛歛_b7_閲囪喘璁″垝_鍒楄〃鏌ヨ_鏉′欢鏌ヨ_鏍规嵁鍒跺崟鏃堕棿鏌ヨ + 杈撳叆锛氭棤 + 杈撳嚭锛�"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鍜宲rojectCode + 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, "herpService_purPlan_listVoPage_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) + # # 璇锋眰浣� + request_body = commonFuc().get_business_data(module, "payload17_1",date2,date1) + # 鍙戦€佽姹� + 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 len(data) >= 1 and total >= 1: + 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 8907c5d6..63136f2e 100644 --- a/data/b3_herp3_purchase/data +++ b/data/b3_herp3_purchase/data @@ -51,5 +51,8 @@ json_headers2: { "payload_6_2": {"queryObject":{"hosId":"h0347","branchId":"h0347-2011","goodsMfrsName":"","goodsName":"","purModes":[],"provName":"","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":"%s"} "payload16": {"closeStatus":2,"idList":["%s","%s","%s"]} "payload16_1": {"id":"%s","planDetailList":[{"closeStatus":2,"id":"%s","inSettlement":5,"planPkgQty":33,"pkgDefQty":333,"provId":"p000029d7","provName":"鍥借嵂闆嗗洟婀栧寳鍒嗗叕鍙竚QDwR7","subProvId":"p000029d7","subProvName":"鍥借嵂闆嗗洟婀栧寳鍒嗗叕鍙竚QDwR7","hosGoodsId":"h034700001761","purMode":10,"version":1,"pkgDefId":"0b4451f1086f4c25b5eac5bf22f45c0b","purTaskId":"7b6cf1ab43ab44fc9c1a1c81d85c5542","sourceId":null},{"closeStatus":2,"id":"%s","inSettlement":2,"planPkgQty":33,"pkgDefQty":1,"provId":"p56a4","provName":"鍥借嵂闆嗗洟娴欐睙鍖荤枟鍣ㄦ潗鏈夐檺鍏徃","subProvId":"p56a4","subProvName":"鍥借嵂闆嗗洟娴欐睙鍖荤枟鍣ㄦ潗鏈夐檺鍏徃","hosGoodsId":"h034700001771","purMode":20,"version":1,"pkgDefId":null,"purTaskId":null,"sourceId":null},{"closeStatus":2,"id":"%s","inSettlement":1,"planPkgQty":33,"pkgDefQty":1,"provId":"p000029d8","provName":"鍥借嵂闆嗗洟婀栧崡鍒嗗叕鍙竚kcQNd","subProvId":"p000029d7","subProvName":"鍥借嵂闆嗗洟婀栧寳鍒嗗叕鍙竚QDwR7","hosGoodsId":"h034700001859","purMode":60,"version":1,"pkgDefId":"26d93e6fecd24b6fa4bde8aeacfbf153","purTaskId":"5c85573c049141ff8df808dabc30d2b1","sourceId":null}],"tempFlag":0,"version":0,"checkLcTaskQty":true} +"payload17": {"pageNum": 1,"pageSize": 50,"queryObject": {"orderNo": "%s","hosId": "h0347","startTime": null,"endTime": null}} +"payload17_1": {"pageNum": 1,"pageSize": 50,"queryObject": {"orderNo": "","hosId": "h0347","startTime": "%s","endTime": "%s"}} + checkDict2: {"code": 0,'msg': None,'data':1} diff --git a/report/summary.html b/report/summary.html index f7be6f4f..2bd6992d 100644 --- a/report/summary.html +++ b/report/summary.html @@ -56,7 +56,7 @@ <tr width="600"> <td class='details-col-elapsed'>1</td> <td class='details-col-elapsed'>1</td> - <td class='details-col-elapsed'>0鍒�2绉�</td> + <td class='details-col-elapsed'>0鍒�1绉�</td> <td class="details-col-elapsed">100.0%</td> </tr> </table> @@ -72,9 +72,9 @@ </tr> <tr width="600"> - <td class="details-col-elapsed"><a href='../log/a_b5_閲囪喘璁″垝_缂栬緫_鍏ㄩ儴鍏抽棴/log.html' target='_blank'>a_b5_閲囪喘璁″垝_缂栬緫_鍏ㄩ儴鍏抽棴</a></td> + <td class="details-col-elapsed"><a href='../log/a_b7_閲囪喘璁″垝_鍒楄〃鏌ヨ_鏉′欢鏌ヨ_鏍规嵁鍒跺崟鏃堕棿鏌ヨ/log.html' target='_blank'>a_b7_閲囪喘璁″垝_鍒楄〃鏌ヨ_鏉′欢鏌ヨ_鏍规嵁鍒跺崟鏃堕棿鏌ヨ</a></td> <td class="success">鎴愬姛</td> - <td class="details-col-elapsed">2.666</td> + <td class="details-col-elapsed">1.63</td> <td class="details-col-elapsed">xiaohesheng</td> </tr> -- GitLab