Commit 68bd8107 authored by xiao-hesheng's avatar xiao-hesheng
Browse files

新增请领模板维护脚本

parent 1b67c541
# -*- encoding=utf8 -*-
import sys
from airtest.core.helper import using
from common.db.sql.sql_del_branch_info import delData
from common.db.sql.sql_del_kind_goodsinfo import delKindGoodsinfo
from common.db.sql.sql_del_notices_info import delByNoticeName
from common.fileUtls import FileUtils
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,p2科室管理_科室产品分配_请领模板维护_新增模板,id2263,id2263-183,sit,on
内网:p2科室管理_科室产品分配_请领模板维护_新增模板
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:p2科室管理_科室产品分配_请领模板维护_新增模板
用例名称:p2科室管理_科室产品分配_请领模板维护_新增模板
输入:"test"
输出:"rtn_msg": {"code": 0, "msg": null, "data":51660462cb564f2e84e93d70661f3ec8}
"""
#内网登录
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)
# pro_path = commonFuc().get_pro_path()
# sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\n7运维管理_消息通知模板_消息类型_获取消息模板ID.air')
# using(pro_path + r'\\air_case\\b2_herp3_bs\\n7运维管理_消息通知模板_消息类型_获取消息模板ID.air')
# from n7运维管理_消息通知模板_消息类型_获取消息模板ID import test1
# id1= test1()
# print(id1)
#p1科室管理_科室产品分配_产品列表查询_条件查询
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "basic_goodsPurTemplate_insert_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"))
# branch_id = FileUtils().r_info(module, '院区新增')["branch_id"]
# str = commonFuc().get_business_data(module, 'data3')
# list2 = list(str.split(","))
# print(list2)
# #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_hms(2)
# for i in list2:
# dept2_id = FileUtils().r_info(module, '科室信息')["dept2_id"]
# 请求体
# for i in list2:
request_body = commonFuc().get_business_data(module, "payload59")
# request_body='['+str(request_body)+']'
# new_request_body = request_body.replace("'", '"')
# print(new_request_body)
# import json
# request_body_json = json.loads(new_request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body,headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
#断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code=commonFuc().analysis_json('code',result)
data=commonFuc().analysis_json('data',result)
data1=commonFuc().analysis_json('data',data)
if code==0 and len(data)>=1:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
# -*- encoding=utf8 -*-
import sys
from airtest.core.helper import using
from common.db.sql.sql_del_branch_info import delData
from common.db.sql.sql_del_kind_goodsinfo import delKindGoodsinfo
from common.db.sql.sql_del_notices_info import delByNoticeName
from common.fileUtls import FileUtils
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,p2科室管理_科室产品分配_请领模板维护_新增模板_重复新增,id2263,id2263-184,sit,on
内网:p2科室管理_科室产品分配_请领模板维护_新增模板_重复新增
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:p2科室管理_科室产品分配_请领模板维护_新增模板
用例名称:p2科室管理_科室产品分配_请领模板维护_新增模板
输入:"test"
输出:"rtn_msg": {"code": 0, "msg": null, "data":51660462cb564f2e84e93d70661f3ec8}
"""
#内网登录
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)
# pro_path = commonFuc().get_pro_path()
# sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\n7运维管理_消息通知模板_消息类型_获取消息模板ID.air')
# using(pro_path + r'\\air_case\\b2_herp3_bs\\n7运维管理_消息通知模板_消息类型_获取消息模板ID.air')
# from n7运维管理_消息通知模板_消息类型_获取消息模板ID import test1
# id1= test1()
# print(id1)
#p1科室管理_科室产品分配_产品列表查询_条件查询
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "basic_goodsPurTemplate_insert_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"))
# branch_id = FileUtils().r_info(module, '院区新增')["branch_id"]
# str = commonFuc().get_business_data(module, 'data3')
# list2 = list(str.split(","))
# print(list2)
# #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_hms(2)
# for i in list2:
# dept2_id = FileUtils().r_info(module, '科室信息')["dept2_id"]
# 请求体
# for i in list2:
request_body = commonFuc().get_business_data(module, "payload59")
# request_body='['+str(request_body)+']'
# new_request_body = request_body.replace("'", '"')
# print(new_request_body)
# import json
# request_body_json = json.loads(new_request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body,headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
#断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code=commonFuc().analysis_json('code',result)
data=commonFuc().analysis_json('data',result)
data1=commonFuc().analysis_json('data',data)
if code==1100000 and data==None:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
......@@ -72,7 +72,7 @@
"basic_mcmsGoodsInfo_insert": "/api/herpService/basic/mcmsDeptGoodsInfo/insert"
"basic_mcmsDeptGoodsInfo_updateById": "/api/herpService/basic/mcmsDeptGoodsInfo/updateById"
"basic_mcmsDeptGoodsInfo_page_url": "/api/herpService/basic/mcmsDeptGoodsInfo/page"
"basic_goodsPurTemplate_insert_url": "/api/herpService/basic/goodsPurTemplate/insert"
"basic_stockInfo_stockTree": "/api/herpService/basic/stockInfo/stockTree"
......@@ -386,6 +386,7 @@ json_headers2: {
"payload58_14": {"queryObject":{"goodsName":"%s","goodsSpec":"SSY-001","purModes":["10"],"deptId":"96c4d23bff8541599eb1a7f5f813e421","hosId":"h0347"},"pageNum":1,"pageSize":50}
"payload58_15": {"queryObject":{"goodsName":"","goodsSpec":"%s","purModes":["10"],"deptId":"96c4d23bff8541599eb1a7f5f813e421","hosId":"h0347"},"pageNum":1,"pageSize":50}
"payload58_16": {"queryObject":{"goodsName":"","goodsSpec":"","purModes":["%s"],"deptId":"96c4d23bff8541599eb1a7f5f813e421","hosId":"h0347"},"pageNum":1,"pageSize":50}
"payload59": {"cname":"test","branchId":"h0347-2011","deptId":"d69a68df361a4289b2262e4ef75b55a5","hosId":"h0347","tbStatus":1}
"payload60": {"hosId":"h0347","stockCode":"%s"}
......
......@@ -54,9 +54,9 @@
</tr>
<tr width="600">
<td class='details-col-elapsed'>21</td>
<td class='details-col-elapsed'>21</td>
<td class='details-col-elapsed'>0分40</td>
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0分1</td>
<td class="details-col-elapsed">100.0%</td>
</tr>
</table>
......@@ -72,149 +72,9 @@
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a1供货关系申请_客户类型_医院_登录_医院登录获取医院id/log.html' target='_blank'>a1供货关系申请_客户类型_医院_登录_医院登录获取医院id</a></td>
<td class="details-col-elapsed"><a href='../log/p2科室管理_科室产品分配_请领模板维护_新增模板_重复新增/log.html' target='_blank'>p2科室管理_科室产品分配_请领模板维护_新增模板_重复新增</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">2.058</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a2供货关系申请_客户类型_医院_登录_企业登录/log.html' target='_blank'>a2供货关系申请_客户类型_医院_登录_企业登录</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">0.781</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a3供货关系申请_客户类型_医院_供销关系申请提交/log.html' target='_blank'>a3供货关系申请_客户类型_医院_供销关系申请提交</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">3.204</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a4供货关系申请_客户类型_医院_分页查询分页查询供货申请单1/log.html' target='_blank'>a4供货关系申请_客户类型_医院_分页查询分页查询供货申请单1</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">1.533</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a5供货关系申请_客户类型_医院_分页查询分页查询供货申请单2/log.html' target='_blank'>a5供货关系申请_客户类型_医院_分页查询分页查询供货申请单2</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">1.33</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a6供货关系申请_客户类型_医院_分页查询分页查询供货申请单3/log.html' target='_blank'>a6供货关系申请_客户类型_医院_分页查询分页查询供货申请单3</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">1.319</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a7供货关系申请_客户类型_医院_分页查询分页查询供货申请单4/log.html' target='_blank'>a7供货关系申请_客户类型_医院_分页查询分页查询供货申请单4</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">1.37</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a8供货关系申请_客户类型_医院_供销关系申请提交_已存在的供销关系/log.html' target='_blank'>a8供货关系申请_客户类型_医院_供销关系申请提交_已存在的供销关系</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">0.849</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a9供货关系申请_客户类型_医院_供销关系编辑/log.html' target='_blank'>a9供货关系申请_客户类型_医院_供销关系编辑</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">0.846</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/b10供货关系审核_驳回_客户类型_医院_医院账号登录/log.html' target='_blank'>b10供货关系审核_驳回_客户类型_医院_医院账号登录</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">0.647</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/b11供货关系审核_驳回_客户类型_医院_供销关系审核_查询待审核数据1/log.html' target='_blank'>b11供货关系审核_驳回_客户类型_医院_供销关系审核_查询待审核数据1</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">1.997</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/b12供货关系审核_驳回_客户类型_医院_供销关系审核_驳回/log.html' target='_blank'>b12供货关系审核_驳回_客户类型_医院_供销关系审核_驳回</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">4.018</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/b13供货关系审核_驳回_客户类型_医院_供销关系审核_重复驳回/log.html' target='_blank'>b13供货关系审核_驳回_客户类型_医院_供销关系审核_重复驳回</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">2.479</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/b14供货关系审核_客户类型_医院_供销关系申请提交/log.html' target='_blank'>b14供货关系审核_客户类型_医院_供销关系申请提交</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">2.169</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/b15供货关系审核_通过_客户类型_医院/log.html' target='_blank'>b15供货关系审核_通过_客户类型_医院</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">3.151</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/b16供货关系审核_重复审核_客户类型_医院/log.html' target='_blank'>b16供货关系审核_重复审核_客户类型_医院</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">2.29</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/b17供货关系申请列表查询/log.html' target='_blank'>b17供货关系申请列表查询</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">1.622</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/b18供货目录查询/log.html' target='_blank'>b18供货目录查询</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">1.281</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/b19医院客户目录维护/log.html' target='_blank'>b19医院客户目录维护</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">1.64</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/c0供货关系申请_客户类型_厂商_供货关系申请提交/log.html' target='_blank'>c0供货关系申请_客户类型_厂商_供货关系申请提交</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">1.89</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/c1供货关系审核_通过_客户类型_厂商/log.html' target='_blank'>c1供货关系审核_通过_客户类型_厂商</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">3.968</td>
<td class="details-col-elapsed">1.546</td>
<td class="details-col-elapsed">xiaohesheng</td>
</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