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
acef7870
Commit
acef7870
authored
Jun 05, 2024
by
liguangyu06
Browse files
用例优化
parent
bf9fa052
Changes
2
Hide whitespace changes
Inline
Side-by-side
air_case/cmdc_32st/超发记录导出功能验证.air/超发记录导出功能验证.py
View file @
acef7870
...
@@ -34,16 +34,16 @@ result = json.loads(result.content)
...
@@ -34,16 +34,16 @@ result = json.loads(result.content)
# 生成随机数
# 生成随机数
flow_random
=
random
.
randint
(
0
,
len
(
result
[
"data"
][
"list"
])
-
1
)
flow_random
=
random
.
randint
(
0
,
len
(
result
[
"data"
][
"list"
])
-
1
)
# 获取超发记录信息
# 获取超发记录信息
demand
Code
=
result
[
"data"
][
"list"
][
flow_random
][
"
demand
Code"
]
customer
Code
=
result
[
"data"
][
"list"
][
flow_random
][
"
customer
Code"
]
# 第三步进行列表查询条件验证
# 第三步进行列表查询条件验证
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url16"
)
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url16"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload16"
,
demand
Code
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload16"
,
customer
Code
)
"""
"""
场景: 超发记录导出功能验证
场景: 超发记录导出功能验证
用例名称:超发记录导出功能验证
用例名称:超发记录导出功能验证
输出:{"
demand
Code":"%s"}
输出:{"
customer
Code":"%s"}
"""
"""
# 发送请求
# 发送请求
...
@@ -62,13 +62,13 @@ with open(file_path, 'wb') as f:
...
@@ -62,13 +62,13 @@ with open(file_path, 'wb') as f:
# 获取导出文件中子需求单号
# 获取导出文件中子需求单号
excel
=
HandleExcel
(
file_path
,
"Sheet1"
)
excel
=
HandleExcel
(
file_path
,
"Sheet1"
)
# print(excel.read_data())
# print(excel.read_data())
result
=
{
"
demand
Code"
:
excel
.
read_data
()[
0
].
get
(
"
子需求单号
"
)}
result
=
{
"
customer
Code"
:
excel
.
read_data
()[
0
].
get
(
"
客户名称
"
)}
# 将接口响应时间添加至结果中
# 将接口响应时间添加至结果中
result
[
"api_time"
]
=
api_time
result
[
"api_time"
]
=
api_time
# 获取预期结果
# 获取预期结果
check_dict
=
commonFuc
().
get_business_data
(
module
,
"checkDict16"
,
demand
Code
)
check_dict
=
commonFuc
().
get_business_data
(
module
,
"checkDict16"
,
customer
Code
)
# print(check_dict)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
# 断言实际结果中是否包含预期结果的内容
commonFuc
().
check_result
(
check_dict
,
result
)
commonFuc
().
check_result
(
check_dict
,
result
)
...
...
data/cmdc_32st/data
View file @
acef7870
...
@@ -75,9 +75,9 @@ checkDict15: {"productData":"%s"}
...
@@ -75,9 +75,9 @@ checkDict15: {"productData":"%s"}
#测试场景16:超发记录导出功能验证
#测试场景16:超发记录导出功能验证
"url16": "/order/public/exportStayOverflowExcel"
"url16": "/order/public/exportStayOverflowExcel"
"payload16": {"
demandCode
":"%s"}
"payload16": {"
custData
":"%s"}
#预期结果
#预期结果
checkDict16: {"
demand
Code":"%s"}
checkDict16: {"
customer
Code":"%s"}
#测试场景7:获取超发配置列表
#测试场景7:获取超发配置列表
"url7": "/order/public/supernovaList"
"url7": "/order/public/supernovaList"
...
...
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