Commit 971452ca authored by liguangyu06's avatar liguangyu06
Browse files

优化

parent 2dfbe8ef
......@@ -43,14 +43,25 @@ out_random = random.randint(0, len(result["data"]["list"]) - 1)
# 获取发货单信息
SDDOCO = func(result["data"]["list"][out_random]["SDDOCO"])
demandCode = result["data"]["list"][out_random]["demandCode"]
productCode = func(result["data"]["list"][out_random]["productCode"])
optionStr = func(result["data"]["list"][out_random]["optionStr"])
materialCode = func(result["data"]["list"][out_random]["materialCode"])
productName = func(result["data"]["list"][out_random]["productName"])
sddcto = result["data"]["list"][out_random]["sddcto"]
manufacturer = ""
# 第三步进行条件查询
# 第三步获取发货单详情
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url26")
request_body = commonFuc().get_business_data(module, "payload26", demandCode, SDDOCO, sddcto)
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
result = json.loads(result.content)
# print(result)
# 获取随机数
product_random = random.randint(0, len(result["data"]) - 1)
# 获取商品信息
manufacturer = func(result["data"][product_random]["manufacturer"])
materialCode = func(result["data"][product_random]["materialCode"])
productCode = func(result["data"][product_random]["productCode"])
productName = func(result["data"][product_random]["productName"])
optionStr = func(result["data"][product_random]["optionStr"])
# 第四步进行条件查询
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url28")
request_body = commonFuc().get_business_data(module, "payload28", manufacturer, materialCode, productCode, productName,
optionStr,
......@@ -68,7 +79,7 @@ result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
result = json.loads(result.content)
print(result)
# print(result)
# 获取productCode
result = {"productCode": result["data"][0]["productCode"]}
......
......@@ -68,9 +68,12 @@ class commonFuc(object):
url = ""
elif env == "od": # 骨科
url = ""
elif env == "bs": # 电商
elif env == "bs": # 电商uat环境
url = "https://service-uat.gyqxmall.com"
# url = "https://service-slb.cmic.com.cn"
elif env == "be": # beta环境
# url = "https://service-uat.gyqxmall.com"
url = "https://service-slb.cmic.com.cn"
else:
url = 'http://spddev.cmic.com.cn'
......
# 多采商城登录信息
"username": "BJ0621"
"password": "Aa123456"
"username3": "GL1000086"
"password3": "Aa123456"
#后台运营管理系统登录信息(子站点上海医疗器械有限公司)
"username1": "Admin00111"
"password1": "Aa123456"
#后台管理系统headers
json_headers: {
"Content-Type": "application/json",
"Cmdc_access_token": "%s"
}
#文件上传headers
json_headers_file: {
"Cmdc_access_token": "%s"
}
#多采商城headers
json_headers1: {
"Cmdc_access_token": "%s",
"Sourcetype": "mall"
}
#测试场景一:根据用户id获取公司信息
"url1": "/user/public/getCompanyByUserId"
"payload1": {}
#预期结果
checkDict1: {"total":"%s"}
#测试场景二:获取已发布商品分类信息
"url2": "/product/mall/selectPublishedProductCategoryOption"
"payload2": {"parentId":1,"companyId":"%s"}
#预期结果
checkDict2: {"total":"%s"}
#测试场景三:上传图片附件接口验证
"url3": "/user/mall/fileUpload"
#预期结果
checkDict3: {"success":true,"code":"200","message":"OK"}
#测试场景四:添加缺货商品功能验证
"url4": "/user/mall/addStockOut"
"payload4": {"productName":"测试数据","telephone":"18700000000","specifications":"测试数据","imageUrl":'["https://pro-cmdc.oss-cn-beijing.aliyuncs.com/userFile/2024/01/09/457ec3f8-88ee-423c-9139-661051105a83.jpg"]',"content":"测试数据","contactName":"测试数据","firstCategory":39,"secondCategory":59,"thirdCategory":662,"firstCategoryName":"医用耗材","secondCategoryName":"手术耗材","thirdCategoryName":"超声刀","companyId":3}
#预期结果
checkDict4: {"success":true,"code":"200","message":"OK","data":"success"}
#测试场景五:获取缺货商品列表
"url5": "/user/mall/queryStockOutForB2B"
"payload5": {"pageStart":1,"pageSize":5}
#预期结果
checkDict5: {"total":"%s"}
#测试场景六:获取订单欠货列表
"url6": "/order/mall/queryDebtStatements"
"payload6": {"sellerCompanyCodes":[],"demandCode":"","paidSearch":null,"manufacturers":[],"materialCodes":[],"productCode":"","paymentType":"","pageSize":10,"pageStart":1}
#预期结果
checkDict6: {"success":true,"code":"200","message":"OK"}
#测试场景七:查询条件验证_欠货列表
"url7": "/order/mall/queryDebtStatements"
"payload7": {"sellerCompanyCodes":["%s"],"demandCode":"%s","paidSearch":["%s","%s"],"manufacturers":["%s"],"materialCodes":["%s"],"productCode":"%s","paymentType":"%s","pageSize":10,"pageStart":1}
#预期结果
checkDict7: {"demandCode":"%s"}
#测试场景八:获取欠货商品行信息
"url8": "/order/mall/queryDebtDetail"
"payload8": {"demandCode":"%s","materialCodes":[],"productCode":"","isDebt":1}
#预期结果
checkDict8: {"productCode":"%s"}
#测试场景九:查询条件验证_欠货商品行信息
"url9": "/order/mall/queryDebtDetail"
"payload9": {"demandCode":"%s","materialCodes":["%s"],"productCode":"%s","isDebt":1}
#预期结果
checkDict9: {"productCode":"%s"}
#测试场景十:单据信息导出验证_欠货列表
"url10": "/order/mall/exportDebtStatement"
"payload10": {"sellerCompanyCodes":[],"demandCode":"%s","paidSearch":null,"manufacturers":[],"materialCodes":[],"productCode":"","paymentType":""}
#预期结果
checkDict10: {"demandCode":"%s"}
#测试场景十一:获取发货单物流信息列表
"url11": "/order/public/jde580Jde"
"payload11": {"pageSize":null,"pageStart":null}
#预期结果
checkDict11: {"success":true,"code":"200","message":"OK"}
#测试场景十二:查询条件验证_发货单物流信息列表
"url12": "/order/public/jde580Jde"
"payload12": {"demandParentCode":"%s","productCode":"%s","endTime":"%s","startTime":"%s","sendEndTime":"%s","sendStartTime":"%s","demandCode":"%s","sellerCompanyCode":"00102","sddoco_1":"%s","pageStart":1,"pageSize":10,"optionStr":"%s"}
#预期结果
checkDict12: {"demandParentCode":"%s"}
#测试场景十三:获取物流详情
"url13": "/order/public/dde580Detail"
"payload13": {"demandParentCode":"%s"}
#预期结果
checkDict13: {"demandCode":"%s"}
#测试场景十四:必传字段校验_获取物流详情
"url14": "/order/public/dde580Detail"
"payload14": {"demandParentCode":""}
#预期结果
checkDict14: {"success":false,"code":"ERROR","message":"单号必传","data":null,"freshToken":null}
#测试场景十五:订单不存在验证_获取物流详情
"url15": "/order/public/dde580Detail"
"payload15": {"demandParentCode":"54363463456436534645"}
#预期结果
checkDict15: {"success":false,"code":"500","message":"内部系统错误","data":null,"freshToken":null}
#测试场景十六:获取发货单号验证
"url16": "/order/public/soByDemandCode"
"payload16": {"demandCode":"%s"}
#预期结果
checkDict16: {"data":"%s"}
#测试场景十七:必传字段校验_获取发货单号
"url17": "/order/public/soByDemandCode"
"payload17": {"demandCode":""}
#预期结果
checkDict17: {"success":false,"code":"500","message":"内部系统错误","data":null,"freshToken":null}
#测试场景十八:订单不存在验证_获取发货单号
"url18": "/order/public/soByDemandCode"
"payload18": {"demandCode":"%s"}
#预期结果
checkDict18: {"success":false,"code":"500","message":"内部系统错误","data":null,"freshToken":null}
#测试场景十九:发货单据导出验证
"url19": "/order/public/export/jde580Jde"
"payload19": {"demandCode":"%s","pageSize":10,"pageStart":1}
#预期结果
checkDict19: {"demandCode":"%s"}
#测试场景二十:订单发货明细导出验证
"url20": "/order/public/export/jde580Jde"
"payload20": {"demandParentCode":"%s"}
#预期结果
checkDict20: {"demandParentCode":"%s"}
#测试场景二十一:随货同行单导出验证
"url21": "/order/public/exportSo"
"payload21": {"demandCode":"%s","so":"%s","type":1}
#预期结果
checkDict21: {"so":null}
#测试场景二十二:获取退货单管理列表
"url22": "/order/public/listJdeRefund"
"payload22": {"pageSize":null,"pageStart":null,"total":null}
#预期结果
checkDict22: {"success":true,"code":"200","message":"OK"}
#测试场景二十三:查询条件验证_退货单管理
"url23": "/order/public/listJdeRefund"
"payload23": {"jdeRefundCode":"%s","customerName":"%s","manufacturer":"%s","materialCode":"%s","demandParentCode":"%s","pageSize":null,"pageStart":null,"total":null,"startTime":"%s","endTime":"%s"}
#预期结果
checkDict23: {"jdeRefundCode":"%s"}
#测试场景二十四:获取退货单详情
"url24": "/order/public/listJdeRefund"
"payload24": {"pageSize":null,"pageStart":null,"total":null,"jdeRefundCode":"%s"}
#预期结果
checkDict24: {"jdeRefundCode":"%s"}
#测试场景二十五:获取发货单列表
"url25": "/order/public/getOutDemand"
"payload25": {"times1":[],"times2":[],"times3":[],"times4":[],"times5":[],"SDDOCO":null,"customerCode":null,"customerName":null,"demandCode":null,"productCode":null,"optionStr":null,"materialCode":null,"invoiceNo":null,"productLineName":null,"sellerCompanyName":null,"projectName":null,"sddcto":null,"distributionType":null,"demandSubCode":null,"pageStart":1,"pageSize":8,"total":null,"startTime":null,"endTime":null,"sdaddjStrStart":null,"sdaddjStrEnd":null,"sdtrdjStrStart":null,"sdtrdjStrEnd":null,"auditTimeStart":null,"auditTimeEnd":null,"paidTimeStart":null,"paidTimeEnd":null}
#预期结果
checkDict25: {"success":true,"code":"200","message":"OK"}
#测试场景二十六:查询条件验证_发货单列表
"url27": "/order/public/getOutDemand"
"payload27": {"times1":[],"times2":[],"times3":[],"times4":[],"times5":[],"SDDOCO":"%s","customerCode":"%s","customerName":"%s","demandCode":"%s","productCode":"%s","optionStr":"%s","materialCode":"%s","demandParentCode":"%s","invoiceNo":"%s","productLineName":"%s","sellerCompanyName":null,"projectName":"%s","sddcto":"%s","distributionType":"%s","demandSubCode":"%s","pageStart":1,"pageSize":8,"total":null,"startTime":null,"endTime":null,"sdaddjStrStart":null,"sdaddjStrEnd":null,"sdtrdjStrStart":null,"sdtrdjStrEnd":null,"auditTimeStart":null,"auditTimeEnd":null,"paidTimeStart":null,"paidTimeEnd":null}
#预期结果
checkDict27: {"demandCode":"%s"}
#测试场景二十七:获取发货单详情
"url26": "/order/public/getOutDemandDetail"
"payload26": {"manufacturer":null,"materialCode":null,"productCode":null,"productName":null,"optionStr":null,"demandCode":"%s","SDDOCO":"%s","sddcto":"%s"}
#预期结果
checkDict26: {"demandCode":"%s"}
#测试场景二十八:发货商品清单查询条件验证_发货详情
"url28": "/order/public/getOutDemandDetail"
"payload28": {"manufacturer":"%s","materialCode":"%s","productCode":"%s","productName":"%s","optionStr":"%s","demandCode":"%s","SDDOCO":"%s","sddcto":"%s"}
#预期结果
checkDict28: {"productCode":"%s"}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment