Commit dd696f54 authored by xiao-hesheng's avatar xiao-hesheng
Browse files

增加配送模块脚本

parent d54299c2
# -*- encoding=utf8 -*-
from common.fileUtls import FileUtils
__author__ = "xiaohesheng"
"""
case_tag:api,mdm-web,a7_5代配送下单_不合格补送列表数据查询,id2291,id2291-38,sit,on
主数据平台:a7_5代配送下单_不合格补送列表数据查询
"""
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_5代配送下单_不合格补送列表数据查询
用例名称:a7_5代配送下单_不合格补送列表数据查询
输入:无
输出:"rtn_msg": 0
"""
module = "a6_mdm3_dp"
#a6_4代配送下单列表数据查询_待确认查询3
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "return_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_5")
# 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()
# -*- encoding=utf8 -*-
from common.fileUtls import FileUtils
__author__ = "xiaohesheng"
"""
case_tag:api,mdm-web,a7_6代配送下单_不合格补送_配送,id2291,id2291-39,sit,on
主数据平台:a7_6代配送下单_不合格补送_配送
数据来源于2.0内网采购-审核-配送-入库-验收不通过-不合格补送
后续内网脚本写完后再修改此脚本
"""
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_6代配送下单_不合格补送_配送
用例名称:a7_6代配送下单_不合格补送_配送
输入:无
输出:"rtn_msg": 0
"""
module = "a6_mdm3_dp"
#a6_4代配送下单列表数据查询_待确认查询3
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "return_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_5")
# 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()
# -*- encoding=utf8 -*-
from common.fileUtls import FileUtils
__author__ = "xiaohesheng"
"""
case_tag:api,mdm-web,a5_4配送单列表_全部,id2291,id2291-40,sit,on
主数据平台:a5_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()
"""
场景:a5_4配送单查询_全部
用例名称:a5_4配送单查询_全部
输入:无
输出:"rtn_msg": 0
"""
module = "a6_mdm3_dp"
#a1订单配送列表数据查询_全部
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "distr_page_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
request_body = commonFuc().get_business_data(module, "payload7")
# 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>=1:
commonFuc().check_text_exist(code,result)
else:
commonFuc().check_text_exist('error', result)
select1()
# -*- encoding=utf8 -*-
from common.fileUtls import FileUtils
__author__ = "xiaohesheng"
"""
case_tag:api,mdm-web,a5_5配送单列表_待验收,id2291,id2291-41,sit,on
主数据平台:a5_5配送单查询_待验收
"""
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()
"""
场景:a5_5配送单查询_待验收
用例名称:a5_5配送单查询_待验收
输入:无
输出:"rtn_msg": 0
"""
module = "a6_mdm3_dp"
#a1订单配送列表数据查询_全部
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "distr_page_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
request_body = commonFuc().get_business_data(module, "payload7_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)
if code==0 and total>=1:
commonFuc().check_text_exist(code,result)
else:
commonFuc().check_text_exist('error', result)
select1()
# -*- encoding=utf8 -*-
from common.fileUtls import FileUtils
__author__ = "xiaohesheng"
"""
case_tag:api,mdm-web,a5_7配送单列表_已作废,id2291,id2291-42,sit,on
主数据平台:a5_7配送单列表_已作废
"""
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()
"""
场景:a5_5配送单查询_待验收
用例名称:a5_5配送单查询_待验收
输入:无
输出:"rtn_msg": 0
"""
module = "a6_mdm3_dp"
#a1订单配送列表数据查询_全部
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "distr_page_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
request_body = commonFuc().get_business_data(module, "payload7_2")
# 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>=1:
commonFuc().check_text_exist(code,result)
else:
commonFuc().check_text_exist('error', result)
select1()
# -*- encoding=utf8 -*-
from common.fileUtls import FileUtils
__author__ = "xiaohesheng"
"""
case_tag:api,mdm-web,a5_7配送单查询_已作废,id2291,id2291-43,sit,on
主数据平台:a5_7配送单查询_已作废
"""
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()
"""
场景:a5_7配送单查询_已作废
用例名称:a5_7配送单查询_已作废
输入:无
输出:"rtn_msg": 0
"""
module = "a6_mdm3_dp"
#a1订单配送列表数据查询_全部
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "distr_page_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
request_body = commonFuc().get_business_data(module, "payload7_3")
# 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>=1:
commonFuc().check_text_exist(code,result)
else:
commonFuc().check_text_exist('error', result)
select1()
...@@ -90,7 +90,7 @@ json_headers2: { ...@@ -90,7 +90,7 @@ json_headers2: {
"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_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_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":""}} "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":""}}
"payload9_5": {"pageNum":1,"pageSize":50,"orderBy":"create_time desc","queryObject":{"dateValue":["",""],"provId":"p10d95","pageType":2,"hosIdList":["h0347","h0028"],"tabIdx":"1","startDate":"","endDate":""}}
checkDict: {'code': 0, 'msg': None, 'tag': None, 'data': 0} checkDict: {'code': 0, 'msg': None, 'tag': None, 'data': 0}
checkDict1: {'code': 1100000, 'msg': '暂时没有定义异码,中文描述为:审核失败', 'tag': '/mdmService:gyqx.spd.mdm.access.service.impl.Supply checkDict1: {'code': 1100000, 'msg': '暂时没有定义异码,中文描述为:审核失败', 'tag': '/mdmService:gyqx.spd.mdm.access.service.impl.Supply
......
...@@ -72,9 +72,9 @@ ...@@ -72,9 +72,9 @@
</tr> </tr>
<tr width="600"> <tr width="600">
<td class="details-col-elapsed"><a href='../log/a7_4代配送下单列表数据查询_已完成/log.html' target='_blank'>a7_4代配送下单列表数据查询_已完成</a></td> <td class="details-col-elapsed"><a href='../log/a7_5代配送下单_不合格补送列表数据查询/log.html' target='_blank'>a7_5代配送下单_不合格补送列表数据查询</a></td>
<td class="success">成功</td> <td class="success">成功</td>
<td class="details-col-elapsed">3.298</td> <td class="details-col-elapsed">3.599</td>
<td class="details-col-elapsed">xiaohesheng</td> <td class="details-col-elapsed">xiaohesheng</td>
</tr> </tr>
......
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