Commit 586e9806 authored by xiao-hesheng's avatar xiao-hesheng
Browse files

新增带量采购目录脚本

parent ee6213cb
......@@ -18,7 +18,10 @@ case_tag:api,herp-web,p1科室管理_科室产品分配_产品列表查询_条
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:p1科室管理_科室产品分配_产品列表查询_条件查询
......@@ -26,13 +29,13 @@ 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()
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')
......@@ -40,13 +43,13 @@ def test1():
# from n7运维管理_消息通知模板_消息类型_获取消息模板ID import test1
# id1= test1()
# print(id1)
#p1科室管理_科室产品分配_产品列表查询_条件查询
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "basic_mcmsDeptGoodsInfo_page_url")
# p1科室管理_科室产品分配_产品列表查询_条件查询
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "basic_mcmsDeptGoodsInfo_page_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"))
commonFuc().get_business_data(module, "X-APP-CODE"))
# branch_id = FileUtils().r_info(module, '院区新增')["branch_id"]
str = commonFuc().get_business_data(module, 'data10')
list2 = list(str.split(","))
......@@ -59,55 +62,55 @@ def test1():
# dept2_id = FileUtils().r_info(module, '科室信息')["dept2_id"]
# 请求体
for i in list2:
request_body = commonFuc().get_business_data(module, "payload58_14",i)
# 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)
request_body = commonFuc().get_business_data(module, "payload58_14", i)
# 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)
hosGoodsCode =commonFuc().analysis_json('hosGoodsCode',data1)
# 断言
# 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)
hosGoodsCode = commonFuc().analysis_json('hosGoodsCode', data1)
if code==0 and len(data1)>=1 and hosGoodsCode=='00001977':
if code == 0 and len(data1) >= 1 and hosGoodsCode == '00001977':
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
#按规格型号查询
request_body = commonFuc().get_business_data(module, "payload58_15",'SSY-001')
# 按规格型号查询
request_body = commonFuc().get_business_data(module, "payload58_15", 'SSY-001')
# 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)
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)
hosGoodsCode =commonFuc().analysis_json('hosGoodsCode',data1)
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
hosGoodsCode = commonFuc().analysis_json('hosGoodsCode', data1)
if code==0 and len(data1)>=1 and hosGoodsCode=='00001977':
if code == 0 and len(data1) >= 1 and hosGoodsCode == '00001977':
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
#按耗材类型查询
# 按耗材类型查询
str = commonFuc().get_business_data(module, 'data11')
list2 = list(str.split(","))
print(list2)
for i in list2:
request_body = commonFuc().get_business_data(module, "payload58_16",i)
for i in list2:
request_body = commonFuc().get_business_data(module, "payload58_16", i)
# request_body='['+str(request_body)+']'
# new_request_body = request_body.replace("'", '"')
# print(new_request_body)
......@@ -115,7 +118,7 @@ def test1():
# request_body_json = json.loads(new_request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', '按耗材类型查询',result)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', '按耗材类型查询', result)
# 断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
......@@ -124,8 +127,10 @@ def test1():
data1 = commonFuc().analysis_json('data', data)
hosGoodsCode = commonFuc().analysis_json('hosGoodsCode', data1)
if code == 0 and len(data1) >= 1:
if code == 0 and len(data1) >= 0:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
......@@ -95,4 +95,20 @@ def test1():
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
#将待确认的单据信息写入文件中
if i=="10":
data1 = commonFuc().analysis_json('data', data)
# id1 = commonFuc().analysis_json('id', data1)
print(type(data1), data1)
list_a = []
list_b = []
list_c = []
list_a.append(data1[0])
list_b.append(data1[0])
list_c.append(data1[0])
print('list_a', len(list_a), list_a)
info = (list_a, list_b, list_c)
titlename = ('list_a', 'list_b', 'list_c')
# 将手术通知单信息写入文件中
FileUtils().w_info8(info, module, '手术通知单信息', titlename, 'message8')
test1()
# -*- encoding=utf8 -*-
from common.db.sql.sql_del_branch_info import delData
from common.fileUtls import FileUtils
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,a_n7_手术通知单_查看,id2297,id2297-137,sit,on
内网:a_n7_手术通知单_查看
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from airtest.core.api import using
import sys
def test1():
module = "b3_herp3_purchase"
"""
场景:a_n7_手术通知单_查看
用例名称:a_n7_手术通知单_查看
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": true}
"""
# 内网登录
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)
# 从文件中获取手术通知单id
info = FileUtils().r_info8(module, "手术通知单信息", 'message8')
# print('info', info)
list_a = info['list_a']
# print('list_a', list_a)
id1 = 'id1'
orderNo = 'orderNo'
for i in list_a:
id1 = i['id']
orderNo = i['orderNo']
break
# 查看统计数据接口
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "herpService_operationNotice_statistic_url")
url = url + id1
print(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"))
print('headers', headers)
# 发送请求
result = commonFuc().http_get(url, headers)
print('result', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
purAmount = commonFuc().analysis_json('purAmount', data)
if code == 0 and len(data) >= 1 and purAmount >= 0:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
# 查看详情数据接口
url = commonFuc().get_api_url() + commonFuc().get_business_data(module,
"herpService_operationNotice_getDetailById_url")
url = url + id1
print(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"))
print('headers', headers)
# 发送请求
result = commonFuc().http_get(url, headers)
print('result', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
orderNo1 = commonFuc().analysis_json('orderNo', data)
if code == 0 and len(data) >= 1 and orderNo1 == orderNo:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
# -*- encoding=utf8 -*-
from common.db.sql.sql_del_branch_info import delData
from common.fileUtls import FileUtils
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,a_n8_手术通知单_催单,id2297,id2297-138,sit,on
内网:a_n8_手术通知单_催单
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from airtest.core.api import using
import sys
def test1():
module = "b3_herp3_purchase"
"""
场景:a_n8_手术通知单_催单
用例名称:a_n8_手术通知单_催单
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": true}
"""
# 内网登录
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)
# 催单
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "herpService_operationNotice_sendMessage_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"))
print('headers', headers)
# 从文件中获取手术通知单id
info = FileUtils().r_info8(module, "手术通知单信息", 'message8')
# print('info', info)
list_a = info['list_a']
# print('list_a', list_a)
id1 = 'id1'
orderNo = 'orderNo'
createTime='createTime'
for i in list_a:
id1 = i['id']
orderNo = i['orderNo']
createTime=i['createTime']
break
#获取医院id
hospitalId=commonFuc().get_business_data(module,'hospitalId')
# 发送请求
request_body = commonFuc().get_business_data(module, "payload23_6",hospitalId,id1,createTime)
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)
if code == 0 and data== 0:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
# -*- encoding=utf8 -*-
from common.db.sql.sql_del_branch_info import delData
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,a_n9_手术通知单_列表_分页查询,id2297,id2297-139,sit,on
内网:a_n9_手术通知单_列表_分页查询
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from airtest.core.api import using
import sys
def test1():
module = "b3_herp3_purchase"
"""
场景:a_n9_手术通知单_列表_分页查询
用例名称:a_n9_手术通知单_列表_分页查询
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": true}
"""
# 内网登录
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)
#
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "herpService_operationNotice_url")
print(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"))
print('headers', headers)
# 从文件中获取院区id
branchId = commonFuc().get_business_data(module, 'branchId')
# # #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_add(-1)
# print(date1,date2)
# 分页查询
str = commonFuc().get_business_data(module, 'data6')
list2 = list(str.split(","))
print('list2', list2)
for i in list2:
# # 请求体
request_body = commonFuc().get_business_data(module, "payload23_7", i,branchId)
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)
pageSize = commonFuc().analysis_json('pageSize', data)
if code == 0 and pageSize == int(i):
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
# -*- encoding=utf8 -*-
from common.db.sql.sql_del_branch_info import delData
from common.fileUtls import FileUtils
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,a_o0_手术通知单详情页明细_分页查询,id2297,id2297-140,sit,on
内网:a_o0_手术通知单详情页明细_分页查询
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from airtest.core.api import using
import sys
def test1():
module = "b3_herp3_purchase"
"""
场景:a_o0_手术通知单详情页明细_分页查询
用例名称:a_o0_手术通知单详情页明细_分页查询
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": true}
"""
# 内网登录
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)
#
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "herpService_operationNotice_list_url")
print(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"))
print('headers', headers)
# 从文件中获取院区id
branchId = commonFuc().get_business_data(module, 'branchId')
# 从文件中获取手术通知单id
info = FileUtils().r_info8(module, "手术通知单信息", 'message8')
# print('info', info)
list_a = info['list_a']
# print('list_a', list_a)
id1 = 'id1'
orderNo = 'orderNo'
for i in list_a:
id1 = i['id']
orderNo = i['orderNo']
break
# 分页查询
str = commonFuc().get_business_data(module, 'data6')
list2 = list(str.split(","))
print('list2', list2)
for i in list2:
# # 请求体
request_body = commonFuc().get_business_data(module, "payload23_8", i,id1)
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)
pageSize = commonFuc().analysis_json('pageSize', data)
if code == 0 and pageSize == int(i):
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
......@@ -302,8 +302,8 @@ class CustomAirTestCase(AirtestCase):
def delWithLogToReportByDevice(self, script_list, device):
"""
根据日志信息产出报告,一个设备出一份日志
:param workspace:
根据日志信息产出报告,一
:param workspace:个设备出一份日志
:param script_list:
:param log_path:
:param device:
......
......@@ -25,6 +25,10 @@
"herpService_vbp_Close_url": "/api/herpService/vbp/close"
"herpService_vbp_getById_url": "/api/herpService/vbp/getById/"
"herpService_operationNotice_url": "/api/herpService/operationNotice/listPage"
"herpService_operationNotice_statistic_url": "/api/herpService/operationNotice/statistic?pid="
"herpService_operationNotice_getDetailById_url": "/api/herpService/operationNotice/getDetailById?pid="
"herpService_operationNotice_sendMessage_url": "/api/herpService/operationNotice/sendMessage"
"herpService_operationNotice_list_url": "/api/herpService/operationNotice/list"
data1: "10,20,60"
......@@ -184,5 +188,8 @@ json_headers2: {
"payload23_3": {"pageNum":1,"pageSize":50,"queryObject":{"orderNo":"%s","provName":"%s","sourceOrderNo":"%s","fillerDateStart":"%s","fillerDateEnd":"%s","branchId":"%s"}}
"payload23_4": {"pageNum":1,"pageSize":50,"queryObject":{"orderNo":"%s","provName":"%s","sourceOrderNo":"%s","status":"%s","fillerDateStart":"%s","fillerDateEnd":"%s","branchId":"%s"}}
"payload23_5": {"pageNum":1,"pageSize":50,"queryObject":{"orderNo":"","provName":"","sourceOrderNo":"","status":"%s","fillerDateStart":"","fillerDateEnd":"","branchId":"%s"}}
"payload23_6": {"hosId":"%s","id":"%s","message":"尊敬的供应商您好,我院于%s向贵司发送手术通知单,请尽快配送!!","provId":"p10d95"}
"payload23_7": {"pageNum":1,"pageSize":"%s","queryObject":{"orderNo":"","provName":"","sourceOrderNo":"","fillerDateStart":"","fillerDateEnd":"","branchId":"%s"}}
"payload23_8": {"pageNum":1,"pageSize":"%s","queryObject":"%s"}
checkDict2: {"code": 0,'msg': None,'data':1}
......@@ -55,9 +55,9 @@
<tr width="600">
<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>
<td class='details-col-elapsed'>0</td>
<td class='details-col-elapsed'>0分2</td>
<td class="details-col-elapsed">0.0%</td>
</tr>
</table>
......@@ -72,9 +72,9 @@
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a_n6_手术通知单_列表查询_条件查询__异常查询_制单时间/log.html' target='_blank'>a_n6_手术通知单_列表查询_条件查询__异常查询_制单时间</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">1.493</td>
<td class="details-col-elapsed"><a href='../log/q7科室管理_科室产品分配_请领模板维护_移除产品/log.html' target='_blank'>q7科室管理_科室产品分配_请领模板维护_移除产品</a></td>
<td class="fail">失败</td>
<td class="details-col-elapsed">2.586</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