Commit b1e520a6 authored by 周念东's avatar 周念东
Browse files

用例优化

parent 7608cfbd
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
__author__ = "zhouniandong" __author__ = "zhouniandong"
""" """
case_tag:cmdc_api,cmdc缺货篮管理,2293,2293-1,sit,bs case_tag:cmdc_api,cmdc缺货篮管理,2003,2003-1-1,sit,bs
主数据平台:运营后台管理系统缺货篮管理接口 主数据平台:运营后台管理系统缺货篮管理接口
""" """
......
# -*- encoding=utf8 -*-
__author__ = "zhouniandong"
"""
case_tag:cmdc_api,cmdc缺货篮管理查询已处理数据,2003,2003-1-5,sit,bs
主数据平台:运营后台管理系统缺货篮管理接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
import requests
import json
module = "cmdc_product_stockoutbasket"
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url5")
print(url)
# 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username")
password = commonFuc().get_business_data(module, "password")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
request_body = commonFuc().get_business_data(module, "payload5")
"""
场景:缺货篮管理(缺货篮管理)
用例名称:缺货篮管理查询已处理数据(缺货篮管理)
输出:{"success":true,"code":"200","message":"OK"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
#print("\033[031mresult1============\033[0m",result)
result = json.loads(result.content)
#print("\033[031mresult2============\033[0m",result)
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict5")
print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
\ No newline at end of file
# -*- encoding=utf8 -*-
__author__ = "zhouniandong"
"""
case_tag:cmdc_api,cmdc缺货篮管理查询未处理数据,2003,2003-1-4,sit,bs
主数据平台:运营后台管理系统缺货篮管理接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
import requests
import json
module = "cmdc_product_stockoutbasket"
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url4")
print(url)
# 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username")
password = commonFuc().get_business_data(module, "password")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
request_body = commonFuc().get_business_data(module, "payload4")
"""
场景:缺货篮管理(缺货篮管理)
用例名称:缺货篮管理查询未处理数据(缺货篮管理)
输出:{"success":true,"code":"200","message":"OK"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
#print("\033[031mresult1============\033[0m",result)
result = json.loads(result.content)
#print("\033[031mresult2============\033[0m",result)
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict4")
print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
\ No newline at end of file
...@@ -13,7 +13,7 @@ json_headers: { ...@@ -13,7 +13,7 @@ json_headers: {
checkDict1: {"success":true,"code":"200","message":"OK"} checkDict1: {"success":true,"code":"200","message":"OK"}
#老客管理查询调度 #老客管理查询调度
"url2": "/user/public/querySchedule" "url2": "/user/public/querySchedule"
"payload2": {"firstid":3} "payload2": {"firstid":3}
#预期结果 #预期结果
......
...@@ -24,4 +24,17 @@ checkDict2: {"success":true,"code":"200","message":"OK"} ...@@ -24,4 +24,17 @@ checkDict2: {"success":true,"code":"200","message":"OK"}
"url3": "/product/mall/selectPublishedProductCategoryOption" "url3": "/product/mall/selectPublishedProductCategoryOption"
"payload3": {"parentId":1} "payload3": {"parentId":1}
#预期结果 #预期结果
checkDict3: {"success":true,"code":"200","message":"OK"} checkDict3: {"success":true,"code":"200","message":"OK"}
\ No newline at end of file
#缺货篮管理查询未处理数据 post
"url4": "/user/queryStockOutPage"
"payload4": {telephone: "", status: "101", firstCategory: "", secondCategory: "", thirdCategory: "", pageStart: 1,…}
#预期结果
checkDict4: {"success":true,"code":"200","message":"OK","data":{"pageNum":1,"pageSize":10,"size":0,"startRow":0,"endRow":0,"total":0,"pages":0,"list":[],"prePage":0,"nextPage":0,"isFirstPage":true,"isLastPage":true,"hasPreviousPage":false,"hasNextPage":false,"navigatePages":8,"navigatepageNums":[],"navigateFirstPage":0,"navigateLastPage":0,"firstPage":0,"lastPage":0},"freshToken":null}
#缺货篮管理查询已处理数据 post
"url5": "/user/queryStockOutPage"
"payload5": {"telephone":"","status":"102","firstCategory":"","secondCategory":"","thirdCategory":"","pageStart":1,"pageSize":10}
#预期结果
checkDict5: {"success":true,"code":"200","message":"OK"}
子站老客变更管理选择调度 1718762670127 1718762671559 zhouniandong 缺货篮管理查询已处理数据 1718765784048 1718765785173 zhouniandong
...@@ -73,9 +73,9 @@ ...@@ -73,9 +73,9 @@
</tr> </tr>
<tr width="600"> <tr width="600">
<td class="details-col-elapsed"><a href='../log/子站老客变更管理选择调度/log.html' target='_blank'>子站老客变更管理选择调度</a></td> <td class="details-col-elapsed"><a href='../log/缺货篮管理查询已处理数据/log.html' target='_blank'>缺货篮管理查询已处理数据</a></td>
<td class="success">成功</td> <td class="success">成功</td>
<td class="details-col-elapsed">1.432</td> <td class="details-col-elapsed">1.125</td>
<td class="details-col-elapsed">zhouniandong</td> <td class="details-col-elapsed">zhouniandong</td>
<td class="details-col-elapsed">0</td> <td class="details-col-elapsed">0</td>
</tr> </tr>
......
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