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

优化脚本

No related merge requests found
Showing with 25 additions and 21 deletions
+25 -21
...@@ -18,7 +18,10 @@ case_tag:api,herp-web,p2科室管理_科室产品分配_请领模板维护_新 ...@@ -18,7 +18,10 @@ case_tag:api,herp-web,p2科室管理_科室产品分配_请领模板维护_新
from common.common_func import commonFuc from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs" module = "b2_herp3_bs"
def test1(): def test1():
""" """
场景:p2科室管理_科室产品分配_请领模板维护_新增模板 场景:p2科室管理_科室产品分配_请领模板维护_新增模板
...@@ -26,13 +29,13 @@ def test1(): ...@@ -26,13 +29,13 @@ def test1():
输入:"test" 输入:"test"
输出:"rtn_msg": {"code": 0, "msg": null, "data":51660462cb564f2e84e93d70661f3ec8} 输出:"rtn_msg": {"code": 0, "msg": null, "data":51660462cb564f2e84e93d70661f3ec8}
""" """
#内网登录 # 内网登录
username = commonFuc().get_business_data(module, "username") username = commonFuc().get_business_data(module, "username")
# # print('医院名称',username) # # print('医院名称',username)
password = commonFuc().get_business_data(module, "password") password = commonFuc().get_business_data(module, "password")
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') # print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode # 获取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) # print( token,projectCode,uxid,corpId,info)
# pro_path = commonFuc().get_pro_path() # pro_path = commonFuc().get_pro_path()
# sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\n7运维管理_消息通知模板_消息类型_获取消息模板ID.air') # sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\n7运维管理_消息通知模板_消息类型_获取消息模板ID.air')
...@@ -40,13 +43,13 @@ def test1(): ...@@ -40,13 +43,13 @@ def test1():
# from n7运维管理_消息通知模板_消息类型_获取消息模板ID import test1 # from n7运维管理_消息通知模板_消息类型_获取消息模板ID import test1
# id1= test1() # id1= test1()
# print(id1) # print(id1)
#p1科室管理_科室产品分配_产品列表查询_条件查询 # p1科室管理_科室产品分配_产品列表查询_条件查询
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "basic_goodsPurTemplate_insert_url") url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "basic_goodsPurTemplate_insert_url")
# 获取请求头信息 # 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2", headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token, 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"] # branch_id = FileUtils().r_info(module, '院区新增')["branch_id"]
# str = commonFuc().get_business_data(module, 'data3') # str = commonFuc().get_business_data(module, 'data3')
# list2 = list(str.split(",")) # list2 = list(str.split(","))
...@@ -60,24 +63,25 @@ def test1(): ...@@ -60,24 +63,25 @@ def test1():
# 请求体 # 请求体
# for i in list2: # for i in list2:
request_body = commonFuc().get_business_data(module, "payload59") request_body = commonFuc().get_business_data(module, "payload59")
# request_body='['+str(request_body)+']' # request_body='['+str(request_body)+']'
# new_request_body = request_body.replace("'", '"') # new_request_body = request_body.replace("'", '"')
# print(new_request_body) # print(new_request_body)
# import json # import json
# request_body_json = json.loads(new_request_body) # request_body_json = json.loads(new_request_body)
# # # 发送请求 # # # 发送请求
result = commonFuc().http_post(url, request_body,headers) result = commonFuc().http_post(url, request_body, headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result) print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
#断言 # 断言
# checkDict=commonFuc().get_business_data(module,'checkDict10') # checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result) # commonFuc().check_result(checkDict,result)
code=commonFuc().analysis_json('code',result) code = commonFuc().analysis_json('code', result)
data=commonFuc().analysis_json('data',result) data = commonFuc().analysis_json('data', result)
data1=commonFuc().analysis_json('data',data) data1 = commonFuc().analysis_json('data', data)
if code==0 and len(data)>=1: if code == 0 and len(data) >= 1:
commonFuc().check_text_exist(0, result) commonFuc().check_text_exist(0, result)
else: else:
commonFuc().check_text_exist('error', result) commonFuc().check_text_exist('error', result)
test1() test1()
...@@ -72,9 +72,9 @@ ...@@ -72,9 +72,9 @@
</tr> </tr>
<tr width="600"> <tr width="600">
<td class="details-col-elapsed"><a href='../log/o6科室管理_科室产品分配_添加科室产品页面_条件查询/log.html' target='_blank'>o6科室管理_科室产品分配_添加科室产品页面_条件查询</a></td> <td class="details-col-elapsed"><a href='../log/p1科室管理_科室产品分配_产品列表查询/log.html' target='_blank'>p1科室管理_科室产品分配_产品列表查询</a></td>
<td class="success">成功</td> <td class="success">成功</td>
<td class="details-col-elapsed">2.42</td> <td class="details-col-elapsed">2.128</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