Commit 76b02c51 authored by xiao-hesheng's avatar xiao-hesheng
Browse files

新增采购计划明细脚本

parent 3eb8652c
# -*- encoding=utf8 -*-
from common.fileUtls import FileUtils
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,a_g2_采购计划明细_列表查询_精确查询_根据目标库房,id2297,id2297-62,sit,on
内网:a_g2_采购计划明细_列表查询_精确查询_根据目标库房
"""
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(targetOrgId='d69a68df361a4289b2262e4ef75b55a5'):
module = "b3_herp3_purchase"
"""
场景:a_g2_采购计划明细_列表查询_精确查询_根据目标库房
用例名称:a_g2_采购计划明细_列表查询_精确查询_根据目标库房
输入:无
输出:"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
# a_g2_采购计划明细_列表查询_精确查询_根据目标库房
# # 请求体
request_body = commonFuc().get_business_data(module, "payload20_7", goodsCode,purPlanNo, purNo,branchId, targetOrgId,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 == 1:
data1 = commonFuc().analysis_json('data', data)
for i in data1:
if i['goodsCode'] == goodsCode:
commonFuc().check_text_exist(0, result)
break
else:
commonFuc().check_text_exist('error', 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_g3_采购计划明细_列表查询_精确查询_根据目标库房和库区,id2297,id2297-63,sit,on
内网:a_g3_采购计划明细_列表查询_精确查询_根据目标库房和库区
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from airtest.core.api import using
import sys
module = "b3_herp3_purchase"
targetOrgId1=commonFuc().get_business_data(module,'targetOrgId')
targetAreaId1=commonFuc().get_business_data(module,'targetAreaId')
def test1(targetOrgId=targetOrgId1,targetAreaId=targetAreaId1):
module = "b3_herp3_purchase"
"""
场景:a_g3_采购计划明细_列表查询_精确查询_根据目标库房和库区
用例名称:a_g3_采购计划明细_列表查询_精确查询_根据目标库房和库区
输入:无
输出:"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
# a_g3_采购计划明细_列表查询_精确查询_根据目标库房和库区
# # 请求体
request_body = commonFuc().get_business_data(module, "payload20_8", goodsCode,purPlanNo, purNo,branchId, targetOrgId,targetAreaId,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 == 1:
data1 = commonFuc().analysis_json('data', data)
for i in data1:
if i['goodsCode'] == goodsCode:
commonFuc().check_text_exist(0, result)
break
else:
commonFuc().check_text_exist('error', 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_g4_采购计划明细_列表查询_精确查询_根据进院供应商,id2297,id2297-64,sit,on
内网:a_g4_采购计划明细_列表查询_精确查询_根据进院供应商
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from airtest.core.api import using
import sys
module = "b3_herp3_purchase"
targetOrgId1=commonFuc().get_business_data(module,'targetOrgId')
targetAreaId1=commonFuc().get_business_data(module,'targetAreaId')
def test1(targetOrgId=targetOrgId1,targetAreaId=targetAreaId1):
module = "b3_herp3_purchase"
"""
场景:a_g4_采购计划明细_列表查询_精确查询_根据进院供应商
用例名称:a_g4_采购计划明细_列表查询_精确查询_根据进院供应商
输入:无
输出:"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'
provName='provName'
for i in list_a:
goodsCode = i['goodsCode']
purPlanNo = i['purPlanNo']
purNo=i['purNo']
provName=i['provName']
break
# a_g4_采购计划明细_列表查询_精确查询_根据进院供应商
# # 请求体
request_body = commonFuc().get_business_data(module, "payload20_9", goodsCode,purPlanNo, purNo,branchId, targetOrgId,targetAreaId,provName,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 == 1:
data1 = commonFuc().analysis_json('data', data)
for i in data1:
if i['goodsCode'] == goodsCode:
commonFuc().check_text_exist(0, result)
break
else:
commonFuc().check_text_exist('error', 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_g5_采购计划明细_列表查询_精确查询_根据二级供应商,id2297,id2297-65,sit,on
内网:a_g5_采购计划明细_列表查询_精确查询_根据二级供应商
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from airtest.core.api import using
import sys
module = "b3_herp3_purchase"
targetOrgId1=commonFuc().get_business_data(module,'targetOrgId')
targetAreaId1=commonFuc().get_business_data(module,'targetAreaId')
def test1(targetOrgId=targetOrgId1,targetAreaId=targetAreaId1):
module = "b3_herp3_purchase"
"""
场景:a_g5_采购计划明细_列表查询_精确查询_根据二级供应商
用例名称:a_g5_采购计划明细_列表查询_精确查询_根据二级供应商
输入:无
输出:"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'
provName='provName'
subProvName='subProvName'
for i in list_a:
goodsCode = i['goodsCode']
purPlanNo = i['purPlanNo']
purNo=i['purNo']
provName=i['provName']
subProvName=i['subProvName']
break
# a_g5_采购计划明细_列表查询_精确查询_根据二级供应商
# # 请求体
request_body = commonFuc().get_business_data(module, "payload20_10", goodsCode,purPlanNo, purNo,branchId, targetOrgId,targetAreaId,provName,subProvName,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 == 1:
data1 = commonFuc().analysis_json('data', data)
for i in data1:
if i['goodsCode'] == goodsCode:
commonFuc().check_text_exist(0, result)
break
else:
commonFuc().check_text_exist('error', 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_g6_采购计划明细_列表查询_精确查询_根据耗材类型,id2297,id2297-66,sit,on
内网:a_g6_采购计划明细_列表查询_精确查询_根据耗材类型
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from airtest.core.api import using
import sys
module = "b3_herp3_purchase"
targetOrgId1 = commonFuc().get_business_data(module, 'targetOrgId')
targetAreaId1 = commonFuc().get_business_data(module, 'targetAreaId')
def test1(targetOrgId=targetOrgId1, targetAreaId=targetAreaId1):
module = "b3_herp3_purchase"
"""
场景:a_g6_采购计划明细_列表查询_精确查询_根据耗材类型
用例名称:a_g6_采购计划明细_列表查询_精确查询_根据耗材类型
输入:无
输出:"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'
provName = 'provName'
subProvName = 'subProvName'
for i in list_a:
goodsCode = i['goodsCode']
purPlanNo = i['purPlanNo']
purNo = i['purNo']
provName = i['provName']
subProvName = i['subProvName']
break
str = commonFuc().get_business_data(module, 'data1')
list2 = list(str.split(","))
print(list2)
# a_g6_采购计划明细_列表查询_精确查询_根据耗材类型
# # 请求体
for i in list2:
request_body = commonFuc().get_business_data(module, "payload20_11", goodsCode, purPlanNo, purNo, branchId,
targetOrgId, targetAreaId, provName, subProvName, i, 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:
data1 = commonFuc().analysis_json('data', data)
for i in data1:
if i['goodsCode'] == goodsCode:
commonFuc().check_text_exist(0, result)
break
else:
commonFuc().check_text_exist('error', 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_g7_采购计划明细_列表查询_精确查询_根据业务模式,id2297,id2297-67,sit,on
内网:a_g7_采购计划明细_列表查询_精确查询_根据业务模式
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from airtest.core.api import using
import sys
module = "b3_herp3_purchase"
targetOrgId1 = commonFuc().get_business_data(module, 'targetOrgId')
targetAreaId1 = commonFuc().get_business_data(module, 'targetAreaId')
def test1(targetOrgId=targetOrgId1, targetAreaId=targetAreaId1):
module = "b3_herp3_purchase"
"""
场景:a_g7_采购计划明细_列表查询_精确查询_根据业务模式
用例名称:a_g7_采购计划明细_列表查询_精确查询_根据业务模式
输入:无
输出:"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'
provName = 'provName'
subProvName = 'subProvName'
for i in list_a:
goodsCode = i['goodsCode']
purPlanNo = i['purPlanNo']
purNo = i['purNo']
provName = i['provName']
subProvName = i['subProvName']
break
str = commonFuc().get_business_data(module, 'businessMode')
list2 = list(str.split(","))
print(list2)
# a_g7_采购计划明细_列表查询_精确查询_根据业务模式
# # 请求体
for i in list2:
request_body = commonFuc().get_business_data(module, "payload20_12", goodsCode, purPlanNo,purNo, branchId,
targetOrgId, targetAreaId, provName, subProvName, i,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:
data1 = commonFuc().analysis_json('data', data)
for i in data1:
if i['goodsCode'] == goodsCode:
commonFuc().check_text_exist(0, result)
break
else:
commonFuc().check_text_exist('error', 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_g8_采购计划明细_列表查询_精确查询_根据明细状态,id2297,id2297-68,sit,on
内网:a_g8_采购计划明细_列表查询_精确查询_根据明细状态
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from airtest.core.api import using
import sys
module = "b3_herp3_purchase"
targetOrgId1 = commonFuc().get_business_data(module, 'targetOrgId')
targetAreaId1 = commonFuc().get_business_data(module, 'targetAreaId')
def test1(targetOrgId=targetOrgId1, targetAreaId=targetAreaId1):
module = "b3_herp3_purchase"
"""
场景:a_g8_采购计划明细_列表查询_精确查询_根据明细状态
用例名称:a_g8_采购计划明细_列表查询_精确查询_根据明细状态
输入:无
输出:"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'
provName = 'provName'
subProvName = 'subProvName'
for i in list_a:
goodsCode = i['goodsCode']
purPlanNo = i['purPlanNo']
purNo = i['purNo']
provName = i['provName']
subProvName = i['subProvName']
break
str = commonFuc().get_business_data(module, 'status')
list2 = list(str.split(","))
print(list2)
# a_g8_采购计划明细_列表查询_精确查询_根据明细状态
# # 请求体
for i in list2:
request_body = commonFuc().get_business_data(module, "payload20_13", goodsCode, purPlanNo,i,purNo, branchId,
targetOrgId, targetAreaId, provName, subProvName,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:
data1 = commonFuc().analysis_json('data', data)
for i in data1:
if i['goodsCode'] == goodsCode:
commonFuc().check_text_exist(0, result)
break
else:
commonFuc().check_text_exist('error', 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_g9_采购计划明细_列表查询_精确查询_根据关闭状态,id2297,id2297-69,sit,on
内网:a_g9_采购计划明细_列表查询_精确查询_根据关闭状态
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from airtest.core.api import using
import sys
module = "b3_herp3_purchase"
targetOrgId1 = commonFuc().get_business_data(module, 'targetOrgId')
targetAreaId1 = commonFuc().get_business_data(module, 'targetAreaId')
def test1(targetOrgId=targetOrgId1, targetAreaId=targetAreaId1):
module = "b3_herp3_purchase"
"""
场景:a_g9_采购计划明细_列表查询_精确查询_根据关闭状态
用例名称:a_g9_采购计划明细_列表查询_精确查询_根据关闭状态
输入:无
输出:"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'
provName = 'provName'
subProvName = 'subProvName'
for i in list_a:
goodsCode = i['goodsCode']
purPlanNo = i['purPlanNo']
purNo = i['purNo']
provName = i['provName']
subProvName = i['subProvName']
break
str = commonFuc().get_business_data(module, 'closeStatus')
list2 = list(str.split(","))
print(list2)
# a_g9_采购计划明细_列表查询_精确查询_根据关闭状态
# # 请求体
for i in list2:
request_body = commonFuc().get_business_data(module, "payload20_14", goodsCode, purPlanNo,purNo, branchId,
targetOrgId, targetAreaId, provName, subProvName,i,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:
data1 = commonFuc().analysis_json('data', data)
for i in data1:
if i['goodsCode'] == goodsCode:
commonFuc().check_text_exist(0, result)
break
else:
commonFuc().check_text_exist('error', result)
else:
commonFuc().check_text_exist('error', result)
test1()
...@@ -21,13 +21,18 @@ data8: "YND,YBC,HDI" ...@@ -21,13 +21,18 @@ data8: "YND,YBC,HDI"
data9: "16,10,20,25,40,60,66,67" data9: "16,10,20,25,40,60,66,67"
data10: "1,2,3,4,5" data10: "1,2,3,4,5"
data11: "0,30,40" data11: "0,30,40"
businessMode: "10,20,30"
status: "0,1,2,3,4,5"
closeStatus: "0,1"
"username": "xhs1009" "username": "xhs1009"
"password": "1qaz!QAZ" "password": "1qaz!QAZ"
"X-APP-CODE": "herp.pc" "X-APP-CODE": "herp.pc"
"branchId": "h0347-2011" "branchId": "h0347-2011"
"hospitalId": "h0347" "hospitalId": "h0347"
"targetOrgId": "d69a68df361a4289b2262e4ef75b55a5"
"targetAreaId": "areah03470414"
json_contentType: "application/json" json_contentType: "application/json"
json_headers: { json_headers: {
...@@ -110,5 +115,13 @@ json_headers2: { ...@@ -110,5 +115,13 @@ json_headers2: {
"payload20_4": {"pageNum":1,"pageSize":50,"queryObject":{"goodsName":"","orderNo":"","status":[],"purPlanNo":"","planType":["%s"],"purNo":"","branchId":"%s","targetAreaId":[],"provName":"","subProvName":"","purMode":[],"businessMode":[],"closeStatus":"","createDateStart":"","createDateEnd":""}} "payload20_4": {"pageNum":1,"pageSize":50,"queryObject":{"goodsName":"","orderNo":"","status":[],"purPlanNo":"","planType":["%s"],"purNo":"","branchId":"%s","targetAreaId":[],"provName":"","subProvName":"","purMode":[],"businessMode":[],"closeStatus":"","createDateStart":"","createDateEnd":""}}
"payload20_5": {"pageNum":1,"pageSize":50,"queryObject":{"goodsName":"","orderNo":"","status":[],"purPlanNo":"","planType":["YND","YBC","HDI"],"purNo":"","branchId":"%s","targetAreaId":[],"provName":"","subProvName":"","purMode":[],"businessMode":[],"closeStatus":"","createDateStart":"","createDateEnd":""}} "payload20_5": {"pageNum":1,"pageSize":50,"queryObject":{"goodsName":"","orderNo":"","status":[],"purPlanNo":"","planType":["YND","YBC","HDI"],"purNo":"","branchId":"%s","targetAreaId":[],"provName":"","subProvName":"","purMode":[],"businessMode":[],"closeStatus":"","createDateStart":"","createDateEnd":""}}
"payload20_6": {"pageNum":1,"pageSize":50,"queryObject":{"goodsName":"%s","orderNo":"%s","status":[],"purPlanNo":"","planType":[],"purNo":"%s","branchId":"%s","targetAreaId":[],"provName":"","subProvName":"","purMode":[],"businessMode":[],"closeStatus":"","createDateStart":"%s","createDateEnd":"%s"}} "payload20_6": {"pageNum":1,"pageSize":50,"queryObject":{"goodsName":"%s","orderNo":"%s","status":[],"purPlanNo":"","planType":[],"purNo":"%s","branchId":"%s","targetAreaId":[],"provName":"","subProvName":"","purMode":[],"businessMode":[],"closeStatus":"","createDateStart":"%s","createDateEnd":"%s"}}
"payload20_7": {"pageNum":1,"pageSize":50,"queryObject":{"goodsName":"%s","orderNo":"%s","status":[],"purPlanNo":"","planType":[],"purNo":"%s","branchId":"%s","targetOrgId":"%s",targetAreaId":[],"provName":"","subProvName":"","purMode":[],"businessMode":[],"closeStatus":"","createDateStart":"%s","createDateEnd":"%s"}}
"payload20_8": {"pageNum":1,"pageSize":50,"queryObject":{"goodsName":"%s","orderNo":"%s","status":[],"purPlanNo":"","planType":[],"purNo":"%s","branchId":"%s","targetOrgId":"%s",targetAreaId":["%s"],"provName":"","subProvName":"","purMode":[],"businessMode":[],"closeStatus":"","createDateStart":"%s","createDateEnd":"%s"}}
"payload20_9": {"pageNum":1,"pageSize":50,"queryObject":{"goodsName":"%s","orderNo":"%s","status":[],"purPlanNo":"","planType":[],"purNo":"%s","branchId":"%s","targetOrgId":"%s",targetAreaId":["%s"],"provName":"%s","subProvName":"","purMode":[],"businessMode":[],"closeStatus":"","createDateStart":"%s","createDateEnd":"%s"}}
"payload20_10": {"pageNum":1,"pageSize":50,"queryObject":{"goodsName":"%s","orderNo":"%s","status":[],"purPlanNo":"","planType":[],"purNo":"%s","branchId":"%s","targetOrgId":"%s",targetAreaId":["%s"],"provName":"%s","subProvName":"%s","purMode":[],"businessMode":[],"closeStatus":"","createDateStart":"%s","createDateEnd":"%s"}}
"payload20_11": {"pageNum":1,"pageSize":50,"queryObject":{"goodsName":"%s","orderNo":"%s","status":[],"purPlanNo":"","planType":[],"purNo":"%s","branchId":"%s","targetOrgId":"%s",targetAreaId":["%s"],"provName":"%s","subProvName":"%s","purMode":["%s"],"businessMode":[],"closeStatus":"","createDateStart":"%s","createDateEnd":"%s"}}
"payload20_12": {"pageNum":1,"pageSize":50,"queryObject":{"goodsName":"%s","orderNo":"%s","status":[],"purPlanNo":"","planType":[],"purNo":"%s","branchId":"%s","targetOrgId":"%s",targetAreaId":["%s"],"provName":"%s","subProvName":"%s","purMode":[],"businessMode":["%s"],"closeStatus":"","createDateStart":"%s","createDateEnd":"%s"}}
"payload20_13": {"pageNum":1,"pageSize":50,"queryObject":{"goodsName":"%s","orderNo":"%s","status":["%s"],"purPlanNo":"","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":"%s","status":[],"purPlanNo":"","planType":[],"purNo":"%s","branchId":"%s","targetOrgId":"%s",targetAreaId":["%s"],"provName":"%s","subProvName":"%s","purMode":[],"businessMode":[],"closeStatus":"%s","createDateStart":"%s","createDateEnd":"%s"}}
checkDict2: {"code": 0,'msg': None,'data':1} checkDict2: {"code": 0,'msg': None,'data':1}
...@@ -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_g1_采购计划明细_列表查询_精确查询_根据采购单号/log.html' target='_blank'>a_g1_采购计划明细_列表查询_精确查询_根据采购单号</a></td> <td class="details-col-elapsed"><a href='../log/a_g9_采购计划明细_列表查询_精确查询_根据关闭状态/log.html' target='_blank'>a_g9_采购计划明细_列表查询_精确查询_根据关闭状态</a></td>
<td class="success">成功</td> <td class="success">成功</td>
<td class="details-col-elapsed">1.047</td> <td class="details-col-elapsed">1.472</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