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
4ddb6569
Commit
4ddb6569
authored
Mar 26, 2024
by
xiao-hesheng
Browse files
新增临采任务模块脚本
parent
16270e19
Changes
3
Hide whitespace changes
Inline
Side-by-side
air_case/b3_herp3_purchase/a_i1_临采任务_新增临采任务_新增产品页面列表查询_全部查询.air/a_i1_临采任务_新增临采任务_新增产品页面列表查询_全部查询.py
0 → 100644
View file @
4ddb6569
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_i1_临采任务_新增临采任务_新增产品页面列表查询_全部查询,id2297,id2297-81,sit,on
内网:a_i1_临采任务_新增临采任务_新增产品页面列表查询_全部查询
"""
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_i1_临采任务_新增临采任务_新增产品页面列表查询_全部查询
用例名称:a_i1_临采任务_新增临采任务_新增产品页面列表查询_全部查询
输入:无
输出:"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_basic_lcPage_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
)
# 从文件中获取院区id
branchId
=
commonFuc
().
get_business_data
(
module
,
'branchId'
)
# # #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_add(-1)
# print(date1,date2)
# a_i1_临采任务_新增临采任务_新增产品页面列表查询_全部查询
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload21"
)
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
)
pageSize
=
commonFuc
().
analysis_json
(
'pageSize'
,
data
)
if
code
==
0
and
len
(
data
)
>=
1
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
# 将三个产品明细信息存入到文件中,用于后面的精确查询和模糊查询
data1
=
commonFuc
().
analysis_json
(
'data'
,
data
)
# print(type(data1), data1)
list_a
=
[]
list_b
=
[]
list_c
=
[]
list_a
.
append
(
data1
[
0
])
list_b
.
append
(
data1
[
1
])
list_c
.
append
(
data1
[
2
])
# print('list_a', len(list_a), list_a)
info
=
(
list_a
,
list_b
,
list_c
)
titlename
=
(
'list_a'
,
'list_b'
,
'list_c'
)
# 将采购计划明细信息写入到文件中
FileUtils
().
w_info8
(
info
,
module
,
'产品明细信息'
,
titlename
,
'message4'
)
test1
()
data/b3_herp3_purchase/data
View file @
4ddb6569
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
"herpService_purchase_sendMessage_url": "/api/herpService/purchase/sendMessage"
"herpService_purchase_sendMessage_url": "/api/herpService/purchase/sendMessage"
"herpService_report_progress_page_url": "/api/herpService/report/progress/pur/page"
"herpService_report_progress_page_url": "/api/herpService/report/progress/pur/page"
"herpService_report_export_url": "/api/herpService/report/progress/pur/export"
"herpService_report_export_url": "/api/herpService/report/progress/pur/export"
"herpService_basic_lcPage_url": "/api/herpService/basic/mcmsGoodsInfo/lcPage"
data1: "10,20,60"
data1: "10,20,60"
data2: "00001986,一次性医药包-低值,一次性医药包"
data2: "00001986,一次性医药包-低值,一次性医药包"
...
@@ -128,5 +128,7 @@ json_headers2: {
...
@@ -128,5 +128,7 @@ json_headers2: {
"payload20_15": {"pageNum":1,"pageSize":50,"queryObject":{"goodsName":"%s","orderNo":"","status":[],"purPlanNo":"%s","planType":[],"purNo":"%s","branchId":"%s","targetAreaId":[],"provName":"","subProvName":"","purMode":[],"businessMode":[],"closeStatus":"","createDateStart":"%s","createDateEnd":"%s"}}
"payload20_15": {"pageNum":1,"pageSize":50,"queryObject":{"goodsName":"%s","orderNo":"","status":[],"purPlanNo":"%s","planType":[],"purNo":"%s","branchId":"%s","targetAreaId":[],"provName":"","subProvName":"","purMode":[],"businessMode":[],"closeStatus":"","createDateStart":"%s","createDateEnd":"%s"}}
"payload20_16": {"pageNum":1,"pageSize":"%s","queryObject":{"goodsName":"","orderNo":"","status":[],"purPlanNo":"","planType":[],"purNo":"","branchId":"%s","targetAreaId":[],"provName":"","subProvName":"","purMode":[],"businessMode":[],"closeStatus":"","createDateStart":"","createDateEnd":""}}
"payload20_16": {"pageNum":1,"pageSize":"%s","queryObject":{"goodsName":"","orderNo":"","status":[],"purPlanNo":"","planType":[],"purNo":"","branchId":"%s","targetAreaId":[],"provName":"","subProvName":"","purMode":[],"businessMode":[],"closeStatus":"","createDateStart":"","createDateEnd":""}}
"payload20_17": {"goodsName":"","orderNo":"","status":[],"purPlanNo":"","planType":[],"purNo":"","branchId":"%s","targetAreaId":[],"provName":"","subProvName":"","purMode":[],"businessMode":[],"closeStatus":"","createDateStart":"%s","createDateEnd":"%s"}
"payload20_17": {"goodsName":"","orderNo":"","status":[],"purPlanNo":"","planType":[],"purNo":"","branchId":"%s","targetAreaId":[],"provName":"","subProvName":"","purMode":[],"businessMode":[],"closeStatus":"","createDateStart":"%s","createDateEnd":"%s"}
"payload21": {"queryObject":{"goodsKeyword":"","goodsRegCert":"","goodsSpec":""},"pageNum":1,"pageSize":50}
checkDict2: {"code": 0,'msg': None,'data':1}
checkDict2: {"code": 0,'msg': None,'data':1}
report/summary.html
View file @
4ddb6569
...
@@ -55,9 +55,9 @@
...
@@ -55,9 +55,9 @@
<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'
>
0
</td>
<td
class=
'details-col-elapsed'
>
1
</td>
<td
class=
'details-col-elapsed'
>
0分1秒
</td>
<td
class=
'details-col-elapsed'
>
0分1秒
</td>
<td
class=
"details-col-elapsed"
>
0.0%
</td>
<td
class=
"details-col-elapsed"
>
10
0.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/a_i1_
采购计划明细_
列表查询_
导出
/log.html'
target=
'_blank'
>
a_i1_
采购计划明细_
列表查询_
导出
</a></td>
<td
class=
"details-col-elapsed"
><a
href=
'../log/a_i1_
临采任务_新增临采任务_新增产品页面
列表查询_
全部查询
/log.html'
target=
'_blank'
>
a_i1_
临采任务_新增临采任务_新增产品页面
列表查询_
全部查询
</a></td>
<td
class=
"
fail"
>
失败
</td>
<td
class=
"
success"
>
成功
</td>
<td
class=
"details-col-elapsed"
>
1.
558
</td>
<td
class=
"details-col-elapsed"
>
1.
291
</td>
<td
class=
"details-col-elapsed"
>
xiaohesheng
</td>
<td
class=
"details-col-elapsed"
>
xiaohesheng
</td>
</tr>
</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