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
1d433ece
Commit
1d433ece
authored
Feb 28, 2024
by
liguangyu06
Browse files
优化
parent
4293bf0e
Changes
1
Hide whitespace changes
Inline
Side-by-side
air_case/cmdc_order_merge/列表查询条件验证_配货单列表获取.air/列表查询条件验证_配货单列表获取.py
View file @
1d433ece
...
@@ -41,21 +41,21 @@ def func(x):
...
@@ -41,21 +41,21 @@ def func(x):
# 生成随机数
# 生成随机数
distribution_random
=
random
.
randint
(
0
,
len
(
result
[
"data"
][
"list"
])
-
1
)
distribution_random
=
random
.
randint
(
0
,
len
(
result
[
"data"
][
"list"
])
-
1
)
# 获取配货单信息
# 获取配货单信息
distribution_id
=
result
[
"data"
][
"list"
][
distribution_random
][
"distributionId"
]
distribution_id
=
func
(
result
[
"data"
][
"list"
][
distribution_random
][
"distributionId"
]
)
demand_parent_code
=
result
[
"data"
][
"list"
][
distribution_random
][
"demandParentCode"
]
demand_parent_code
=
func
(
result
[
"data"
][
"list"
][
distribution_random
][
"demandParentCode"
]
)
demand_code
=
result
[
"data"
][
"list"
][
distribution_random
][
"demandCode"
]
demand_code
=
func
(
result
[
"data"
][
"list"
][
distribution_random
][
"demandCode"
]
)
distribution_code
=
result
[
"data"
][
"list"
][
distribution_random
][
"distributionCode"
]
distribution_code
=
func
(
result
[
"data"
][
"list"
][
distribution_random
][
"distributionCode"
]
)
customer_code
=
result
[
"data"
][
"list"
][
distribution_random
][
"customerCode"
]
customer_code
=
func
(
result
[
"data"
][
"list"
][
distribution_random
][
"customerCode"
]
)
audit_by_name
=
result
[
"data"
][
"list"
][
distribution_random
][
"auditByName"
]
audit_by_name
=
func
(
result
[
"data"
][
"list"
][
distribution_random
][
"auditByName"
]
)
product_line_name
=
result
[
"data"
][
"list"
][
distribution_random
][
"productLineName"
]
product_line_name
=
func
(
result
[
"data"
][
"list"
][
distribution_random
][
"productLineName"
]
)
distribution_status
=
result
[
"data"
][
"list"
][
distribution_random
][
"distributionStatus"
]
distribution_status
=
func
(
result
[
"data"
][
"list"
][
distribution_random
][
"distributionStatus"
]
)
push_type
=
result
[
"data"
][
"list"
][
distribution_random
][
"pushType"
]
push_type
=
func
(
result
[
"data"
][
"list"
][
distribution_random
][
"pushType"
]
)
is_merge
=
result
[
"data"
][
"list"
][
distribution_random
][
"isMerge"
]
is_merge
=
func
(
result
[
"data"
][
"list"
][
distribution_random
][
"isMerge"
]
)
merge_version_code
=
func
(
result
[
"data"
][
"list"
][
distribution_random
][
"mergeVersionCode"
])
merge_version_code
=
func
(
result
[
"data"
][
"list"
][
distribution_random
][
"mergeVersionCode"
])
out_code
=
func
(
result
[
"data"
][
"list"
][
distribution_random
][
"soCode"
])
out_code
=
func
(
result
[
"data"
][
"list"
][
distribution_random
][
"soCode"
])
promotion_type
=
func
(
result
[
"data"
][
"list"
][
distribution_random
][
"promotionType"
])
promotion_type
=
func
(
result
[
"data"
][
"list"
][
distribution_random
][
"promotionType"
])
jde_type
=
func
(
result
[
"data"
][
"list"
][
distribution_random
][
"jdeType"
])
jde_type
=
func
(
result
[
"data"
][
"list"
][
distribution_random
][
"jdeType"
])
customer_name
=
result
[
"data"
][
"list"
][
distribution_random
][
"customerName"
]
customer_name
=
func
(
result
[
"data"
][
"list"
][
distribution_random
][
"customerName"
]
)
# 第三步获取配货单详情
# 第三步获取配货单详情
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url5"
)
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url5"
)
...
@@ -66,9 +66,9 @@ result = json.loads(result.content)
...
@@ -66,9 +66,9 @@ result = json.loads(result.content)
if
result
[
"success"
]:
if
result
[
"success"
]:
# 获取商品信息
# 获取商品信息
product_random
=
random
.
randint
(
0
,
len
(
result
[
"data"
][
"distributionDetailList"
])
-
1
)
product_random
=
random
.
randint
(
0
,
len
(
result
[
"data"
][
"distributionDetailList"
])
-
1
)
productCodeList
=
result
[
"data"
][
"distributionDetailList"
][
product_random
][
"productCode"
]
productCodeList
=
func
(
result
[
"data"
][
"distributionDetailList"
][
product_random
][
"productCode"
]
)
materialCodeList
=
result
[
"data"
][
"distributionDetailList"
][
product_random
][
"materialCode"
]
materialCodeList
=
func
(
result
[
"data"
][
"distributionDetailList"
][
product_random
][
"materialCode"
]
)
optionStr
=
result
[
"data"
][
"distributionDetailList"
][
product_random
][
"optionStr"
]
optionStr
=
func
(
result
[
"data"
][
"distributionDetailList"
][
product_random
][
"optionStr"
]
)
isGroupSign
=
""
isGroupSign
=
""
# 第四步进行列表查询条件验证
# 第四步进行列表查询条件验证
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url4"
)
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url4"
)
...
@@ -77,7 +77,7 @@ if result["success"]:
...
@@ -77,7 +77,7 @@ if result["success"]:
push_type
,
productCodeList
,
materialCodeList
,
jde_type
,
is_merge
,
push_type
,
productCodeList
,
materialCodeList
,
jde_type
,
is_merge
,
optionStr
,
customer_name
,
promotion_type
,
isGroupSign
,
optionStr
,
customer_name
,
promotion_type
,
isGroupSign
,
merge_version_code
,
out_code
)
merge_version_code
,
out_code
)
#
print(request_body)
print
(
request_body
)
"""
"""
场景: 列表查询条件验证_配货单列表获取
场景: 列表查询条件验证_配货单列表获取
...
@@ -89,7 +89,7 @@ if result["success"]:
...
@@ -89,7 +89,7 @@ if result["success"]:
# 获取接口响应时间
# 获取接口响应时间
api_time
=
float
(
result
.
elapsed
.
total_seconds
())
api_time
=
float
(
result
.
elapsed
.
total_seconds
())
result
=
json
.
loads
(
result
.
content
)
result
=
json
.
loads
(
result
.
content
)
#
print(result)
print
(
result
)
# 获取结果中demandParentCode
# 获取结果中demandParentCode
result
=
{
"demandParentCode"
:
result
[
"data"
][
"list"
][
0
][
"demandParentCode"
]}
result
=
{
"demandParentCode"
:
result
[
"data"
][
"list"
][
0
][
"demandParentCode"
]}
# 将接口响应时间添加至result中
# 将接口响应时间添加至result中
...
...
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