Commit 90448f1f authored by xiao-hesheng's avatar xiao-hesheng
Browse files

优化脚本

parent 0f20f91e
......@@ -17,7 +17,10 @@ case_tag:api,herp-web,e7_一键导入产品_无中心库.air,id2263,id2263-47,si
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def branch_goods_add():
"""
场景:e7_一键导入产品_无中心库.air
......@@ -25,28 +28,28 @@ def branch_goods_add():
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": 1}
"""
#内网登录
# 内网登录
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)
#e7_一键导入产品_无中心库
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "oneKeyImportGoods_url")
# e7_一键导入产品_无中心库
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "oneKeyImportGoods_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"))
#"branchId": "这里写的是一个没有创建中心库的院区编码"
commonFuc().get_business_data(module, "X-APP-CODE"))
# "branchId": "这里写的是一个没有创建中心库的院区编码"
# branch_id = FileUtils().r_info(module, '院区新增')["branch_id"]
# #请求体
request_body=commonFuc().get_business_data(module, "payload36")
request_body = commonFuc().get_business_data(module, "payload36")
print(request_body)
# # # 发送请求
result = commonFuc().http_post(url,request_body,headers)
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
# #断言
# # total=commonFuc().analysis_json('total',commonFuc().analysis_json('data',result))
......@@ -60,4 +63,5 @@ def branch_goods_add():
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
branch_goods_add()
......@@ -22,7 +22,7 @@ from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_
module = "b2_herp3_bs"
def test1():
def test1(name='东土城院区中心库房'):
"""
场景:r_b9库房管理_库区设置_库房查询_查询全部
用例名称:r_b9库房管理_库区设置_库房查询_查询全部
......@@ -84,5 +84,15 @@ def test1():
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
#增加一段根据库房名称返回id
print('data',data)
for i in data:
cname= commonFuc().analysis_json('cname', i)
print(cname)
if cname==name:
print(cname,'ccccccccccccccccccccccccccc')
id1=commonFuc().analysis_json('id', i)
print(id1)
return id1
# break
test1()
......@@ -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分6</td>
<td class='details-col-elapsed'>0分2</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/e5_导入一个产品_无中心库/log.html' target='_blank'>e5_导入一个产品_无中心库</a></td>
<td class="details-col-elapsed"><a href='../log/r_b9库房管理_库区设置_库房查询_查询全部/log.html' target='_blank'>r_b9库房管理_库区设置_库房查询_查询全部</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">6.055</td>
<td class="details-col-elapsed">2.146</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