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
dce916d8
Commit
dce916d8
authored
Feb 21, 2024
by
liguangyu06
Browse files
优化
parent
f3bce635
Changes
2
Hide whitespace changes
Inline
Side-by-side
air_case/cmdc_special_fresenius_group/新老编码替换明细导出验证.air/新老编码替换明细导出验证.py
View file @
dce916d8
...
...
@@ -36,15 +36,15 @@ dis_random = random.randint(0, len(result["data"]["list"]) - 1)
# 获取商品新老编码替换信息
group_code
=
result
[
"data"
][
"list"
][
dis_random
][
"groupCode"
]
product_code
=
result
[
"data"
][
"list"
][
dis_random
][
"products"
][
0
][
"productCode"
]
productLineName
=
result
[
"data"
][
"list"
][
dis_random
][
"productLineName"
]
# 第三步进行商品新老编码明细导出
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url60"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload60"
,
product
_cod
e
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload60"
,
product
LineNam
e
)
"""
场景: 验证商品新老编码替换列表明细导出接口联通性以及数据的正确性
用例名称:新老编码替换明细导出验证
输出:{"
groupCod
e":"%s"}
输出:{"
productLineNam
e":"%s"}
"""
# 发送请求
...
...
@@ -63,13 +63,13 @@ with open(file_path, 'wb') as f:
# 获取导出文件中子需求单
excel
=
HandleExcel
(
file_path
,
"Sheet1"
)
# print(excel.read_data())
result
=
{
"
groupCod
e"
:
excel
.
read_data
()[
0
].
get
(
"
新老编码组编号
"
)}
result
=
{
"
productLineNam
e"
:
excel
.
read_data
()[
0
].
get
(
"
产品线
"
)}
# 将接口响应时间添加至结果中
result
[
"api_time"
]
=
api_time
# 获取预期结果
check_dict
=
commonFuc
().
get_business_data
(
module
,
"checkDict60"
,
g
ro
up_cod
e
)
check_dict
=
commonFuc
().
get_business_data
(
module
,
"checkDict60"
,
p
ro
ductLineNam
e
)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc
().
check_result
(
check_dict
,
result
)
...
...
data/cmdc_special_fresenius_group/data
View file @
dce916d8
...
...
@@ -324,9 +324,9 @@ checkDict51: {"productLineCode":"%s"}
#新老编码替换明细导出验证
"url60": "/order/public/exportProductMaintainPage"
"payload60": {"groupCode":"","groupName":"","productCode":"
%s
","productInfo":"","materialCode":"","manufacturerList":[],"productLineName":"","description":"","manufacturerGroupCode":"","manufacturerGroupName":"","customerCode":"","customerName":"","manufacturerUserNo":"","manufacturerUserDesc":"","documentNo":"","groupType":2,"status":null,"pageStart":1,"pageSize":8}
"payload60": {"groupCode":"","groupName":"","productCode":"","productInfo":"","materialCode":"","manufacturerList":[],"productLineName":"
%s
","description":"","manufacturerGroupCode":"","manufacturerGroupName":"","customerCode":"","customerName":"","manufacturerUserNo":"","manufacturerUserDesc":"","documentNo":"","groupType":2,"status":null,"pageStart":1,"pageSize":8}
#预期结果
checkDict60: {"
groupCod
e":"%s"}
checkDict60: {"
productLineNam
e":"%s"}
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