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

新增采购单管理脚本

parent 5b5b0617
# -*- encoding=utf8 -*-
from common.fileUtls import FileUtils
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,a_d3_采购单管理_列表查询_全部查询,id2297,id2297-33,sit,on
内网:a_d3_采购单管理_列表查询_全部查询
"""
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_d3_采购单管理_列表查询_全部查询
用例名称:a_d3_采购单管理_列表查询_全部查询
输入:无
输出:"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_purchase_listVoPage_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(-1)
# 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号
# info = FileUtils().r_info8(module, "采购计划信息", 'message')
# print(info)
# Ph_id = info['id1']
# a_d3_采购单管理_列表查询_全部查询
# # 请求体
request_body = commonFuc().get_business_data(module, "payload19")
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 >=1:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
# 将三个采购单信息存入到文件中,用于后面的精确查询和模糊查询
data1 = commonFuc().analysis_json('data', data)
# print(type(data1), data1)
list_a = []
list_b = []
list_c = []
list_a.append(data1[0])
list_b.append(data1[1])
list_c.append(data1[2])
# 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, 'message2')
test1()
# -*- encoding=utf8 -*-
from common.fileUtls import FileUtils
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,a_d4_采购单管理_列表查询_精确查询_根据采购单号,id2297,id2297-34,sit,on
内网:a_d4_采购单管理_列表查询_精确查询_根据采购单号
"""
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_d4_采购单管理_列表查询_精确查询_根据采购单号
用例名称:a_d4_采购单管理_列表查询_精确查询_根据采购单号
输入:无
输出:"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_purchase_listVoPage_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(-1)
# 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号
# info = FileUtils().r_info8(module, "采购计划信息", 'message')
# print(info)
# Ph_id = info['id1']
#从文件提取采购单号
info = FileUtils().r_info8(module, "采购单信息", 'message2')
print('info', info)
list_a = info['list_a']
print('list_a', list_a)
orderNo = "orderNo"
for i in list_a:
orderNo = i['orderNo']
break
# a_d4_采购单管理_列表查询_精确查询_根据采购单号
# # 请求体
request_body = commonFuc().get_business_data(module, "payload19_1",orderNo)
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 ==1:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
"herpService_purPlan_listVo_url": "/api/herpService/purPlan/listVo" "herpService_purPlan_listVo_url": "/api/herpService/purPlan/listVo"
"herpService_purPlan_edit_url": "/api/herpService/purPlan/edit" "herpService_purPlan_edit_url": "/api/herpService/purPlan/edit"
"herpService_purPlan_auditPurPlan_url": "/api/herpService/purPlan/auditPurPlan" "herpService_purPlan_auditPurPlan_url": "/api/herpService/purPlan/auditPurPlan"
"herpService_purchase_listVoPage_url": "/api/herpService/purchase/listVoPage"
data1: "10,20,60" data1: "10,20,60"
data2: "00001986,一次性医药包-低值,一次性医药包" data2: "00001986,一次性医药包-低值,一次性医药包"
...@@ -69,6 +71,7 @@ json_headers2: { ...@@ -69,6 +71,7 @@ json_headers2: {
"payload18_4": {"pageNum":1,"pageSize":50,"queryObject":{"orderNo":"","recType":"","hosId":"h0347","status":"","startTime":null,"endTime":null}} "payload18_4": {"pageNum":1,"pageSize":50,"queryObject":{"orderNo":"","recType":"","hosId":"h0347","status":"","startTime":null,"endTime":null}}
"payload18_5": {"passFlag":1,"remark":"","id":"%s","version":1,"checkLcTaskQty":true} "payload18_5": {"passFlag":1,"remark":"","id":"%s","version":1,"checkLcTaskQty":true}
"payload18_6": {"passFlag":0,"remark":"驳回","id":"%s"} "payload18_6": {"passFlag":0,"remark":"驳回","id":"%s"}
"payload19": {"pageNum":1,"pageSize":50,"queryObject":{"orderNo":"","planOrderNo":"","provName":"","exeProvName":"","hosId":"h0347","createTimeStart":"","createTimeEnd":""}}
"payload19_1": {"pageNum":1,"pageSize":50,"queryObject":{"orderNo":"%s","planOrderNo":"","provName":"","exeProvName":"","hosId":"h0347","createTimeStart":"","createTimeEnd":""}}
checkDict2: {"code": 0,'msg': None,'data':1} checkDict2: {"code": 0,'msg': None,'data':1}
...@@ -55,9 +55,9 @@ ...@@ -55,9 +55,9 @@
<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'>0</td> <td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0分0秒</td> <td class='details-col-elapsed'>0分0秒</td>
<td class="details-col-elapsed">0.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/a_a3_手工采购计划_添加产品页面_列表查询_条件查询_模糊查询/log.html' target='_blank'>a_a3_手工采购计划_添加产品页面_列表查询_条件查询_模糊查询</a></td> <td class="details-col-elapsed"><a href='../log/a_d4_采购单管理_列表查询_精确查询_根据采购单号/log.html' target='_blank'>a_d4_采购单管理_列表查询_精确查询_根据采购单号</a></td>
<td class="fail">失败</td> <td class="success">成功</td>
<td class="details-col-elapsed">0.764</td> <td class="details-col-elapsed">0.839</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