Commit 8c4ee19a authored by xiao-hesheng's avatar xiao-hesheng
Browse files

新增采购计划模块脚本

parent 2b3d00ae
# -*- encoding=utf8 -*-
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,a_a2_手工采购计划_高值产品_暂存,id2297,id2297-2,sit,on
内网:a_a2_手工采购计划_高值产品_暂存
"""
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_a2_手工采购计划_高值产品_暂存
用例名称:a_a2_手工采购计划_高值产品_暂存
输入:无
输出:"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_insert_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)
# # 请求体
request_body = commonFuc().get_business_data(module, "payload_1")
print('request_body', request_body)
new_request_body = request_body.replace("'", '"')
new_request_body = new_request_body.replace("None", 'null')
# print(new_request_body)
import json
request_body_json = json.loads(new_request_body)
print('request_body_json', request_body_json)
# 发送请求
result = commonFuc().http_post(url, request_body_json, headers)
print('result', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
if code == 0 and len(data) >= 1:
commonFuc().check_text_exist(0, result)
print(data)
return data
else:
commonFuc().check_text_exist('error', result)
test1()
# -*- encoding=utf8 -*-
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,a_a3_手工采购计划_试剂产品_暂存,id2297,id2297-3,sit,on
内网:a_a3_手工采购计划_试剂产品_暂存
"""
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_a3_手工采购计划_试剂产品_暂存
用例名称:a_a3_手工采购计划_试剂产品_暂存
输入:无
输出:"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_insert_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)
# # 请求体
request_body = commonFuc().get_business_data(module, "payload_2")
print('request_body', request_body)
new_request_body = request_body.replace("'", '"')
new_request_body = new_request_body.replace("None", 'null')
# print(new_request_body)
import json
request_body_json = json.loads(new_request_body)
print('request_body_json', request_body_json)
# 发送请求
result = commonFuc().http_post(url, request_body_json, headers)
print('result', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
if code == 0 and len(data) >= 1:
commonFuc().check_text_exist(0, result)
print(data)
return data
else:
commonFuc().check_text_exist('error', result)
test1()
# -*- encoding=utf8 -*-
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,a_a4_采购计划_列表查询_查询全部,id2297,id2297-4,sit,on
内网:a_a4_采购计划_列表查询_查询全部
"""
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_a4_采购计划_列表查询_查询全部
用例名称:a_a4_采购计划_列表查询_查询全部
输入:无
输出:"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, "payload_3")
# 发送请求
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 len(data) >= 1 and total >= 0:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
"herpService_purPlan_insert_url": "/api/herpService/purPlan/insert"
"herpService_purPlan_listVoPage_url": "/api/herpService/purPlan/listVoPage"
data1: '条码,high_info,check_detail,高值打码,out_stock,goods_change_baseInfo,center_out_stock_pkg,mcms_centre_out_stock,pkg_info,mcms_dept_out_stock,barcode_common,mcms_centre_in_stock,goods_change_price,mcms_dept_in_stock,check_detail_pkg,center_out_stock_high,center_out_stock_high,high_consume,shelf_code,barcode_common_pkg,check_detail_high,balance_bill,barcode_rfid,bottle_info,验收单明细打印,产品信息变更,中心库出库单低值,医院中心库出库单,包信息,医院科室出库单,高值纸质条码打印,医院中心库入库单,产品调价,医院科室入库单,低值验收单,中心库出库单高值,高值耗材使用登记表,货位码,单元包纸质条码打印,高值验收单,结算单打印,高值RFID条码打印,单瓶码打印'
data2: 'code,医院标识,code1,code1,erpCode,JDE编码修改,GOODS_CHANGE_STATUS,产品信息变更状态,GOODS_CHARGE_COST,是否计入成本,GOODS_KIND_TYPE,产品分类类型,MFRS_KIND,企业职能,miCode,医保编码修改,NOTICE_RANGE_KIND,公告通知范围,PUR_MODE,耗材类型,YWMS,业务模式,CORP_TYPE,主体类别,PROGRAM_TYPE,程序端,GRAIN,参数粒度,ENV,发布环境,PROJECT_GROUP,系统分组,RETURN_REASON_TYPE,退货原因,NEWCPFL,新产品分类,ZZLX,企业证照类型,68FL,68器械分类,18FL,18器械分类,GOODS_START_STOP,产品启停,YYDJ,医院等级,GOODS_TEMP,产品临采,GLJB,耗材管理级别,GOODS_PURCHASE,产品是否采购,HIS_CODE_CHANGE,HIS编码修改,MI_CODE_CHANGE,医保型号修改,MI_GOODS_GG_CHANGE,医保产品规格,MI_GOODS_XH_CHANGE,医保型号修改,GOODS_CHARGE,产品是否计费,GOODS_BAR_CODE,产品管理模式,GOODS_PUR_MODE,耗材类型,GOODS_CHANGE_PRICE,产品调价类型,GOODS_BAR_CODE_STRATEGY,UDI管理策略,FOCUS_CONTROL_TYPE,重点管控分类,MANUAL_PICK_REASON,手工出库原因,RFID_LABEL_CHANGE,RFID标签管理,ALLOT_PICK_REASON,调拨出库原因,MAGRE_PICK_REASON,移库出库原因'
......@@ -39,7 +41,9 @@ json_headers2: {
"X-APP-CODE":"%s"
}
"payload": '{"purPlanDetail":[{"hosGoodsId":"h034700001977","pkgDefId":"22513b84dad7418fb445e5de02fa88f0","pkgDefName":"大包","pkgDefQty":20,"planPkgQty":0},{"hosGoodsId":"h034700001977","pkgDefId":"3c2b4432415e46c4aebb018969c3dcc0","pkgDefName":"小包","pkgDefQty":15,"planPkgQty":0},{"hosGoodsId":"h034700001977","pkgDefId":"56b010aba2e04f978e3038c0f53d910c","pkgDefName":" 包","pkgDefQty":33,"planPkgQty":800},{"hosGoodsId":"h034700001977","pkgDefId":"f8ad68aae4a5406ab04316e46bbf38bd","pkgDefName":"包2","pkgDefQty":66,"planPkgQty":0}],"hosId":"h0347","branchId":"h0347-2011","mgrCorpName":"邹城市人民医院(test)","deptName":"","deptId":"d69a68df361a4289b2262e4ef75b55a5","recOrgId":"d69a68df361a4289b2262e4ef75b55a5","recOrgName":"","areaCode":"areah03470414","areaName":"A库区","recUser":"UID-050151","recPhone":"xhs1009","recAddr":"A","remark":"","sourceType":"","createType":"SG","checkLcTaskQty":true}'
"payload_1": '{"purPlanDetail":[{"hosGoodsId":"h034700001757","pkgDefId":null,"pkgDefName":"包","pkgDefQty":1,"planPkgQty":999}],"hosId":"h0347","branchId":"h0347-2011","mgrCorpName":"邹城市人民医院(test)","deptName":"","deptId":"d69a68df361a4289b2262e4ef75b55a5","recOrgId":"d69a68df361a4289b2262e4ef75b55a5","recOrgName":"","areaCode":"areah03470414","areaName":"A库区","recUser":"UID-050151","recPhone":"xhs1009","recAddr":"A","remark":"","sourceType":"","createType":"SG","checkLcTaskQty":true}'
"payload_2": '{"purPlanDetail":[{"hosGoodsId":"h034700001859","pkgDefId":"26d93e6fecd24b6fa4bde8aeacfbf153","pkgDefName":"盒","pkgDefQty":1,"planPkgQty":888}],"hosId":"h0347","branchId":"h0347-2011","mgrCorpName":"邹城市人民医院(test)","deptName":"","deptId":"d69a68df361a4289b2262e4ef75b55a5","recOrgId":"d69a68df361a4289b2262e4ef75b55a5","recOrgName":"","areaCode":"areah03470414","areaName":"A库区","recUser":"UID-050151","recPhone":"xhs1009","recAddr":"A","remark":"","sourceType":"","createType":"SG","checkLcTaskQty":true}'
"payload_3": {"pageNum": 1,"pageSize": 50,"queryObject": {"orderNo": "","hosId": "h0347","startTime": null,"endTime": null}}
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分0</td>
<td class='details-col-elapsed'>0分1</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/a1_手工采购计划_低值产品_暂存/log.html' target='_blank'>a1_手工采购计划_低值产品_暂存</a></td>
<td class="details-col-elapsed"><a href='../log/a_a4_采购计划_列表查询_查询全部/log.html' target='_blank'>a_a4_采购计划_列表查询_查询全部</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">0.499</td>
<td class="details-col-elapsed">1.091</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