Commit 520ac2b3 authored by liguangyu06's avatar liguangyu06
Browse files

用例优化

parent dc7ad43c
......@@ -23,17 +23,17 @@ headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_toke
# 第二步套包协议价查询
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url3")
request_body = commonFuc().get_business_data(module, "payload49")
request_body = commonFuc().get_business_data(module, "payload49_1")
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
result = json.loads(result.content)
# print(result)
# 获取商品信息
product_code = result["data"]["list"][0]["products"][0]["productCode"]
company_code = result["data"]["list"][0]["companyCode"]
document_no = result["data"]["list"][0]["documentNo"]
group_price = result["data"]["list"][0]["groupPrice"]
print(product_code)
# print(product_code)
# 第三步登录多采商城获取token信息
# 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username")
......@@ -61,10 +61,10 @@ request_body = commonFuc().get_business_data(module, "payload47", product_code,
# 发送请求
result = requests.get(url, params=request_body, headers=headers)
result = json.loads(result.content)
print(result)
# print(result)
# 获取商品详情页中套包正价信息
result = {"groupPrice": result["data"][1]["groupPrice"], "documentNo": result["data"][1]["documentNo"]}
print(result)
# print(result)
# # 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict48", group_price, document_no)
# # 断言实际结果中是否包含预期结果的内容
......
......@@ -302,6 +302,7 @@ checkDict47: {"groupPrice":"%s","groupName":"%s"}
checkDict48: {"groupPrice":"%s","documentNo":"%s"}
#查询指定套包协议特价信息
"payload49": {"groupCode":"","groupName":"","productCode":"","productInfo":"","materialCode":"","manufacturerList":[],"productLineName":"","description":"","manufacturerProductDesc":"","manufacturerProductNo":"","customerCode":"","customerName":"","manufacturerUserNo":"","manufacturerUserDesc":"","documentNo":"协议套包","companyCode":"","groupType":0,"status":null,"pageStart":1,"pageSize":8}
"payload49_1": {"groupCode":"","groupName":"","productCode":"","productInfo":"","materialCode":"","manufacturerList":[],"productLineName":"","description":"","manufacturerProductDesc":"","manufacturerProductNo":"","customerCode":"","customerName":"","manufacturerUserNo":"","manufacturerUserDesc":"","documentNo":"套包协议特价商品显示验证","companyCode":"","groupType":0,"status":null,"pageStart":1,"pageSize":8}
#测试场景:代客下单_套包清单_查询条件验证
......
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