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
89f0b584
Commit
89f0b584
authored
Mar 11, 2024
by
xiao-hesheng
Browse files
新增采购计划模块脚本
parent
810d60e8
Changes
4
Hide whitespace changes
Inline
Side-by-side
air_case/b3_herp3_purchase/a_a7_手工采购计划_添加产品页面_列表查询_条件查询_模糊查询.air/a_a7_手工采购计划_添加产品页面_列表查询_条件查询_模糊查询.py
View file @
89f0b584
...
...
@@ -100,7 +100,7 @@ def test1():
print
(
'list2'
,
list2
)
for
i
in
list2
:
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload_9_1"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload_9_1"
,
i
)
print
(
'request_body'
,
request_body
)
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
...
...
air_case/b3_herp3_purchase/a_a8_手工采购计划_添加产品页面_列表查询_条件查询_异常查询.air/a_a8_手工采购计划_添加产品页面_列表查询_条件查询_异常查询.py
0 → 100644
View file @
89f0b584
# -*- encoding=utf8 -*-
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_a8_手工采购计划_添加产品页面_列表查询_条件查询_异常查询,id2297,id2297-8,sit,on
内网:a_a8_手工采购计划_添加产品页面_列表查询_条件查询_异常查询
"""
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_a7_手工采购计划_添加产品页面_列表查询_条件查询_模糊查询
用例名称:a_a7_手工采购计划_添加产品页面_列表查询_条件查询_模糊查询
输入:无
输出:"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
,
"mcmsBranchGoodsInfo_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)
# 按器械注册人模糊查询
str
=
commonFuc
().
get_business_data
(
module
,
'data3'
)
list2
=
list
(
str
.
split
(
","
))
print
(
'list2'
,
list2
)
for
i
in
list2
:
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload_6_1"
,
i
)
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
==
0
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
# 按产品名称/编号/简称模糊查询
str
=
commonFuc
().
get_business_data
(
module
,
'data3'
)
list2
=
list
(
str
.
split
(
","
))
print
(
'list2'
,
list2
)
for
i
in
list2
:
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload_8_1"
,
i
)
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
==
0
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
# 按进院供应商模糊查询
str
=
commonFuc
().
get_business_data
(
module
,
'data3'
)
list2
=
list
(
str
.
split
(
","
))
print
(
'list2'
,
list2
)
for
i
in
list2
:
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload_9_2"
,
i
)
print
(
'request_body'
,
request_body
)
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'result'
,
i
,
result
)
# 断言
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
total
=
commonFuc
().
analysis_json
(
'total'
,
data
)
if
code
==
0
and
total
==
0
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
data/b3_herp3_purchase/data
View file @
89f0b584
...
...
@@ -37,6 +37,6 @@ json_headers2: {
"payload_6_1": {"queryObject":{"hosId":"h0347","branchId":"h0347-2011","goodsMfrsName":"%s","goodsName":"","purModes":["10"],"provName":"","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50}
"payload_8_1": {"queryObject":{"hosId":"h0347","branchId":"h0347-2011","goodsMfrsName":"","goodsName":"%s","purModes":["10"],"provName":"","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50}
"payload_9_1": {"queryObject":{"hosId":"h0347","branchId":"h0347-2011","goodsMfrsName":"","goodsName":"","purModes":["10"],"provName":"%s","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50}
"payload_9_2": {"queryObject":{"hosId":"h0347","branchId":"h0347-2011","goodsMfrsName":"","goodsName":"","purModes":[],"provName":"%s","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50}
checkDict2: {"code": 0,'msg': None,'data':1}
report/summary.html
View file @
89f0b584
...
...
@@ -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分
3
秒
</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_a
6
_手工采购计划_添加产品页面_列表查询_条件查询_
精确
查询/log.html'
target=
'_blank'
>
a_a
6
_手工采购计划_添加产品页面_列表查询_条件查询_
精确
查询
</a></td>
<td
class=
"details-col-elapsed"
><a
href=
'../log/a_a
7
_手工采购计划_添加产品页面_列表查询_条件查询_
模糊
查询/log.html'
target=
'_blank'
>
a_a
7
_手工采购计划_添加产品页面_列表查询_条件查询_
模糊
查询
</a></td>
<td
class=
"success"
>
成功
</td>
<td
class=
"details-col-elapsed"
>
2.175
</td>
<td
class=
"details-col-elapsed"
>
3.224
</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