Commit 0629ad3a authored by xiao-hesheng's avatar xiao-hesheng
Browse files

优化脚本

parent 9e7d45cf
...@@ -59,7 +59,7 @@ def test1(): ...@@ -59,7 +59,7 @@ def test1():
sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\r_b8库房管理_库区设置_同步库房信息.air') sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\r_b8库房管理_库区设置_同步库房信息.air')
using(pro_path + r'\\air_case\\b2_herp3_bs\\r_b8库房管理_库区设置_同步库房信息.air') using(pro_path + r'\\air_case\\b2_herp3_bs\\r_b8库房管理_库区设置_同步库房信息.air')
from r_b8库房管理_库区设置_同步库房信息 import test1 from r_b8库房管理_库区设置_同步库房信息 import test1
test1() # test1()
#查询库房id #查询库房id
pro_path = commonFuc().get_pro_path() pro_path = commonFuc().get_pro_path()
sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\r_b9库房管理_库区设置_库房查询_查询全部.air') sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\r_b9库房管理_库区设置_库房查询_查询全部.air')
......
...@@ -18,7 +18,10 @@ case_tag:api,herp-web,p3科室管理_科室产品分配_请领模板维护_新 ...@@ -18,7 +18,10 @@ case_tag:api,herp-web,p3科室管理_科室产品分配_请领模板维护_新
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():
""" """
场景:p3科室管理_科室产品分配_请领模板维护_新增模板_异常 场景:p3科室管理_科室产品分配_请领模板维护_新增模板_异常
...@@ -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)
#p3科室管理_科室产品分配_请领模板维护_新增模板_异常 # p3科室管理_科室产品分配_请领模板维护_新增模板_异常
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(","))
...@@ -59,20 +62,21 @@ def test1(): ...@@ -59,20 +62,21 @@ def test1():
# dept2_id = FileUtils().r_info(module, '科室信息')["dept2_id"] # dept2_id = FileUtils().r_info(module, '科室信息')["dept2_id"]
# 请求体 # 请求体
for i in list2: for i in list2:
request_body = commonFuc().get_business_data(module, "payload59_1",i) request_body = commonFuc().get_business_data(module, "payload59_1", i)
# # # 发送请求 # # # 发送请求
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()
...@@ -55,9 +55,9 @@ ...@@ -55,9 +55,9 @@
<tr width="600"> <tr width="600">
<td class='details-col-elapsed'>1</td> <td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0</td> <td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0分0</td> <td class='details-col-elapsed'>0分2</td>
<td class="details-col-elapsed">0.0%</td> <td class="details-col-elapsed">100.0%</td>
</tr> </tr>
</table> </table>
...@@ -72,9 +72,9 @@ ...@@ -72,9 +72,9 @@
</tr> </tr>
<tr width="600"> <tr width="600">
<td class="details-col-elapsed"><a href='../log/o7科室管理_科室产品分配_科室新增产品/log.html' target='_blank'>o7科室管理_科室产品分配_科室新增产品</a></td> <td class="details-col-elapsed"><a href='../log/r_b8库房管理_库区设置_同步库房信息/log.html' target='_blank'>r_b8库房管理_库区设置_同步库房信息</a></td>
<td class="fail">失败</td> <td class="success">成功</td>
<td class="details-col-elapsed">0.838</td> <td class="details-col-elapsed">1.947</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