Commit 1df4bf0f authored by xiao-hesheng's avatar xiao-hesheng
Browse files

增加配送模块脚本

parent fb2b014d
......@@ -4,8 +4,8 @@ from common.fileUtls import FileUtils
__author__ = "xiaohesheng"
"""
case_tag:api,mdm-web,a1订单配送列表数据查询_全部,id2291,id2291-2,sit,on
主数据平台:a1订单配送列表数据查询_全部
case_tag:api,mdm-web,a1订单配送列表数据查询_待确认查询3.0医院,id2291,id2291-3,sit,on
主数据平台:a1订单配送列表数据查询_待确认查询3.0医院
"""
from common.common_func import commonFuc
......@@ -24,8 +24,8 @@ def add_goods():
# from a1供货关系申请_客户类型_医院_登录_医院登录获取医院id import h_login
# h_token, h_projectCode, h_uxid, h_corpId, h_name = h_login()
"""
场景:a1订单配送列表数据查询_全部
用例名称:a1订单配送列表数据查询_全部
场景:a1订单配送列表数据查询_待确认查询3.0医院
用例名称:a1订单配送列表数据查询_待确认查询3.0医院
输入:无
输出:"rtn_msg": 0
"""
......@@ -37,7 +37,7 @@ def add_goods():
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, "payload1_1")
# request_body = commonFuc().get_business_data(module, "payload10_1")
# print('request_body',request_body)
......
# -*- encoding=utf8 -*-
from common.fileUtls import FileUtils
__author__ = "xiaohesheng"
"""
case_tag:api,mdm-web,a1订单配送列表数据查询_待确认查询3.0医院,id2291,id2291-4,sit,on
主数据平台:a1订单配送列表数据查询_待确认查询3.0医院
"""
from common.common_func import commonFuc
from airtest.core.api import using
import sys
module = "a6_mdm3_dp"
def select1():
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订单配送列表数据查询_待确认查询3.0医院
用例名称:a1订单配送列表数据查询_待确认查询3.0医院
输入:无
输出:"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, "payload1")
# 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)
data1 = commonFuc().analysis_json('data', data)
if code==0 and total>=1:
id1=commonFuc().analysis_json('id',data1[0])
print(id1)
global_var_cname = id1
id2=commonFuc().analysis_json('id',data1[1])
print(id2)
global_var_cname = id2
commonFuc().check_text_exist(code,result)
return id1,id2
else:
commonFuc().check_text_exist('error', result)
select1()
# -*- encoding=utf8 -*-
from common.fileUtls import FileUtils
__author__ = "xiaohesheng"
"""
case_tag:api,mdm-web,a2订单配送列表数据查询_单条记录确认,id2291,id2291-5,sit,on
主数据平台:a2订单配送列表数据查询_单条记录确认
"""
from common.common_func import commonFuc
from airtest.core.api import using
import sys
module = "a6_mdm3_dp"
def test1():
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()
# # 获取医院订单 id
sys.path.append(pro_path + r'\\air_case\\a6_mdm3_dp\\a1订单配送列表数据查询_待确认查询3医院.air')
using(pro_path + r'\\air_case\\a6_mdm3_dp\\a1订单配送列表数据查询_待确认查询3医院.air')
from a1订单配送列表数据查询_待确认查询3医院 import select1
id1=select1()
"""
场景:a2订单配送列表数据查询_单条记录确认
用例名称:a2订单配送列表数据查询_单条记录确认
输入:无
输出:"rtn_msg": 0
"""
module = "a6_mdm3_dp"
#a1订单配送列表数据查询_全部
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "ensure_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
request_body = commonFuc().get_business_data(module, "payload2",id1,uxid)
# 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:
commonFuc().check_text_exist(code,result)
else:
commonFuc().check_text_exist('error', result)
test1()
# -*- encoding=utf8 -*-
import json
from common.fileUtls import FileUtils
__author__ = "xiaohesheng"
"""
case_tag:api,mdm-web,a2订单配送列表数据查询_多条记录确认,id2291,id2291-6,sit,on
主数据平台:a2订单配送列表数据查询_多条记录确认
"""
from common.common_func import commonFuc
from airtest.core.api import using
import sys
module = "a6_mdm3_dp"
def test1():
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()
# # 获取医院订单 id
sys.path.append(pro_path + r'\\air_case\\a6_mdm3_dp\\a1订单配送列表数据查询_待确认查询3医院.air')
using(pro_path + r'\\air_case\\a6_mdm3_dp\\a1订单配送列表数据查询_待确认查询3医院.air')
from a1订单配送列表数据查询_待确认查询3医院 import select1
id1,id2=select1()
"""
场景:a2订单配送列表数据查询_多条记录确认
用例名称:a2订单配送列表数据查询_多条记录确认
输入:无
输出:"rtn_msg": 0
"""
module = "a6_mdm3_dp"
#a2订单配送列表数据查询_多条记录确认
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "ensure_batch_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
request_body1 = commonFuc().get_business_data(module, "payload2_1",id1,uxid)
request_body2 = commonFuc().get_business_data(module, "payload2_2", id2, uxid)
request_body=str(request_body1)+','+str(request_body2)
request_body = "[" + str(request_body) + "]"
print(request_body)
# string = "这是一段包含'单引号'的文本"
new_request_body = request_body.replace("'", '"')
print(new_request_body)
request_body_json = json.loads(new_request_body)
# request_body = commonFuc().get_business_data(module, "payload10_1")
# print('request_body',request_body)
# 发送请求
result = commonFuc().http_post(url, request_body_json, 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:
commonFuc().check_text_exist(code,result)
else:
commonFuc().check_text_exist('error', result)
test1()
import os
from common.common_func import commonFuc
pro_path=commonFuc().get_pro_path()
def run():
file_path=pro_path+r'\jmeter\内网采购订单下单.jmx'
print(file_path)
cmd="jmeter -n -t %s -l result.jtl "%file_path
print(cmd)
os.system("cmd")
os.system(cmd)
run()
\ No newline at end of file
"purchase_page_url": "/test2api/hdiFusion/bill/purchase/page"
"ensure_url": "/test2api/hdiFusion/bill/purchase/ensure"
"ensure_batch_url": "/test2api/hdiFusion/bill/purchase/ensure/batch"
"username": "001f90380"
"password": "1qaz!QAZ"
json_contentType: "application/json"
json_headers: {
"Content-Type": "%s"
......@@ -13,8 +16,11 @@ json_headers2: {
}
"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":""}}
"payload1": {"pageNum":1,"pageSize":50,"orderBy":"last_modified desc, order_no desc","queryObject":{"dateValue":["",""],"hosId":"h0347","exeProvId":"p10d95","pageType":1,"tabIdx":"1","startDate":"","endDate":""}}
"payload1_1": {"pageNum":1,"pageSize":50,"orderBy":"last_modified desc, order_no desc","queryObject":{"dateValue":["",""],"hosId":"h0028","exeProvId":"p10d95","pageType":1,"tabIdx":"1","startDate":"","endDate":""}}
"payload2": {"id":"%s","version":0,"hosVersion":3,"userId":"%s","detailList":[]}
"payload2_1": {"id": "%s","version": 0,"hosVersion": 3,"userId": "%s"}
"payload2_2": {"id": "%s","version": 0,"hosVersion": 3,"userId": "%s"}
checkDict: {'code': 0, 'msg': None, 'tag': None, 'data': 0}
checkDict1: {'code': 1100000, 'msg': '暂时没有定义异码,中文描述为:审核失败', 'tag': '/mdmService:gyqx.spd.mdm.access.service.impl.Supply
......
This diff is collapsed.
......@@ -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分3</td>
<td class='details-col-elapsed'>0分5</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/a1订单配送列表数据查询_全部/log.html' target='_blank'>a1订单配送列表数据查询_全部</a></td>
<td class="details-col-elapsed"><a href='../log/a2订单配送列表数据查询_单条记录确认/log.html' target='_blank'>a2订单配送列表数据查询_单条记录确认</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">3.142</td>
<td class="details-col-elapsed">5.825</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