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
5735aaac
Commit
5735aaac
authored
Mar 12, 2024
by
xiao-hesheng
Browse files
新增采购计划模块脚本
parent
25f40a8f
Changes
6
Hide whitespace changes
Inline
Side-by-side
air_case/b3_herp3_purchase/a_b4_采购计划_编辑_全部关闭_并提交.air/a_b4_采购计划_编辑_全部关闭_并提交.py
View file @
5735aaac
...
...
@@ -53,8 +53,8 @@ def test1():
print
(
'resultaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
id1
=
commonFuc
().
analysis_json
(
'id'
,
data
[
0
])
id2
=
commonFuc
().
analysis_json
(
'id'
,
data
[
1
])
id3
=
commonFuc
().
analysis_json
(
'id'
,
data
[
2
])
id2
=
commonFuc
().
analysis_json
(
'id'
,
data
[
1
])
id3
=
commonFuc
().
analysis_json
(
'id'
,
data
[
2
])
# =====================================
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_purPlan_edit_url"
)
...
...
@@ -65,7 +65,7 @@ def test1():
commonFuc
().
get_business_data
(
module
,
"X-APP-CODE"
))
print
(
'headers'
,
headers
)
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload16"
,
id1
,
id2
,
id3
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload16"
,
id1
,
id2
,
id3
)
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'resultbbbbbbbbbbbbbbbbbbbb'
,
result
)
...
...
air_case/b3_herp3_purchase/a_b5_采购计划_列表查询_查询全部.air/a_b5_采购计划_列表查询_查询全部.py
View file @
5735aaac
...
...
@@ -53,7 +53,7 @@ def test1():
total
=
commonFuc
().
analysis_json
(
'total'
,
data
)
if
code
==
0
and
len
(
data
)
>=
1
and
total
>=
0
:
commonFuc
().
check_text_exist
(
0
,
result
)
return
to
ta
l
return
da
ta
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
...
...
air_case/b3_herp3_purchase/a_b6_采购计划_列表查询_条件查询_根据采购计划号查询.air/a_b6_采购计划_列表查询_条件查询_根据采购计划号查询.py
0 → 100644
View file @
5735aaac
# -*- encoding=utf8 -*-
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_b6_采购计划_列表查询_条件查询_根据采购计划号查询,id2297,id2297-16,sit,on
内网:a_b6_采购计划_列表查询_条件查询_根据采购计划号查询
"""
from
common.common_func
import
commonFuc
from
air_case.b1_herp3_login.登录内网系统.登录内网系统
import
login_system
from
airtest.core.api
import
using
import
sys
def
test1
():
module
=
"b3_herp3_purchase"
"""
场景:a_b6_采购计划_列表查询_条件查询_根据采购计划号查询
用例名称:a_b6_采购计划_列表查询_条件查询_根据采购计划号查询
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": true}
"""
# 内网登录
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
()
# print( token,projectCode,uxid,corpId,info)
#=================================
#获取采购计划单号
pro_path
=
commonFuc
().
get_pro_path
()
sys
.
path
.
append
(
pro_path
+
r
'\\air_case\\b3_herp3_purchase\\a_b5_采购计划_列表查询_查询全部.air'
)
using
(
pro_path
+
r
'\\air_case\\b3_herp3_purchase\\a_b5_采购计划_列表查询_查询全部.air'
)
from
a_b5_采购计划_列表查询_查询全部
import
test1
result1
=
test1
()
# print('result1','aaaaaaaaaaaaa',result1)
data1
=
commonFuc
().
analysis_json
(
'data'
,
result1
)
orderNo
=
commonFuc
().
analysis_json
(
'orderNo'
,
data1
[
0
])
#=================================
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_purPlan_listVoPage_url"
)
print
(
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"
))
print
(
'headers'
,
headers
)
# # #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_add(-1)
# print(date1,date2)
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload17"
,
orderNo
)
# 发送请求
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
len
(
data
)
>=
1
and
total
==
1
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
air_case/b3_herp3_purchase/a_b7_采购计划_列表查询_条件查询_根据制单时间查询.air/a_b7_采购计划_列表查询_条件查询_根据制单时间查询.py
0 → 100644
View file @
5735aaac
# -*- encoding=utf8 -*-
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_b7_采购计划_列表查询_条件查询_根据制单时间查询,id2297,id2297-17,sit,on
内网:a_b7_采购计划_列表查询_条件查询_根据制单时间查询
"""
from
common.common_func
import
commonFuc
from
air_case.b1_herp3_login.登录内网系统.登录内网系统
import
login_system
from
airtest.core.api
import
using
import
sys
def
test1
():
module
=
"b3_herp3_purchase"
"""
场景:a_b7_采购计划_列表查询_条件查询_根据制单时间查询
用例名称:a_b7_采购计划_列表查询_条件查询_根据制单时间查询
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": true}
"""
# 内网登录
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
()
# print( token,projectCode,uxid,corpId,info)
#=================================
#=================================
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_purPlan_listVoPage_url"
)
print
(
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"
))
print
(
'headers'
,
headers
)
# # #获取日期
date1
=
timeUtils
().
get_time_hms
(
2
)
date2
=
timeUtils
().
get_time_add
(
-
1
)
print
(
date1
,
date2
)
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload17_1"
,
date2
,
date1
)
# 发送请求
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
len
(
data
)
>=
1
and
total
>=
1
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
data/b3_herp3_purchase/data
View file @
5735aaac
...
...
@@ -51,5 +51,8 @@ json_headers2: {
"payload_6_2": {"queryObject":{"hosId":"h0347","branchId":"h0347-2011","goodsMfrsName":"","goodsName":"","purModes":[],"provName":"","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":"%s"}
"payload16": {"closeStatus":2,"idList":["%s","%s","%s"]}
"payload16_1": {"id":"%s","planDetailList":[{"closeStatus":2,"id":"%s","inSettlement":5,"planPkgQty":33,"pkgDefQty":333,"provId":"p000029d7","provName":"国药集团湖北分公司mQDwR7","subProvId":"p000029d7","subProvName":"国药集团湖北分公司mQDwR7","hosGoodsId":"h034700001761","purMode":10,"version":1,"pkgDefId":"0b4451f1086f4c25b5eac5bf22f45c0b","purTaskId":"7b6cf1ab43ab44fc9c1a1c81d85c5542","sourceId":null},{"closeStatus":2,"id":"%s","inSettlement":2,"planPkgQty":33,"pkgDefQty":1,"provId":"p56a4","provName":"国药集团浙江医疗器材有限公司","subProvId":"p56a4","subProvName":"国药集团浙江医疗器材有限公司","hosGoodsId":"h034700001771","purMode":20,"version":1,"pkgDefId":null,"purTaskId":null,"sourceId":null},{"closeStatus":2,"id":"%s","inSettlement":1,"planPkgQty":33,"pkgDefQty":1,"provId":"p000029d8","provName":"国药集团湖南分公司mkcQNd","subProvId":"p000029d7","subProvName":"国药集团湖北分公司mQDwR7","hosGoodsId":"h034700001859","purMode":60,"version":1,"pkgDefId":"26d93e6fecd24b6fa4bde8aeacfbf153","purTaskId":"5c85573c049141ff8df808dabc30d2b1","sourceId":null}],"tempFlag":0,"version":0,"checkLcTaskQty":true}
"payload17": {"pageNum": 1,"pageSize": 50,"queryObject": {"orderNo": "%s","hosId": "h0347","startTime": null,"endTime": null}}
"payload17_1": {"pageNum": 1,"pageSize": 50,"queryObject": {"orderNo": "","hosId": "h0347","startTime": "%s","endTime": "%s"}}
checkDict2: {"code": 0,'msg': None,'data':1}
report/summary.html
View file @
5735aaac
...
...
@@ -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分
2
秒
</td>
<td
class=
'details-col-elapsed'
>
0分
1
秒
</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_b
5
_采购计划_
编辑_全部关闭
/log.html'
target=
'_blank'
>
a_b
5
_采购计划_
编辑_全部关闭
</a></td>
<td
class=
"details-col-elapsed"
><a
href=
'../log/a_b
7
_采购计划_
列表查询_条件查询_根据制单时间查询
/log.html'
target=
'_blank'
>
a_b
7
_采购计划_
列表查询_条件查询_根据制单时间查询
</a></td>
<td
class=
"success"
>
成功
</td>
<td
class=
"details-col-elapsed"
>
2
.6
66
</td>
<td
class=
"details-col-elapsed"
>
1
.6
3
</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