Commit 38fe1fd8 authored by xiao-hesheng's avatar xiao-hesheng
Browse files

新增采购计划审核脚本

parent ca9fca31
# -*- encoding=utf8 -*-
from common.fileUtls import FileUtils
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,a_c1_采购计划审核_列表查询_全部查询,id2297,id2297-21,sit,on
内网:a_c1_采购计划审核_列表查询_全部查询
"""
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_c1_采购计划审核_列表查询_全部查询
用例名称:a_c1_采购计划审核_列表查询_全部查询
输入:无
输出:"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_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)
# # 请求体
request_body = commonFuc().get_business_data(module, "payload18")
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)
#将采购计划号写入文件中
data1=commonFuc().analysis_json('data', data)
orderNo=commonFuc().analysis_json('orderNo', data1[0])
id1=commonFuc().analysis_json('id', data1[0])
info = (orderNo, id1)
titlename = ('orderNo','id1')
FileUtils().w_info8(info, module, '采购计划信息', titlename,'message')
else:
commonFuc().check_text_exist('error', result)
test1()
......@@ -60,6 +60,6 @@ json_headers2: {
"payload17_4": {"pageNum":1,"pageSize":50,"queryObject":{"orderNo":"","recType":"%s","hosId":"h0347","status":"","startTime":null,"endTime":null}}
"payload17_5": {"pageNum":1,"pageSize":50,"queryObject":{"orderNo":"","recType":"","hosId":"h0347","status":"","startTime":null,"endTime":null}}
"payload17_6": {"pageNum":1,"pageSize":"%s","queryObject":{"orderNo":"","recType":"","hosId":"h0347","status":"","startTime":null,"endTime":null}}
"payload18": {"pageNum":1,"pageSize":50,"queryObject":{"orderNo":"","hosId":"h0347","status":"10","startTime":null,"endTime":null}}
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'>0</td>
<td class='details-col-elapsed'>0分8</td>
<td class="details-col-elapsed">0.0%</td>
<td class='details-col-elapsed'>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/r_b8库房管理_库区设置_同步库房信息/log.html' target='_blank'>r_b8库房管理_库区设置_同步库房信息</a></td>
<td class="fail">失败</td>
<td class="details-col-elapsed">8.049</td>
<td class="details-col-elapsed"><a href='../log/a_c1_采购计划审核_列表查询_全部查询/log.html' target='_blank'>a_c1_采购计划审核_列表查询_全部查询</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">0.777</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