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-spd
Commits
5a975e67
Commit
5a975e67
authored
Sep 14, 2023
by
liguangyu06
Browse files
优化
parent
eba1f972
Changes
2
Hide whitespace changes
Inline
Side-by-side
air_case/cmdc_buyercar_list/获取购物车列表.air/获取购物车列表.py
View file @
5a975e67
...
...
@@ -15,7 +15,7 @@ import json
module
=
"cmdc_buyercar_list"
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url
1
"
)
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url
2
"
)
print
(
url
)
# 获取登录所需账号密码
username
=
commonFuc
().
get_business_data
(
module
,
"username"
)
...
...
@@ -25,7 +25,7 @@ cmdc_access_token = CmdcMaiiLogin(username, password).get_token()
print
(
cmdc_access_token
)
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers1"
,
cmdc_access_token
)
print
(
headers
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload
1
"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload
2
"
)
print
(
request_body
)
"""
场景:获取到登录用户对应的购物车列表
...
...
@@ -37,7 +37,7 @@ result = requests.post(url, json=request_body, headers=headers)
result
=
json
.
loads
(
result
.
content
)
print
(
result
)
# 获取预期结果
check_dict
=
commonFuc
().
get_business_data
(
module
,
"checkDict
1
"
)
check_dict
=
commonFuc
().
get_business_data
(
module
,
"checkDict
2
"
)
print
(
check_dict
)
# 断言实际结果中是否包含预期结果的内容
commonFuc
().
check_result
(
check_dict
,
result
)
air_case/cmdc_buyercar_list/购物车商品移除.air/购物车商品移除.py
View file @
5a975e67
...
...
@@ -52,8 +52,8 @@ if result_product_id == product_id:
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url3"
)
print
(
url
)
"""
场景:
添加商品至
用户购物车列表
用例名称:
添加商品至
用户购物车列表
场景:
从
用户购物车列表
移除商品
用例名称:
从
用户购物车列表
移除商品
输出:{"success":true,"code":"200","message":"OK","data":"ok"}
"""
# 发送请求
...
...
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