Commit 16270e19 authored by xiao-hesheng's avatar xiao-hesheng
Browse files

新增采购计划明细脚本

parent 1c16afb0
# -*- encoding=utf8 -*-
from common.fileUtls import FileUtils
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,a_h9_采购计划明细_列表查询_异常查询_根据采购单号,id2297,id2297-79,sit,on
内网:a_h9_采购计划明细_列表查询_异常查询_根据采购单号
"""
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_h9_采购计划明细_列表查询_异常查询_根据采购单号
用例名称:a_h9_采购计划明细_列表查询_异常查询_根据采购单号
输入:无
输出:"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_report_progress_page_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)
# #获取日期
date1 = timeUtils().get_time_hms(2)
date2 = timeUtils().get_time_add(-30)
# print(date1,date2)
# #调用查询采购计划列表,写入采购计划id和订单号到文件中,更新文件内容
# pro_path = commonFuc().get_pro_path()
# sys.path.append(pro_path + r'\\air_case\\b3_herp3_purchase\\a_c1_采购计划审核_列表查询_全部查询.air')
# using(pro_path + r'\\air_case\\b3_herp3_purchase\\a_c1_采购计划审核_列表查询_全部查询.air')
# from a_c1_采购计划审核_列表查询_全部查询 import test1
# test1()
# 从文件中获取院区id
branchId = commonFuc().get_business_data(module, 'branchId')
# 从文件中获取产品名称
info = FileUtils().r_info8(module, "采购单信息", 'message3')
print('info', info)
list_a = info['list_a']
print('list_a', list_a)
goodsCode = 'goodsCode'
purPlanNo = 'purPlanNo'
purNo = 'purNo'
for i in list_a:
goodsCode = i['goodsCode']
purPlanNo = i['purPlanNo']
purNo = i['purNo']
break
str = commonFuc().get_business_data(module, 'data3')
list2 = list(str.split(","))
# a_h9_采购计划明细_列表查询_异常查询_根据采购单号
# # 请求体
for i in list2:
request_body = commonFuc().get_business_data(module, "payload20_15", goodsCode, purPlanNo, i, branchId, date2,
date1)
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 == 0:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
# -*- encoding=utf8 -*-
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,a_i0_采购计划明细_列表查询_分页查询,id2297,id2297-80,sit,on
内网:a_i0_采购计划明细_列表查询_分页查询
"""
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_i0_采购计划明细_列表查询_分页查询
用例名称:a_i0_采购计划明细_列表查询_分页查询
输入:无
输出:"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_report_progress_page_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, "payload20_16", 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()
......@@ -9,6 +9,8 @@
"herpService_purchase_getById_url": "/api/herpService/purchase/getById/"
"herpService_purchase_sendMessage_url": "/api/herpService/purchase/sendMessage"
"herpService_report_progress_page_url": "/api/herpService/report/progress/pur/page"
"herpService_report_export_url": "/api/herpService/report/progress/pur/export"
data1: "10,20,60"
data2: "00001986,一次性医药包-低值,一次性医药包"
......@@ -124,5 +126,7 @@ json_headers2: {
"payload20_13": {"pageNum":1,"pageSize":50,"queryObject":{"goodsName":"%s","orderNo":"","status":["%s"],"purPlanNo":"%s","planType":[],"purNo":"%s","branchId":"%s","targetOrgId":"%s",targetAreaId":["%s"],"provName":"%s","subProvName":"%s","purMode":[],"businessMode":[],"closeStatus":"","createDateStart":"%s","createDateEnd":"%s"}}
"payload20_14": {"pageNum":1,"pageSize":50,"queryObject":{"goodsName":"%s","orderNo":"","status":[],"purPlanNo":"%s","planType":[],"purNo":"%s","branchId":"%s","targetOrgId":"%s",targetAreaId":["%s"],"provName":"%s","subProvName":"%s","purMode":[],"businessMode":[],"closeStatus":"%s","createDateStart":"%s","createDateEnd":"%s"}}
"payload20_15": {"pageNum":1,"pageSize":50,"queryObject":{"goodsName":"%s","orderNo":"","status":[],"purPlanNo":"%s","planType":[],"purNo":"%s","branchId":"%s","targetAreaId":[],"provName":"","subProvName":"","purMode":[],"businessMode":[],"closeStatus":"","createDateStart":"%s","createDateEnd":"%s"}}
"payload20_16": {"pageNum":1,"pageSize":"%s","queryObject":{"goodsName":"","orderNo":"","status":[],"purPlanNo":"","planType":[],"purNo":"","branchId":"%s","targetAreaId":[],"provName":"","subProvName":"","purMode":[],"businessMode":[],"closeStatus":"","createDateStart":"","createDateEnd":""}}
"payload20_17": {"goodsName":"","orderNo":"","status":[],"purPlanNo":"","planType":[],"purNo":"","branchId":"%s","targetAreaId":[],"provName":"","subProvName":"","purMode":[],"businessMode":[],"closeStatus":"","createDateStart":"%s","createDateEnd":"%s"}
checkDict2: {"code": 0,'msg': None,'data':1}
......@@ -54,10 +54,10 @@
</tr>
<tr width="600">
<td class='details-col-elapsed'>8</td>
<td class='details-col-elapsed'>8</td>
<td class='details-col-elapsed'>0分17</td>
<td class="details-col-elapsed">100.0%</td>
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0</td>
<td class='details-col-elapsed'>0分1秒</td>
<td class="details-col-elapsed">0.0%</td>
</tr>
</table>
......@@ -72,58 +72,9 @@
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/b9_科室管理_科室登记_科室查询/log.html' target='_blank'>b9_科室管理_科室登记_科室查询</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">3.669</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">2.102</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">1.757</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/c2_新增科室后查询科室/log.html' target='_blank'>c2_新增科室后查询科室</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">1.708</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/c3_新增科室_特殊科室_二级库房/log.html' target='_blank'>c3_新增科室_特殊科室_二级库房</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">1.942</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/c4_新增科室后查询科室ID/log.html' target='_blank'>c4_新增科室后查询科室ID</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">1.713</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/c5_新增科室_特殊科室_三级库房/log.html' target='_blank'>c5_新增科室_特殊科室_三级库房</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">2.0</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/c6_新增科室_不生成库房/log.html' target='_blank'>c6_新增科室_不生成库房</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">1.985</td>
<td class="details-col-elapsed"><a href='../log/a_i1_采购计划明细_列表查询_导出/log.html' target='_blank'>a_i1_采购计划明细_列表查询_导出</a></td>
<td class="fail">失败</td>
<td class="details-col-elapsed">1.558</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