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-cmdc
Commits
b90ffa0f
Commit
b90ffa0f
authored
Feb 22, 2024
by
liguangyu06
Browse files
优化
parent
c9e1d1df
Changes
4
Hide whitespace changes
Inline
Side-by-side
air_case/cmdc_order_list/列表查询条件验证_红票明细列表.air/列表查询条件验证_红票明细列表.py
View file @
b90ffa0f
...
@@ -28,7 +28,7 @@ request_body = commonFuc().get_business_data(module, "payload74")
...
@@ -28,7 +28,7 @@ request_body = commonFuc().get_business_data(module, "payload74")
# 发送请求
# 发送请求
result
=
requests
.
post
(
url
,
json
=
request_body
,
headers
=
headers
)
result
=
requests
.
post
(
url
,
json
=
request_body
,
headers
=
headers
)
result
=
json
.
loads
(
result
.
content
)
result
=
json
.
loads
(
result
.
content
)
# print(result)
# 生成随机数
# 生成随机数
red_random
=
random
.
randint
(
0
,
len
(
result
[
"data"
][
"list"
])
-
1
)
red_random
=
random
.
randint
(
0
,
len
(
result
[
"data"
][
"list"
])
-
1
)
# 获取红票明细信息
# 获取红票明细信息
...
@@ -38,13 +38,15 @@ customerName = result["data"]["list"][red_random]["customerName"]
...
@@ -38,13 +38,15 @@ customerName = result["data"]["list"][red_random]["customerName"]
orderStatus
=
result
[
"data"
][
"list"
][
red_random
][
"orderStatus"
]
orderStatus
=
result
[
"data"
][
"list"
][
red_random
][
"orderStatus"
]
startTime
=
result
[
"data"
][
"list"
][
red_random
][
"auditTime"
][:
10
]
+
" 00:00:00"
startTime
=
result
[
"data"
][
"list"
][
red_random
][
"auditTime"
][:
10
]
+
" 00:00:00"
endTime
=
str
(
datetime
.
datetime
.
now
().
strftime
(
"%Y-%m-%d"
))
+
" 23:59:59"
endTime
=
str
(
datetime
.
datetime
.
now
().
strftime
(
"%Y-%m-%d"
))
+
" 23:59:59"
startTime
=
""
endTime
=
""
# 第三步进行列表查询条件验证
# 第三步进行列表查询条件验证
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url75"
)
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url75"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload75"
,
demandParentCode
,
demandCode
,
customerName
,
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload75"
,
demandParentCode
,
demandCode
,
customerName
,
orderStatus
,
orderStatus
,
startTime
,
endTime
)
startTime
,
endTime
)
# print(request_body)
"""
"""
场景: 列表查询条件验证_红票明细列表
场景: 列表查询条件验证_红票明细列表
用例名称:列表查询条件验证_红票明细列表
用例名称:列表查询条件验证_红票明细列表
...
@@ -58,6 +60,7 @@ api_time = float(result.elapsed.total_seconds())
...
@@ -58,6 +60,7 @@ api_time = float(result.elapsed.total_seconds())
# 获取查询结果中红票明细信息
# 获取查询结果中红票明细信息
result
=
json
.
loads
(
result
.
content
)
result
=
json
.
loads
(
result
.
content
)
# print(result)
result
=
{
"demandCode"
:
result
[
"data"
][
"list"
][
0
][
"demandCode"
]}
result
=
{
"demandCode"
:
result
[
"data"
][
"list"
][
0
][
"demandCode"
]}
# 将接口响应时间添加至结果中
# 将接口响应时间添加至结果中
result
[
"api_time"
]
=
api_time
result
[
"api_time"
]
=
api_time
...
...
data/cmdc_coupon/data
View file @
b90ffa0f
...
@@ -90,7 +90,7 @@ checkDict_collect_coupon4: {"success":false,"code":"500","message":"该券已抢
...
@@ -90,7 +90,7 @@ checkDict_collect_coupon4: {"success":false,"code":"500","message":"该券已抢
#后台运营管理系统登录信息(北京公司)
#后台运营管理系统登录信息(北京公司)
"username3": "Admin2"
"username3": "Admin2"
"password3": "
@
Aa123456"
"password3": "Aa123456"
#多采商城登录信息
#多采商城登录信息
"username4": "BJ1137933"
"username4": "BJ1137933"
"password4": "Aa123456"
"password4": "Aa123456"
...
...
data/cmdc_demand/data
View file @
b90ffa0f
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
#后台运营管理系统登录信息(北京)
#后台运营管理系统登录信息(北京)
"username4": "admin2"
"username4": "admin2"
"password4": "
@
Aa123456"
"password4": "Aa123456"
#后台管理系统headers
#后台管理系统headers
json_headers: {
json_headers: {
...
...
data/cmdc_demand_audit/data
View file @
b90ffa0f
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
#步骤一登录后台管理系统
#步骤一登录后台管理系统
#后台运营管理系统登录信息
#后台运营管理系统登录信息
"username": "admin2"
"username": "admin2"
"password": "
@
Aa123456"
"password": "Aa123456"
json_headers: {
json_headers: {
"Content-Type": "application/json",
"Content-Type": "application/json",
...
...
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