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

新增科室产品分配脚本

parent 4ef22612
......@@ -73,5 +73,3 @@ def test1():
commonFuc().check_text_exist('error', result)
test1()
#利用数据库删除消息通知模板类型
delData().Delete_sys_message_template()
\ No newline at end of file
# -*- 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,o4科室管理_科室产品分配_科室目录查询_条件查询,id2263,id2263-168,sit,on
内网:o4科室管理_科室产品分配_科室目录查询_条件查询
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:o4科室管理_科室产品分配_科室目录查询_条件查询
用例名称:o4科室管理_科室产品分配_科室目录查询_条件查询
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": 1}
"""
#内网登录
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)
#o4科室管理_科室产品分配_科室目录查询_条件查询
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "branchDept_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, 'data8')
list2 = list(str.split(","))
print(list2)
# #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_hms(2)
for i in list2:
#请求体
request_body = commonFuc().get_business_data(module, "payload58_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)
pageSize=commonFuc().analysis_json('pageSize',data)
# print(pageSize)
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,o4科室管理_科室产品分配_科室目录查询_条件查询_异常场景,id2263,id2263-169,sit,on
内网:o4科室管理_科室产品分配_科室目录查询_条件查询_异常场景
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:o4科室管理_科室产品分配_科室目录查询_条件查询_异常场景
用例名称:o4科室管理_科室产品分配_科室目录查询_条件查询_异常场景
输入:"不存在的眼科,1眼,2科,111,jyk2"
输出:"rtn_msg": {"code": 0, "msg": null, "data": []}
"""
#内网登录
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)
#o4科室管理_科室产品分配_科室目录查询_条件查询_异常场景
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "branchDept_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, 'data9')
list2 = list(str.split(","))
print(list2)
# #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_hms(2)
for i in list2:
#请求体
request_body = commonFuc().get_business_data(module, "payload58_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)
pageSize=commonFuc().analysis_json('pageSize',data)
# print(pageSize)
if code==0 and len(data)==0:
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,o4科室管理_科室产品分配_科室目录查询_条件查询_异常场景,id2263,id2263-170,sit,on
内网:o4科室管理_科室产品分配_科室目录查询_条件查询_异常场景
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:o4科室管理_科室产品分配_科室目录查询_条件查询_异常场景
用例名称:o4科室管理_科室产品分配_科室目录查询_条件查询_异常场景
输入:"abcxxedd,1234456,',!@#$%,select,where 1=1"
输出:"rtn_msg": {"code": 0, "msg": null, "data": []}
"""
#内网登录
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)
#o4科室管理_科室产品分配_科室目录查询_条件查询_异常场景
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "branchDept_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:
#请求体
request_body = commonFuc().get_business_data(module, "payload58_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)
pageSize=commonFuc().analysis_json('pageSize',data)
# print(pageSize)
if code==0 and len(data)==0:
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,o5科室管理_科室产品分配_添加科室产品页面_查询全部,id2263,id2263-171,sit,on
内网:o5科室管理_科室产品分配_添加科室产品页面_查询全部
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:o5科室管理_科室产品分配_添加科室产品页面_查询全部
新科室查询
用例名称:o5科室管理_科室产品分配_添加科室产品页面_查询全部
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": []}
"""
#内网登录
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)
#o5科室管理_科室产品分配_添加科室产品页面_查询全部
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "basic_mcmsGoodsInfo_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"]
# 请求体
request_body = commonFuc().get_business_data(module, "payload58_2",dept2_id)
# # # 发送请求
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)
pageSize=commonFuc().analysis_json('pageSize',data)
# print(pageSize)
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,o6科室管理_科室产品分配_添加科室产品页面_条件查询,id2263,id2263-172,sit,on
内网:o6科室管理_科室产品分配_添加科室产品页面_条件查询
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:o6科室管理_科室产品分配_添加科室产品页面_条件查询
新科室查询,按条件查询
用例名称:o6科室管理_科室产品分配_添加科室产品页面_条件查询
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": []}
"""
#内网登录
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)
#o5科室管理_科室产品分配_添加科室产品页面_查询全部
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "basic_mcmsGoodsInfo_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"]
# 请求体
#低值
request_body = commonFuc().get_business_data(module, "payload58_3",dept2_id)
# # # 发送请求
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)
total=commonFuc().analysis_json('total',data)
goodsName=commonFuc().analysis_json('goodsName',data)
# print(pageSize)
if code==0 and total==1 and goodsName=="一次性使用无菌手术包":
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
#高值
request_body = commonFuc().get_business_data(module, "payload58_4", dept2_id)
# # # 发送请求
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)
total = commonFuc().analysis_json('total', data)
goodsName = commonFuc().analysis_json('goodsName', data)
print('goodsName',goodsName)
if code == 0 and total >= 1 and goodsName == "内固定钛网板系统":
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
#检验试剂
request_body = commonFuc().get_business_data(module, "payload58_5", dept2_id)
# # # 发送请求
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)
total = commonFuc().analysis_json('total', data)
goodsName = commonFuc().analysis_json('goodsName', data)
# print(pageSize)
if code == 0 and total >= 1 and goodsName == "指引导管":
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,o7科室管理_科室产品分配_科室新增产品,id2263,id2263-173,sit,on
内网:o7科室管理_科室产品分配_科室新增产品
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:o7科室管理_科室产品分配_科室新增产品
用例名称:o7科室管理_科室产品分配_科室新增产品
输入:产品id,科室编号
输出:"rtn_msg": {"code": 0, "msg": null, "data": []}
"""
#内网登录
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)
#o5科室管理_科室产品分配_添加科室产品页面_查询全部
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "basic_mcmsGoodsInfo_insert")
# 获取请求头信息
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"]
# 请求体
request_body = commonFuc().get_business_data(module, "payload58_6",dept2_id)
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_json,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)
if code==0 and 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,o7科室管理_科室产品分配_科室新增产品_不存在的产品,id2263,id2263-174,sit,on
内网:o7科室管理_科室产品分配_科室新增产品_不存在的产品
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:o7科室管理_科室产品分配_科室新增产品_不存在的产品
用例名称:o7科室管理_科室产品分配_科室新增产品_不存在的产品
输入:产品id,科室编号
输出:"rtn_msg": {"code": 0, "msg": null, "data": []}
"""
#内网登录
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)
#o7科室管理_科室产品分配_科室新增产品_不存在的产品
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "basic_mcmsGoodsInfo_insert")
# 获取请求头信息
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"]
# 请求体
request_body = commonFuc().get_business_data(module, "payload58_7",dept2_id)
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_json,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)
if code==0 and 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,新增库区,id2263,id2263-xxx,sit,on
内网:新增库区
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:新增库区
用例名称:新增库区
输入:产品id,科室编号
输出:"rtn_msg": {"code": 0, "msg": null, "data": []}
"""
#内网登录
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)
#新增库区
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "basic_stockInfo_stockTree")
# 获取请求头信息
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"]
branch_name= FileUtils().r_info(module, '院区新增')["branch_name"]
dept2_id = FileUtils().r_info(module, '科室信息')["dept2_id"]
# 请求体
request_body = commonFuc().get_business_data(module, "payload60",branch_name)
# # # 发送请求
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)
# if code==0 and data==1:
# commonFuc().check_text_exist(0, result)
# else:
# commonFuc().check_text_exist('error', result)
test1()
......@@ -68,6 +68,11 @@
"message_template_deleteById_url": "/api/platformService/sys/message/template/deleteById/"
"branchDept_url": "/api/platformService/sys/org/v2/list/branchDept"
"tree_h0347_url": "/api/platformService/sys/message/template/tree/h0347"
"basic_mcmsGoodsInfo_url": "/api/herpService/basic/mcmsGoodsInfo/list"
"basic_mcmsGoodsInfo_insert": "/api/herpService/basic/mcmsDeptGoodsInfo/insert"
"basic_stockInfo_stockTree": "/api/herpService/basic/stockInfo/stockTree"
data1: '条码,high_info,check_detail,高值打码,out_stock,goods_change_baseInfo,center_out_stock_pkg,mcms_centre_out_stock,pkg_info,mcms_dept_out_stock,barcode_common,mcms_centre_in_stock,goods_change_price,mcms_dept_in_stock,check_detail_pkg,center_out_stock_high,center_out_stock_high,high_consume,shelf_code,barcode_common_pkg,check_detail_high,balance_bill,barcode_rfid,bottle_info,验收单明细打印,产品信息变更,中心库出库单低值,医院中心库出库单,包信息,医院科室出库单,高值纸质条码打印,医院中心库入库单,产品调价,医院科室入库单,低值验收单,中心库出库单高值,高值耗材使用登记表,货位码,单元包纸质条码打印,高值验收单,结算单打印,高值RFID条码打印,单瓶码打印'
data2: 'code,医院标识,code1,code1,erpCode,JDE编码修改,GOODS_CHANGE_STATUS,产品信息变更状态,GOODS_CHARGE_COST,是否计入成本,GOODS_KIND_TYPE,产品分类类型,MFRS_KIND,企业职能,miCode,医保编码修改,NOTICE_RANGE_KIND,公告通知范围,PUR_MODE,耗材类型,YWMS,业务模式,CORP_TYPE,主体类别,PROGRAM_TYPE,程序端,GRAIN,参数粒度,ENV,发布环境,PROJECT_GROUP,系统分组,RETURN_REASON_TYPE,退货原因,NEWCPFL,新产品分类,ZZLX,企业证照类型,68FL,68器械分类,18FL,18器械分类,GOODS_START_STOP,产品启停,YYDJ,医院等级,GOODS_TEMP,产品临采,GLJB,耗材管理级别,GOODS_PURCHASE,产品是否采购,HIS_CODE_CHANGE,HIS编码修改,MI_CODE_CHANGE,医保型号修改,MI_GOODS_GG_CHANGE,医保产品规格,MI_GOODS_XH_CHANGE,医保型号修改,GOODS_CHARGE,产品是否计费,GOODS_BAR_CODE,产品管理模式,GOODS_PUR_MODE,耗材类型,GOODS_CHANGE_PRICE,产品调价类型,GOODS_BAR_CODE_STRATEGY,UDI管理策略,FOCUS_CONTROL_TYPE,重点管控分类,MANUAL_PICK_REASON,手工出库原因,RFID_LABEL_CHANGE,RFID标签管理,ALLOT_PICK_REASON,调拨出库原因,MAGRE_PICK_REASON,移库出库原因'
......@@ -76,7 +81,8 @@ data4: "名称,code,code1,1"
data5: "mcms_performance_verify_no,试剂性能验证单号,mcms_check_no,验收单号,mcms_dept_buy_no,请领单号,mcms_goods_chg_main_no,产品信息变更单NO,mcms_init_stock_no,期初单单号,mcms_operation_apply_no,手术申请单号,mcms_operation_notice_no,手术通知单号,mcms_pick_no,拣货单号,mcms_psi_dept_no,科室出入库单NO,mcms_psi_no,出入库单NO,mcms_pur_no,采购单号,mcms_pur_plan_no,采购计划单号"
data6: "mcms,试剂性能,check_no,收单号,dept,单,_,NO,tock_no,期初单,peration_,手术申,mcms_operation,号,no,拣货,psi,出入库单NO,mcms_psi_no,出入库单NO,mcms_pur_no,采购单号,mcms_pur_plan_no,采购计划"
data7: "20,50,100,200"
data8: "眼科,眼,科,001,jyk,1,j,k"
data9: "不存在的眼科,1眼,2科,111,jyk2"
"username": "xhs1009"
"password": "1qaz!QAZ"
......@@ -360,8 +366,17 @@ json_headers2: {
"payload57_4": {"corpId":"h0347","projectCode":"herp","templateName":"test2","channelType":7,"id":"%s","title":"test2","content":"test2","url":"","tbStatus":0,"messageType":"test1"}
"payload57_5": {"corpId":"h0347","projectCode":"herp","templateName":"test2","channelType":7,"id":"%s","title":"test2","content":"test2","url":"","tbStatus":1,"messageType":"test1"}
"payload58": {"corpId":"h0347","orgName":"","kind":1}
"payload58_1": {"corpId":"h0347","orgName":"%s","kind":1}
"payload58_2": {"queryObject":{"deptId":"%s","hosId":"h0347","goodsMfrsName":"","goodsName":"","goodsSpec":"","purModes":[]},"pageNum":1,"pageSize":50}
"payload58_3": {"queryObject":{"deptId":"%s","hosId":"h0347","goodsMfrsName":"国药集团浙江医疗器材有限公司","goodsName":"00001743","goodsSpec":"","purModes":["10"]},"pageNum":1,"pageSize":200}
"payload58_4": {"queryObject":{"deptId":"%s","hosId":"h0347","goodsMfrsName":"浙江广慈医疗器械有限公司","goodsName":"内固定钛网板系统","goodsSpec":"","purModes":["20"]},"pageNum":1,"pageSize":200}
"payload58_5": {"queryObject":{"deptId":"%s","hosId":"h0347","goodsMfrsName":"美敦力公司 Medtronic Inc.","goodsName":"指引导管","goodsSpec":"","purModes":["60"]},"pageNum":1,"pageSize":200}
"payload58_6": {"deptId":"%s","hosGoodsId":"h034700001743","grantRule":1,"purMode":10}
"payload58_7": {"deptId":"%s","hosGoodsId":"h034700001743222","grantRule":1,"purMode":10}
"payload60": {"hosId":"h0347","stockCode":"%s"}
checkDict: {"code": 0,'msg': None,'data': True}
checkDict1: {
......
院区新增:
branch_id: h0347-2915
branch_name: 东土城路院区Na1KT
branch_id: h0347-3236
branch_name: 东土城路院区iHzX2
科室信息:
dept2_id: 4ec59eddc47443378f711a457161f258
dept2_name: 二级科室002
单元包信息:
branchGoodsId: h0347-323600000010
hosGoodsId: h034700000010
......@@ -55,9 +55,9 @@
<tr width="600">
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0</td>
<td class='details-col-elapsed'>0分3</td>
<td class="details-col-elapsed">0.0%</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,9 +72,9 @@
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/o2运维管理_消息通知模板_消息类型_编辑消息类型/log.html' target='_blank'>o2运维管理_消息通知模板_消息类型_编辑消息类型</a></td>
<td class="fail">失败</td>
<td class="details-col-elapsed">3.528</td>
<td class="details-col-elapsed"><a href='../log/新增库区/log.html' target='_blank'>新增库区</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">1.488</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