Commit 1f5da97a authored by xiao-hesheng's avatar xiao-hesheng
Browse files

新增采购计划审核脚本

parent 70d2850d
# -*- encoding=utf8 -*-
from common.fileUtls import FileUtils
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,a_c9_采购计划审核_审核通过,id2297,id2297-29,sit,on
内网:a_c9_采购计划审核_审核通过
"""
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_c9_采购计划审核_审核通过
用例名称:a_c9_采购计划审核_审核通过
输入:无
输出:"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_purPlan_auditPurPlan_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_c9_采购计划审核_审核通过
# # 请求体
request_body = commonFuc().get_business_data(module, "payload18_5", Ph_id)
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)
errorCode = commonFuc().analysis_json('errorCode', data)
if code == 0 and errorCode == 0:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
# -*- encoding=utf8 -*-
from common.fileUtls import FileUtils
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,a_d0_采购计划审核_审核驳回,id2297,id2297-30,sit,on
内网:a_d0_采购计划审核_审核驳回
"""
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_d0_采购计划审核_审核驳回
用例名称:a_d0_采购计划审核_审核驳回
输入:无
输出:"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_purPlan_auditPurPlan_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_c9_采购计划审核_审核通过
# # 请求体
request_body = commonFuc().get_business_data(module, "payload18_6", Ph_id)
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)
errorCode = commonFuc().analysis_json('errorCode', data)
if code == 0 and errorCode == 0:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
# -*- encoding=utf8 -*-
from common.fileUtls import FileUtils
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,a_d1_采购计划审核_重复审核通过,id2297,id2297-31,sit,on
内网:a_d1_采购计划审核_重复审核通过
"""
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_d1_采购计划审核_重复审核通过
用例名称:a_d1_采购计划审核_重复审核通过
输入:无
输出:"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_purPlan_auditPurPlan_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_c9_采购计划审核_审核通过
# # 请求体
request_body = commonFuc().get_business_data(module, "payload18_5", Ph_id)
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)
msg = commonFuc().analysis_json('msg', result)
if code == 1401002 and msg == "采购计划单已经审核过":
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
# -*- encoding=utf8 -*-
from common.fileUtls import FileUtils
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,a_d2_采购计划审核_重复驳回,id2297,id2297-32,sit,on
内网:a_d2_采购计划审核_重复驳回
"""
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_d2_采购计划审核_重复驳回
用例名称:a_d2_采购计划审核_重复驳回
输入:无
输出:"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_purPlan_auditPurPlan_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_c9_采购计划审核_审核通过
# # 请求体
request_body = commonFuc().get_business_data(module, "payload18_5", Ph_id)
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)
msg = commonFuc().analysis_json('msg', result)
if code == 1401002 and msg == "采购计划单已经审核过":
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
......@@ -4,7 +4,7 @@
"herpService_purPlan_submitPurPlan_url": "/api/herpService/purPlan/submitPurPlan"
"herpService_purPlan_listVo_url": "/api/herpService/purPlan/listVo"
"herpService_purPlan_edit_url": "/api/herpService/purPlan/edit"
"herpService_purPlan_auditPurPlan_url": "/api/herpService/purPlan/auditPurPlan"
data1: "10,20,60"
data2: "00001986,一次性医药包-低值,一次性医药包"
......@@ -65,5 +65,8 @@ json_headers2: {
"payload18_2": {"pageNum":1,"pageSize":50,"queryObject":{"orderNo":"","hosId":"h0347","status":"10","startTime":"%s","endTime":"%s"}}
"payload18_3": {"pageNum":1,"pageSize":50,"queryObject":{"orderNo":"","recType":"%s","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_6": {"passFlag":0,"remark":"驳回","id":"%s"}
checkDict2: {"code": 0,'msg': None,'data':1}
......@@ -56,7 +56,7 @@
<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'>0分0</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/a_c7_采购计划审核_列表查询_条件查询_异常查询_根据采购计划号/log.html' target='_blank'>a_c7_采购计划审核_列表查询_条件查询_异常查询_根据采购计划号</a></td>
<td class="details-col-elapsed"><a href='../log/a_d2_采购计划审核_重复驳回/log.html' target='_blank'>a_d2_采购计划审核_重复驳回</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">1.336</td>
<td class="details-col-elapsed">0.695</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