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

优化脚本

parent a59406ad
......@@ -18,7 +18,10 @@ case_tag:api,herp-web,o5科室管理_科室产品分配_添加科室产品页面
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:o5科室管理_科室产品分配_添加科室产品页面_查询全部
......@@ -27,13 +30,13 @@ def test1():
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": []}
"""
#内网登录
# 内网登录
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()
token, projectCode, uxid, corpId, info = login_system(username, password).get_token()
# print( token,projectCode,uxid,corpId,info)
# pro_path = commonFuc().get_pro_path()
# sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\n7运维管理_消息通知模板_消息类型_获取消息模板ID.air')
......@@ -41,13 +44,13 @@ def test1():
# from n7运维管理_消息通知模板_消息类型_获取消息模板ID import test1
# id1= test1()
# print(id1)
#o5科室管理_科室产品分配_添加科室产品页面_查询全部
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "basic_mcmsGoodsInfo_url")
# o5科室管理_科室产品分配_添加科室产品页面_查询全部
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "basic_mcmsGoodsInfo_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"))
commonFuc().get_business_data(module, "X-APP-CODE"))
# branch_id = FileUtils().r_info(module, '院区新增')["branch_id"]
# str = commonFuc().get_business_data(module, 'data3')
# list2 = list(str.split(","))
......@@ -59,19 +62,21 @@ def test1():
dept2_id = FileUtils().r_info(module, '科室信息')["dept2_id"]
# 请求体
request_body = commonFuc().get_business_data(module, "payload58_2",dept2_id)
request_body = commonFuc().get_business_data(module, "payload58_2", dept2_id)
# # # 发送请求
result = commonFuc().http_post(url, request_body,headers)
result = commonFuc().http_post(url, request_body, headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
#断言
# 断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code=commonFuc().analysis_json('code',result)
data=commonFuc().analysis_json('data',result)
pageSize=commonFuc().analysis_json('pageSize',data)
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
pageSize = commonFuc().analysis_json('pageSize', data)
# print(pageSize)
if code==0 and len(data)>=1:
if code == 0 and len(data) >= 1:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
......@@ -18,7 +18,10 @@ case_tag:api,herp-web,o6科室管理_科室产品分配_添加科室产品页面
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:o6科室管理_科室产品分配_添加科室产品页面_条件查询
......@@ -27,13 +30,13 @@ def test1():
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": []}
"""
#内网登录
# 内网登录
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()
token, projectCode, uxid, corpId, info = login_system(username, password).get_token()
# print( token,projectCode,uxid,corpId,info)
# pro_path = commonFuc().get_pro_path()
# sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\n7运维管理_消息通知模板_消息类型_获取消息模板ID.air')
......@@ -41,13 +44,13 @@ def test1():
# from n7运维管理_消息通知模板_消息类型_获取消息模板ID import test1
# id1= test1()
# print(id1)
#o5科室管理_科室产品分配_添加科室产品页面_查询全部
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "basic_mcmsGoodsInfo_url")
# o5科室管理_科室产品分配_添加科室产品页面_查询全部
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "basic_mcmsGoodsInfo_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"))
commonFuc().get_business_data(module, "X-APP-CODE"))
# branch_id = FileUtils().r_info(module, '院区新增')["branch_id"]
# str = commonFuc().get_business_data(module, 'data3')
# list2 = list(str.split(","))
......@@ -59,20 +62,21 @@ def test1():
dept2_id = FileUtils().r_info(module, '科室信息')["dept2_id"]
# 请求体
#低值
request_body = commonFuc().get_business_data(module, "payload58_3",dept2_id)
# 低值
request_body = commonFuc().get_business_data(module, "payload58_3", dept2_id)
# # # 发送请求
result = commonFuc().http_post(url, request_body,headers)
result = commonFuc().http_post(url, request_body, headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
#断言
# 断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code=commonFuc().analysis_json('code',result)
data=commonFuc().analysis_json('data',result)
total=commonFuc().analysis_json('total',data)
goodsName=commonFuc().analysis_json('goodsName',data)
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
total = commonFuc().analysis_json('total', data)
data = commonFuc().analysis_json('data', data)
goodsName = commonFuc().analysis_json('goodsName', data)
# print(pageSize)
if code==0 and total==1 and goodsName=="一次性使用无菌手术包":
if code == 0 and total == 1:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
......@@ -87,9 +91,10 @@ def test1():
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
total = commonFuc().analysis_json('total', data)
data = commonFuc().analysis_json('data', data)
goodsName = commonFuc().analysis_json('goodsName', data)
print('goodsName',goodsName)
if code == 0 and total >= 1 and goodsName == "内固定钛网板系统":
if code == 0 and total >= 1 :
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
......@@ -104,10 +109,13 @@ def test1():
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
total = commonFuc().analysis_json('total', data)
data = commonFuc().analysis_json('data', data)
goodsName = commonFuc().analysis_json('goodsName', data)
# print(pageSize)
if code == 0 and total >= 1 and goodsName == "指引导管":
if code == 0 and total >= 1:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
......@@ -425,7 +425,7 @@ json_headers2: {
"payload58_1": {"corpId":"h0347","orgName":"%s","kind":1}
"payload58_2": {"queryObject":{"deptId":"%s","hosId":"h0347","goodsMfrsName":"","goodsName":"","goodsSpec":"","purModes":[]},"pageNum":1,"pageSize":50}
"payload58_3": {"queryObject":{"deptId":"%s","hosId":"h0347","goodsMfrsName":"北京国瑞辉煌医疗器械有限公司","goodsName":"00001946","goodsSpec":"","purModes":["10"]},"pageNum":1,"pageSize":200}
"payload58_4": {"queryObject":{"deptId":"%s","hosId":"h0347","goodsMfrsName":"北京国瑞辉煌医疗器械有限公司","goodsName":"超声治疗仪-值","goodsSpec":"","purModes":["20"]},"pageNum":1,"pageSize":200}
"payload58_4": {"queryObject":{"deptId":"%s","hosId":"h0347","goodsMfrsName":"北京国瑞辉煌医疗器械有限公司","goodsName":"超声治疗仪-值","goodsSpec":"","purModes":["20"]},"pageNum":1,"pageSize":200}
"payload58_5": {"queryObject":{"deptId":"%s","hosId":"h0347","goodsMfrsName":"北京国瑞辉煌医疗器械有限公司","goodsName":"荧光试纸-试剂","goodsSpec":"","purModes":["60"]},"pageNum":1,"pageSize":200}
"payload58_6": {"deptId":"%s","hosGoodsId":"h034700001743","grantRule":1,"purMode":10}
"payload58_7": {"deptId":"%s","hosGoodsId":"h034700001743222","grantRule":1,"purMode":10}
......
......@@ -72,9 +72,9 @@
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/o5科室管理_科室产品分配_添加科室产品页面_查询全部/log.html' target='_blank'>o5科室管理_科室产品分配_添加科室产品页面_查询全部</a></td>
<td class="details-col-elapsed"><a href='../log/o6科室管理_科室产品分配_添加科室产品页面_条件查询/log.html' target='_blank'>o6科室管理_科室产品分配_添加科室产品页面_条件查询</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">2.526</td>
<td class="details-col-elapsed">2.42</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