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
624c8839
Commit
624c8839
authored
Oct 12, 2023
by
liguangyu06
Browse files
用例优化
parent
6608f64e
Changes
4
Hide whitespace changes
Inline
Side-by-side
air_case/cmdc_buyercar_list/购物车商品移除.air/购物车商品移除.py
View file @
624c8839
...
...
@@ -35,10 +35,11 @@ result = requests.post(url, json=request_body, headers=headers1)
result
=
json
.
loads
(
result
.
content
)
product_id
=
result
[
"data"
][
"list"
][
0
][
"productId"
]
price
=
result
[
"data"
][
"list"
][
0
][
"referencePrice"
]
filiale_code
=
result
[
"data"
][
"list"
][
0
][
"filialeCode"
]
# 第二步在购物车中新增商品
url1
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url2"
)
request_body1
=
commonFuc
().
get_business_data
(
module
,
"payload2"
,
product_id
,
price
)
request_body1
=
commonFuc
().
get_business_data
(
module
,
"payload2"
,
product_id
,
price
,
filiale_code
)
result1
=
requests
.
post
(
url1
,
json
=
request_body1
,
headers
=
headers
)
result1
=
json
.
loads
(
result1
.
content
)
...
...
air_case/cmdc_buyercar_list/通过Excel复制添加商品-添加成功.air/通过Excel复制添加商品-添加成功.py
View file @
624c8839
...
...
@@ -43,13 +43,13 @@ result_body_switch_website = requests.post(url_switch_website, json=request_body
# 第四步获取站点对应的商品信息
url_website_product
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url_website_product"
)
# 组装请求报文
request_body_website_product
=
commonFuc
().
get_business_data
(
module
,
"payload_website_product"
)
request_body_website_product
=
commonFuc
().
get_business_data
(
module
,
"payload_website_product
1
"
)
# 发送请求
result_body_website_product
=
requests
.
post
(
url_website_product
,
json
=
request_body_website_product
,
headers
=
headers
)
result_body_website_product
=
json
.
loads
(
result_body_website_product
.
content
)
# 获取站点的商品信息
product_code
=
result_body_website_product
[
"data"
][
"list"
][
33
][
"productcode"
]
product_code
=
result_body_website_product
[
"data"
][
"list"
][
0
][
"productcode"
]
# 第五步获取通过Excel复制添加商品
# 获取通过Excel复制添加商品接口地址
...
...
data/cmdc_buyercar_list/data
View file @
624c8839
...
...
@@ -202,7 +202,7 @@ checkDict82: {"quantity":"%s"}
#查询站点对应的商品
"url_website_product": "/product/mall/queryPcProductInfoByPage"
"payload_website_product": {"filterConditions":[],"ranking":"","searchName":"","pageNum":1,"pageSize":40,"orderBy":"","orderByType":""}
"payload_website_product1": {"searchName":"气动植皮刀"}
#通过Excel复制添加商品接口地址
"url_batch": "/product/mall/batchAddBuyerCart"
...
...
data/cmdc_frequent_purchase/data
View file @
624c8839
...
...
@@ -27,7 +27,7 @@ json_headers1: {
#查询已上架商品列表请求报文
"payload10": {"isFbList":0,"filialeCode":"00111","productName":null,"productCode":null,"specifications":null,"materialCode":null,"manufacturer":null,"lineName":null,"riskRank":null,"isRelease":"1","isExistImage":null,"jdeStatus":"P","isGift":null,"description":null,"tbsj":[],"pageNum":1,"pageSize":8,"total":3,"firstQuery":true,"flag":true,"preInvalidStatus":null,"isControlSales":"0","startTime":null,"endTime":null,"status":101}
#添加商品至购物车报文
"payload1": {"currentCompanyId":3,"productId":"
315
","quantity":1,"agreementPriceId":0,"price":
30
}
"payload1": {"currentCompanyId":3,"productId":"
%s
","quantity":1,"agreementPriceId":0,"price":
"%s"
}
#预期结果
checkDict1: {"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