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
790ca070
Commit
790ca070
authored
Oct 07, 2023
by
liguangyu06
Browse files
用例优化
parent
8214cb86
Changes
1
Hide whitespace changes
Inline
Side-by-side
air_case/cmdc_buyercar_list/通过Excel复制添加商品-子站点不存在.air/通过Excel复制添加商品-子站点不存在.py
View file @
790ca070
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
__author__
=
"liguangyu"
__author__
=
"liguangyu"
"""
"""
case_tag:cmdc_api,cmdc通过Excel复制添加商品-
必填字段缺失
,2252,2252-12,sit,bs
case_tag:cmdc_api,cmdc通过Excel复制添加商品-
子站点不存在
,2252,2252-12,sit,bs
主数据平台:多采商城购物车列表通过Excel复制添加商品接口
主数据平台:多采商城购物车列表通过Excel复制添加商品接口
"""
"""
...
@@ -26,7 +26,8 @@ url_batch = commonFuc().get_api_url() + commonFuc().get_business_data(module, "u
...
@@ -26,7 +26,8 @@ url_batch = commonFuc().get_api_url() + commonFuc().get_business_data(module, "u
# 随机生成不存在的公司id
# 随机生成不存在的公司id
company_id
=
random
.
randint
(
100000000000
,
10000000000000000
)
company_id
=
random
.
randint
(
100000000000
,
10000000000000000
)
# 组装请求报文
# 组装请求报文
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload23"
,
company_id
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload24"
,
company_id
)
"""
"""
场景:通过Excel复制添加商品时,站点不存在时,添加失败
场景:通过Excel复制添加商品时,站点不存在时,添加失败
用例名称:通过Excel复制添加商品时,站点不存在时,添加失败
用例名称:通过Excel复制添加商品时,站点不存在时,添加失败
...
@@ -37,7 +38,7 @@ result = requests.post(url_batch, json=request_body, headers=headers)
...
@@ -37,7 +38,7 @@ result = requests.post(url_batch, json=request_body, headers=headers)
result
=
json
.
loads
(
result
.
content
)
result
=
json
.
loads
(
result
.
content
)
print
(
result
)
print
(
result
)
# 获取预期结果
# 获取预期结果
check_dict
=
commonFuc
().
get_business_data
(
module
,
"checkDict2
3
"
)
check_dict
=
commonFuc
().
get_business_data
(
module
,
"checkDict2
4
"
)
# 断言实际结果中是否包含预期结果的内容
# 断言实际结果中是否包含预期结果的内容
commonFuc
().
check_result
(
check_dict
,
result
)
commonFuc
().
check_result
(
check_dict
,
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