Commit 5a975e67 authored by liguangyu06's avatar liguangyu06
Browse files

优化

parent eba1f972
......@@ -15,7 +15,7 @@ import json
module = "cmdc_buyercar_list"
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url1")
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url2")
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, "payload1")
request_body = commonFuc().get_business_data(module, "payload2")
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, "checkDict1")
check_dict = commonFuc().get_business_data(module, "checkDict2")
print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
......@@ -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"}
"""
# 发送请求
......
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