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

修改脚本适合融合环境

parent 9b8b8d52
# -*- encoding=utf8 -*-
from common.fileUtls import FileUtils
__author__ = "xiaohesheng"
"""
case_tag:api,mdm-web,a1企业登录,id2291,id2291-1,sit,on
主数据平台:a1企业登录
"""
from common.common_func import commonFuc
from air_case.mdm_login.登录外网系统.登录外网系统 import login_system
from airtest.core.api import using
import sys
def e_login():
module = "a6_mdm3_dp"
# pro_path=commonFuc().get_pro_path()
# sys.path.append(pro_path+r'\\air_case\\mdm3_pim\\a8产品新增和审核通过.air')
# using(pro_path+r'\\air_case\\mdm3_pim\\a8产品新增和审核通过.air')
# from a8产品新增和审核通过 import Enterprise_audit
# username=Enterprise_audit()
# info = FileUtils().r_info("a2_mdm3_ea", "企业信息")
# print(info)
# username = info['cname']
# print('aaaaaaaaaaaaaaaaaaaaaaaaaaa',username)
"""
场景:a1企业登录
用例名称:a1企业登录
输入:用户名,密码
输出:"rtn_msg": token
"""
#从文件中读取用户名
username=commonFuc().get_business_data(module,'username')
# print('医院名称',username)
password = commonFuc().get_business_data(module, "password")
# print(username, password)
# 获取token和projectCode
while True:
try:
token,projectCode,uxid,corpId,info= login_system(username, password).get_token()
except:
continue
else:
return token, projectCode, uxid, corpId, username
# break
e_login()
\ No newline at end of file
# -*- encoding=utf8 -*-
from common.fileUtls import FileUtils
__author__ = "xiaohesheng"
"""
case_tag:api,mdm-web,a1订单配送列表数据查询_全部,id2291,id2291-2,sit,on
主数据平台:a1订单配送列表数据查询_全部
"""
from common.common_func import commonFuc
from airtest.core.api import using
import sys
module = "a6_mdm3_dp"
def add_goods():
pro_path = commonFuc().get_pro_path()
sys.path.append(pro_path + r'\\air_case\\a6_mdm3_dp\\a1企业登录.air')
using(pro_path + r'\\air_case\\a6_mdm3_dp\\a1企业登录.air')
from a1企业登录 import e_login
token, projectCode, uxid, corpId, e_name = e_login()
# # 获取医院corpId
# sys.path.append(pro_path + r'\\air_case\\a4_mdm3_cm\\a1供货关系申请_客户类型_医院_登录_医院登录获取医院id.air')
# using(pro_path + r'\\air_case\\a4_mdm3_cm\\a1供货关系申请_客户类型_医院_登录_医院登录获取医院id.air')
# from a1供货关系申请_客户类型_医院_登录_医院登录获取医院id import h_login
# h_token, h_projectCode, h_uxid, h_corpId, h_name = h_login()
"""
场景:a1订单配送列表数据查询_全部
用例名称:a1订单配送列表数据查询_全部
输入:无
输出:"rtn_msg": 0
"""
module = "a6_mdm3_dp"
#a1订单配送列表数据查询_全部
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "purchase_page_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
goodsname = commonFuc().randomString(5)
request_body = commonFuc().get_business_data(module, "payload")
# request_body = commonFuc().get_business_data(module, "payload10_1")
# 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:
commonFuc().check_text_exist(code,result)
else:
commonFuc().check_text_exist('error', result)
add_goods()
# -*- encoding=utf8 -*-
from common.fileUtls import FileUtils
__author__ = "xiaohesheng"
"""
case_tag:api,mdm-web,a1订单配送列表数据查询_全部,id2291,id2291-2,sit,on
主数据平台:a1订单配送列表数据查询_全部
"""
from common.common_func import commonFuc
from airtest.core.api import using
import sys
module = "a6_mdm3_dp"
def add_goods():
pro_path = commonFuc().get_pro_path()
sys.path.append(pro_path + r'\\air_case\\a6_mdm3_dp\\a1企业登录.air')
using(pro_path + r'\\air_case\\a6_mdm3_dp\\a1企业登录.air')
from a1企业登录 import e_login
token, projectCode, uxid, corpId, e_name = e_login()
# # 获取医院corpId
# sys.path.append(pro_path + r'\\air_case\\a4_mdm3_cm\\a1供货关系申请_客户类型_医院_登录_医院登录获取医院id.air')
# using(pro_path + r'\\air_case\\a4_mdm3_cm\\a1供货关系申请_客户类型_医院_登录_医院登录获取医院id.air')
# from a1供货关系申请_客户类型_医院_登录_医院登录获取医院id import h_login
# h_token, h_projectCode, h_uxid, h_corpId, h_name = h_login()
"""
场景:a1订单配送列表数据查询_全部
用例名称:a1订单配送列表数据查询_全部
输入:无
输出:"rtn_msg": 0
"""
module = "a6_mdm3_dp"
#a1订单配送列表数据查询_全部
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "purchase_page_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
goodsname = commonFuc().randomString(5)
request_body = commonFuc().get_business_data(module, "payload")
# request_body = commonFuc().get_business_data(module, "payload10_1")
# 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:
commonFuc().check_text_exist(code,result)
else:
commonFuc().check_text_exist('error', result)
add_goods()
"purchase_page_url": "/test2api/hdiFusion/bill/purchase/page"
"username": "001f90380"
"password": "1qaz!QAZ"
json_contentType: "application/json"
json_headers: {
"Content-Type": "%s"
}
json_headers2: {
"Content-Type": "%s",
"token": "%s",
"X-APP-CODE":"%s"
}
"payload": {"pageNum":1,"pageSize":50,"orderBy":"last_modified desc, order_no desc","queryObject":{"dateValue":["",""],"exeProvId":"p10d95","pageType":1,"hosIdList":["h0347","h0028"],"tabIdx":"0","startDate":"","endDate":""}}
checkDict: {'code': 0, 'msg': None, 'tag': None, 'data': 0}
checkDict1: {'code': 1100000, 'msg': '暂时没有定义异码,中文描述为:审核失败', 'tag': '/mdmService:gyqx.spd.mdm.access.service.impl.Supply
ApplyBillMainServiceImpl:644', 'data': None}
checkDict2: {'code': 0, 'msg': None, 'tag': None, 'data': {'pageNum': 1, 'pageSize': 50, 'total': 0, 'data': [], 'totalInfo': None}}
checkDict3: {'code': 0, 'msg': None, 'tag': None, 'data': True}
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<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'>1</td> <td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0分11</td> <td class='details-col-elapsed'>0分3</td>
<td class="details-col-elapsed">100.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/a8产品信息审核批量_驳回/log.html' target='_blank'>a8产品信息审核批量_驳回</a></td> <td class="details-col-elapsed"><a href='../log/a1订单配送列表数据查询_全部/log.html' target='_blank'>a1订单配送列表数据查询_全部</a></td>
<td class="success">成功</td> <td class="success">成功</td>
<td class="details-col-elapsed">11.686</td> <td class="details-col-elapsed">3.142</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