Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
test
autotest-airtest-web-cmdc
Commits
1ac874b8
Commit
1ac874b8
authored
1 year ago
by
liguangyu06
Browse files
Options
Download
Email Patches
Plain Diff
优化
parent
592f89e1
main
master
1 merge request
!6
Master|代码更新归档
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
air_case/cmdc_order_list/列表查询条件验证_商品预测明细.air/列表查询条件验证_商品预测明细.py
+9
-9
...se/cmdc_order_list/列表查询条件验证_商品预测明细.air/列表查询条件验证_商品预测明细.py
with
9 additions
and
9 deletions
+9
-9
air_case/cmdc_order_list/列表查询条件验证_商品预测明细.air/列表查询条件验证_商品预测明细.py
+
9
-
9
View file @
1ac874b8
...
...
@@ -28,21 +28,21 @@ request_body = commonFuc().get_business_data(module, "payload83")
# 发送请求
result
=
requests
.
post
(
url
,
json
=
request_body
,
headers
=
headers
)
result
=
json
.
loads
(
result
.
content
)
print
(
result
)
# 生成随机数
pr_random
=
random
.
randint
(
0
,
len
(
result
[
"data"
])
-
1
)
pr_random
=
random
.
randint
(
0
,
len
(
result
[
"data"
]
[
"list"
]
)
-
1
)
# 获取商品信息
startTime
=
result
[
"data"
][
pr_random
][
"createTime"
][:
10
]
+
" 00:00:00"
startTime
=
result
[
"data"
][
"list"
][
pr_random
][
"createTime"
][:
10
]
+
" 00:00:00"
now_time
=
str
(
datetime
.
datetime
.
now
().
strftime
(
"%Y-%m-%d"
))
+
" 00:00:00"
productInfo
=
result
[
"data"
][
pr_random
][
"productCode"
]
customerInfo
=
result
[
"data"
][
pr_random
][
"customerCode"
]
procurementDate
=
result
[
"data"
][
pr_random
][
"procurementDate"
]
productInfo
=
result
[
"data"
][
"list"
][
pr_random
][
"productCode"
]
customerInfo
=
result
[
"data"
][
"list"
][
pr_random
][
"customerCode"
]
procurementDate
=
result
[
"data"
][
"list"
][
pr_random
][
"procurementDate"
]
# 第三步进行列表查询条件验证
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url84"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload84"
,
startTime
,
now_time
,
productInfo
,
customerInfo
,
startTime
,
now_time
,
procurementDate
)
# print(request_body)
"""
场景: 列表查询条件验证_商品预测明细
...
...
@@ -54,10 +54,10 @@ request_body = commonFuc().get_business_data(module, "payload84", startTime, now
result
=
requests
.
post
(
url
,
json
=
request_body
,
headers
=
headers
)
# 获取接口响应时间
api_time
=
float
(
result
.
elapsed
.
total_seconds
())
# print(result)
# 获取查询结果中商品信息
result
=
json
.
loads
(
result
.
content
)
result
=
{
"productInfo"
:
result
[
"data"
][
0
][
"productCode"
]}
result
=
{
"productInfo"
:
result
[
"data"
][
"list"
][
0
][
"productCode"
]}
# 将接口响应时间添加至result
result
[
"api_time"
]
=
api_time
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets