Commit b148de81 authored by liguangyu06's avatar liguangyu06
Browse files

用例优化

parent d49c9d29
...@@ -26,7 +26,7 @@ headers = commonFuc().get_business_data(module, "json_headers2", cmdc_access_tok ...@@ -26,7 +26,7 @@ headers = commonFuc().get_business_data(module, "json_headers2", cmdc_access_tok
# 第二步特价单品列表查询 # 第二步特价单品列表查询
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url1") url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url1")
request_body = commonFuc().get_business_data(module, "payload1") request_body = commonFuc().get_business_data(module, "payload_1")
# 发送请求 # 发送请求
result = requests.post(url, json=request_body, headers=headers) result = requests.post(url, json=request_body, headers=headers)
result = json.loads(result.content) result = json.loads(result.content)
...@@ -51,7 +51,7 @@ excel.write_data(row=2, column=4, value=customer_name) ...@@ -51,7 +51,7 @@ excel.write_data(row=2, column=4, value=customer_name)
# 第二步文件导入 # 第二步文件导入
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url18") url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url18")
request_body = commonFuc().get_business_data(module, "payload18") request_body = commonFuc().get_business_data(module, "payload18_0")
# 获取文件 # 获取文件
file = open(file_path, "rb") file = open(file_path, "rb")
...@@ -77,7 +77,6 @@ request_body = {"freseniusPriceIds": [fresenius_price_id], "groupPriceStatus": 0 ...@@ -77,7 +77,6 @@ request_body = {"freseniusPriceIds": [fresenius_price_id], "groupPriceStatus": 0
# 发送请求 # 发送请求
result = requests.post(url, json=request_body, headers=headers) result = requests.post(url, json=request_body, headers=headers)
result = json.loads(result.content) result = json.loads(result.content)
print(result)
file.close() file.close()
# 数据库操作 # 数据库操作
......
...@@ -29,7 +29,7 @@ result = requests.post(url, headers=headers, json=request_body) ...@@ -29,7 +29,7 @@ result = requests.post(url, headers=headers, json=request_body)
result = json.loads(result.content) result = json.loads(result.content)
# 随机获取不相同两个商品信息 # 随机获取不相同两个商品信息
product_id_a = random.randint(1, len(result["data"]["list"]) - 1) product_id_a = random.randint(1, len(result["data"]["list"]) - 2)
product_a = result["data"]["list"][product_id_a] product_a = result["data"]["list"][product_id_a]
product_id_b = random.randint(product_id_a + 1, len(result["data"]["list"])) product_id_b = random.randint(product_id_a + 1, len(result["data"]["list"]))
product_b = result["data"]["list"][product_id_b] product_b = result["data"]["list"][product_id_b]
......
...@@ -27,6 +27,7 @@ json_headers1: { ...@@ -27,6 +27,7 @@ json_headers1: {
#测试场景一:特价单品查询 #测试场景一:特价单品查询
"url1": "/order/public/querySingleProductPricePage" "url1": "/order/public/querySingleProductPricePage"
"payload1": {"groupCode":"","groupName":"","productCode":"","productInfo":"","materialCode":"","manufacturerList":[],"productLineName":"","description":"","manufacturerProductDesc":"","manufacturerProductNo":"","customerCode":"","customerName":"","manufacturerUserNo":"","manufacturerUserDesc":"","documentNo":"","groupType":1,"groupPriceStatus":null,"pageStart":null,"pageSize":null} "payload1": {"groupCode":"","groupName":"","productCode":"","productInfo":"","materialCode":"","manufacturerList":[],"productLineName":"","description":"","manufacturerProductDesc":"","manufacturerProductNo":"","customerCode":"","customerName":"","manufacturerUserNo":"","manufacturerUserDesc":"","documentNo":"","groupType":1,"groupPriceStatus":null,"pageStart":null,"pageSize":null}
"payload_1": {"groupCode":"","groupName":"","productCode":"","productInfo":"","materialCode":"","manufacturerList":[],"productLineName":"","description":"","manufacturerProductDesc":"","manufacturerProductNo":"","customerCode":"","customerName":"","manufacturerUserNo":"","manufacturerUserDesc":"","documentNo":"","groupType":1,"groupPriceStatus":"1","pageStart":1,"pageSize":8}
#预期结果 #预期结果
checkDict1: {"total":"%s"} checkDict1: {"total":"%s"}
...@@ -156,6 +157,7 @@ checkDict17: {"total": 1} ...@@ -156,6 +157,7 @@ checkDict17: {"total": 1}
#excel导入接口和报文 #excel导入接口和报文
"url18": "/order/public/importEnableOrDisableSingleProduct" "url18": "/order/public/importEnableOrDisableSingleProduct"
"payload18": {"groupPriceStatus": 1} "payload18": {"groupPriceStatus": 1}
"payload18_0": {"groupPriceStatus": 0}
#特价单品启用接口信息 #特价单品启用接口信息
"url_open": "/order/public/enableOrDisableProductPrice" "url_open": "/order/public/enableOrDisableProductPrice"
#预期结果 #预期结果
......
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