Commit 07c098ad authored by xiao-hesheng's avatar xiao-hesheng
Browse files

新增请领模板维护脚本

parent 68bd8107
...@@ -40,7 +40,7 @@ def test1(): ...@@ -40,7 +40,7 @@ def test1():
# from n7运维管理_消息通知模板_消息类型_获取消息模板ID import test1 # from n7运维管理_消息通知模板_消息类型_获取消息模板ID import test1
# id1= test1() # id1= test1()
# print(id1) # print(id1)
#p1科室管理_科室产品分配_产品列表查询_条件查询 #p2科室管理_科室产品分配_请领模板维护_新增模板_重复新增
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "basic_goodsPurTemplate_insert_url") url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "basic_goodsPurTemplate_insert_url")
# 获取请求头信息 # 获取请求头信息
......
# -*- 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,p3科室管理_科室产品分配_请领模板维护_新增模板_异常,id2263,id2263-185,sit,on
内网:p3科室管理_科室产品分配_请领模板维护_新增模板_异常
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:p3科室管理_科室产品分配_请领模板维护_新增模板_异常
用例名称:p3科室管理_科室产品分配_请领模板维护_新增模板_异常
输入:"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)
#p3科室管理_科室产品分配_请领模板维护_新增模板_异常
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_1",i)
# # # 发送请求
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,p4科室管理_科室产品分配_请领模板维护_模板列表查询,id2263,id2263-186,sit,on
内网:p4科室管理_科室产品分配_请领模板维护_模板列表查询
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:p4科室管理_科室产品分配_请领模板维护_模板列表查询
用例名称:p4科室管理_科室产品分配_请领模板维护_模板列表查询
输入:"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)
#p4科室管理_科室产品分配_请领模板维护_模板列表查询
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "basic_goodsPurTemplate_list_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_2")
# # # 发送请求
result = commonFuc().http_post(url, request_body,headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
#断言
code=commonFuc().analysis_json('code',result)
data=commonFuc().analysis_json('data',result)
id1=commonFuc().analysis_json('id',data[0])
print('id1',id1)
if code==0 and len(data)>=1:
commonFuc().check_text_exist(0, result)
return id1
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,p5科室管理_科室产品分配_请领模板维护_编辑模板,id2263,id2263-187,sit,on
内网:p5科室管理_科室产品分配_请领模板维护_编辑模板
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:p5科室管理_科室产品分配_请领模板维护_编辑模板
用例名称:p5科室管理_科室产品分配_请领模板维护_编辑模板
输入:"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\\p4科室管理_科室产品分配_请领模板维护_模板列表查询.air')
using(pro_path + r'\\air_case\\b2_herp3_bs\\p4科室管理_科室产品分配_请领模板维护_模板列表查询.air')
from p4科室管理_科室产品分配_请领模板维护_模板列表查询 import test1
id1= test1()
print(id1)
#p5科室管理_科室产品分配_请领模板维护_编辑模板
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "basic_goodsPurTemplate_updateById_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_3",'修改模板名称测试',id1)
# # # 发送请求
result = commonFuc().http_post(url, request_body,headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
#断言
code=commonFuc().analysis_json('code',result)
data=commonFuc().analysis_json('data',result)
if code==0 and data==1:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
...@@ -73,6 +73,8 @@ ...@@ -73,6 +73,8 @@
"basic_mcmsDeptGoodsInfo_updateById": "/api/herpService/basic/mcmsDeptGoodsInfo/updateById" "basic_mcmsDeptGoodsInfo_updateById": "/api/herpService/basic/mcmsDeptGoodsInfo/updateById"
"basic_mcmsDeptGoodsInfo_page_url": "/api/herpService/basic/mcmsDeptGoodsInfo/page" "basic_mcmsDeptGoodsInfo_page_url": "/api/herpService/basic/mcmsDeptGoodsInfo/page"
"basic_goodsPurTemplate_insert_url": "/api/herpService/basic/goodsPurTemplate/insert" "basic_goodsPurTemplate_insert_url": "/api/herpService/basic/goodsPurTemplate/insert"
"basic_goodsPurTemplate_list_url": "/api/herpService/basic/goodsPurTemplate/list"
"basic_goodsPurTemplate_updateById_url": "/api/herpService/basic/goodsPurTemplate/updateById"
"basic_stockInfo_stockTree": "/api/herpService/basic/stockInfo/stockTree" "basic_stockInfo_stockTree": "/api/herpService/basic/stockInfo/stockTree"
...@@ -387,6 +389,9 @@ json_headers2: { ...@@ -387,6 +389,9 @@ json_headers2: {
"payload58_15": {"queryObject":{"goodsName":"","goodsSpec":"%s","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} "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} "payload59": {"cname":"test","branchId":"h0347-2011","deptId":"d69a68df361a4289b2262e4ef75b55a5","hosId":"h0347","tbStatus":1}
"payload59_1": {"cname":"%s","branchId":"h0347-2011","deptId":"d69a68df361a4289b2262e4ef75b55a5","hosId":"h0347","tbStatus":1}
"payload59_2": {"branchId":"h0347-2011","deptId":"d69a68df361a4289b2262e4ef75b55a5","hosId":"h0347"}
"payload59_3": {"cname":"%s","id":"%s","branchId":"h0347-2011","deptId":"d69a68df361a4289b2262e4ef75b55a5","hosId":"h0347"}
"payload60": {"hosId":"h0347","stockCode":"%s"} "payload60": {"hosId":"h0347","stockCode":"%s"}
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<tr width="600"> <tr width="600">
<td class='details-col-elapsed'>1</td> <td class='details-col-elapsed'>1</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'>0分4</td>
<td class="details-col-elapsed">100.0%</td> <td class="details-col-elapsed">100.0%</td>
</tr> </tr>
</table> </table>
...@@ -72,9 +72,9 @@ ...@@ -72,9 +72,9 @@
</tr> </tr>
<tr width="600"> <tr width="600">
<td class="details-col-elapsed"><a href='../log/p2科室管理_科室产品分配_请领模板维护_新增模板_重复新增/log.html' target='_blank'>p2科室管理_科室产品分配_请领模板维护_新增模板_重复新增</a></td> <td class="details-col-elapsed"><a href='../log/p5科室管理_科室产品分配_请领模板维护_编辑模板/log.html' target='_blank'>p5科室管理_科室产品分配_请领模板维护_编辑模板</a></td>
<td class="success">成功</td> <td class="success">成功</td>
<td class="details-col-elapsed">1.546</td> <td class="details-col-elapsed">4.213</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