Commit 624c8839 authored by liguangyu06's avatar liguangyu06
Browse files

用例优化

parent 6608f64e
......@@ -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)
......
......@@ -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_product1")
# 发送请求
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复制添加商品接口地址
......
......@@ -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"
......
......@@ -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"}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment