Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
test
autotest-airtest-web-spd
Commits
6a793b0d
Commit
6a793b0d
authored
Dec 19, 2023
by
xiao-hesheng
Browse files
增加配送模块脚本
parent
a5dd39bf
Changes
7
Hide whitespace changes
Inline
Side-by-side
air_case/a6_mdm3_dp/a4订单配送列表数据查询_已完成查询.air/a4订单配送列表数据查询_已完成查询.py
0 → 100644
View file @
6a793b0d
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,mdm-web,a4订单配送列表数据查询_已完成查询,id2291,id2291-14,sit,on
主数据平台:a4订单配送列表数据查询_已完成查询
"""
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()
"""
场景:a4订单配送列表数据查询_已完成查询
用例名称:a4订单配送列表数据查询_已完成查询
输入:无
输出:"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
,
"payload5_3"
)
# 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
)
select1
()
air_case/a6_mdm3_dp/a5_1不合格补送列表数据查询.air/a5_1不合格补送列表数据查询.py
0 → 100644
View file @
6a793b0d
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,mdm-web,a5不合格补送列表数据查询,id2291,id2291-15,sit,on
主数据平台:a5不合格补送列表数据查询
"""
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()
"""
场景:a5不合格补送列表数据查询
用例名称:a5不合格补送列表数据查询
输入:无
输出:"rtn_msg": 0
"""
module
=
"a6_mdm3_dp"
#a1订单配送列表数据查询_全部
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"return_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
,
"payload5_4"
)
# 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
)
data1
=
commonFuc
().
analysis_json
(
'data'
,
data
)
id1
=
commonFuc
().
analysis_json
(
'id'
,
data1
[
0
])
purBillId
=
commonFuc
().
analysis_json
(
'purBillId'
,
data1
[
0
])
sourceId
=
commonFuc
().
analysis_json
(
'sourceId'
,
data1
[
0
])
print
(
id1
,
purBillId
,
sourceId
)
return
id1
,
purBillId
,
sourceId
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
select1
()
air_case/a6_mdm3_dp/a5_2获取待退货订单详细信息中的子表id_3_0医院.air/a5_2获取待退货订单详细信息中的子表id_3_0医院.py
0 → 100644
View file @
6a793b0d
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,mdm-web,a3获取订单详细信息中的子表id_3_0医院,id2291,id2291-16,sit,on
主数据平台:a3获取订单详细信息中的子表id_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\\a6_mdm3_dp\\a5_1不合格补送列表数据查询.air'
)
using
(
pro_path
+
r
'\\air_case\\a6_mdm3_dp\\a5_1不合格补送列表数据查询.air'
)
from
a5_1不合格补送列表数据查询
import
select1
id1
,
purBillId
,
sourceId
=
select1
()
"""
场景:a3获取订单详细信息中的子表id_3_0医院
用例名称:a3获取订单详细信息中的子表id_3_0医院
输入:无
输出:"rtn_msg": 0
"""
module
=
"a6_mdm3_dp"
#a1订单配送列表数据查询_全部
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"return_detail_url"
)
print
(
url
)
url1
=
url
+
'/'
+
str
(
id1
)
print
(
url1
)
# 获取请求头信息
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers2"
,
commonFuc
().
get_business_data
(
module
,
"json_contentType"
),
token
,
projectCode
)
# request_body = commonFuc().get_business_data(module, "payload5_5")
# print('request_body',request_body)
# 发送请求
result
=
commonFuc
().
http_get
(
url1
,
headers
)
print
(
'result'
,
result
)
#断言
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
if
code
==
0
:
commonFuc
().
check_text_exist
(
code
,
result
)
id2
=
commonFuc
().
analysis_json
(
'id'
,
data
[
0
])
print
(
id2
)
return
id1
,
purBillId
,
sourceId
,
id2
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
select1
()
air_case/a6_mdm3_dp/a5_3不合格补送_配送.air/a5_3不合格补送_配送.py
0 → 100644
View file @
6a793b0d
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,mdm-web,a5_2不合格补送_配送,id2291,id2291-17,sit,on
主数据平台:a5_2不合格补送_配送
"""
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\\a6_mdm3_dp\\a5_2获取待退货订单详细信息中的子表id_3_0医院.air'
)
using
(
pro_path
+
r
'\\air_case\\a6_mdm3_dp\\a5_2获取待退货订单详细信息中的子表id_3_0医院.air'
)
from
a5_2获取待退货订单详细信息中的子表id_3_0医院
import
select1
id1
,
purBillId
,
sourceId
,
id2
=
select1
()
"""
场景:a5_2不合格补送_配送
用例名称:a5_2不合格补送_配送
输入:无
输出:"rtn_msg": 0
"""
module
=
"a6_mdm3_dp"
#a1订单配送列表数据查询_全部
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"return_submit"
)
# 获取请求头信息
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers2"
,
commonFuc
().
get_business_data
(
module
,
"json_contentType"
),
token
,
projectCode
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload6"
,
purBillId
,
id1
,
id2
,
id2
,
id2
)
# 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)
select1
()
common/call_jmeter_script.py
View file @
6a793b0d
...
...
@@ -3,13 +3,38 @@ import os
from
common.common_func
import
commonFuc
pro_path
=
commonFuc
().
get_pro_path
()
file_path
=
pro_path
+
r
'\jmeter\内网采购订单下单.jmx'
print
(
file_path
)
def
run
():
file_path
=
pro_path
+
r
'\jmeter\内网采购订单下单.jmx'
print
(
file_path
)
cmd
=
"jmeter -n -t %s -l result.jtl
"
%
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
# run()
import
os
from
datetime
import
datetime
from
threading
import
Timer
# 定时任务
def
task
():
now
=
datetime
.
now
()
ts
=
now
.
strftime
(
"%Y-%m-%d %H:%M:%S"
)
print
(
datetime
.
now
())
a
=
os
.
system
(
"jmeter -n -t %s"
%
file_path
)
print
(
a
)
# 执行器
def
func
():
task
()
# t = Timer(60*1, func)
# t.start()
func
()
\ No newline at end of file
data/a6_mdm3_dp/data
View file @
6a793b0d
...
...
@@ -3,6 +3,9 @@
"ensure_batch_url": "/test2api/hdiFusion/bill/purchase/ensure/batch"
"detail_id_url": "/test2api/hdiFusion/bill/purchase/detail/page"
"submit_url": "/test2api/hdiFusion/bill/distr/pur/submit"
"return_url": "/test2api/hdiFusion/bill/return/page"
"return_detail_url": "/test2api/hdiFusion/bill/return/detail"
"return_submit": "/test2api/hdiFusion/bill/distr/return/submit"
"username": "001f90380"
"password": "1qaz!QAZ"
...
...
@@ -68,6 +71,10 @@ json_headers2: {
]
}
"payload5_2": {"pageNum":1,"pageSize":50,"orderBy":"","queryObject":{"id":"%s","billType":"CGD","hosVersion":3,"goodsName":"00001977"}}
"payload5_3": {"pageNum":1,"pageSize":50,"orderBy":"last_modified desc, order_no desc","queryObject":{"dateValue":["",""],"exeProvId":"p10d95","pageType":1,"hosIdList":["h0347","h0028"],"tabIdx":"3","startDate":"","endDate":""}}
"payload5_4": {"pageNum":1,"pageSize":50,"orderBy":"create_time desc","queryObject":{"dateValue":["",""],"exeProvId":"p10d95","pageType":1,"hosIdList":["h0347","h0028"],"tabIdx":"1","startDate":"","endDate":""}}
"payload5_5": {"pageNum":1,"pageSize":50,"orderBy":"create_time desc","queryObject":{"dateValue":["",""],"exeProvId":"p10d95","pageType":1,"hosIdList":["h0347","h0028"],"tabIdx":"1","startDate":"","endDate":""}}
"payload6": {"id":"","purBillId":"%s","sourceId":"%s","sourceVersion":0,"version":0,"oldId":"%s","billMode":"16","hosVersion":3,"createUser":"GYQX-SPD:user-19669","createUserName":"浙江高仰医疗","lastModifiedUser":"GYQX-SPD:user-19669","detailList":[{"sourceDetailId":"%s","hosGoodsId":"h034700002018","mdmGoodsCode":"11658195","goodsCode":"00002018","certificateCode":"鄂准药监器20231044113","pkgDefId":"a43b535a287b4ec4b55b69a4e369ba3a","provGoodsId":null,"replPkgQty":800,"settlement":1,"batchCode":"222","productDate":"2023-12-01","expdtDate":"2023-12-31","distrPkgQty":800,"disabledFlag":0,"distrQty":355200,"ext":{"ygptCode":"","transCond":"","storageCond":"2~8℃保存","erpCode":"11658195"},"edit":true,"barcodeList":[],"viewId":"%sROW0"}]}
checkDict: {'code': 0, 'msg': None, 'tag': None, 'data': 0}
checkDict1: {'code': 1100000, 'msg': '暂时没有定义异码,中文描述为:审核失败', 'tag': '/mdmService:gyqx.spd.mdm.access.service.impl.Supply
...
...
report/summary.html
View file @
6a793b0d
...
...
@@ -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分
7
秒
</td>
<td
class=
'details-col-elapsed'
>
0分
13
秒
</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/a
3采购单明细查询_3_0医院
/log.html'
target=
'_blank'
>
a
3采购单明细查询_3_0医院
</a></td>
<td
class=
"details-col-elapsed"
><a
href=
'../log/a
5_3不合格补送_配送
/log.html'
target=
'_blank'
>
a
5_3不合格补送_配送
</a></td>
<td
class=
"success"
>
成功
</td>
<td
class=
"details-col-elapsed"
>
6.978
</td>
<td
class=
"details-col-elapsed"
>
13.586
</td>
<td
class=
"details-col-elapsed"
>
xiaohesheng
</td>
</tr>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment