Commit 054965c3 authored by 周念东's avatar 周念东
Browse files

用例优化

parent fbf19ae8
# -*- encoding=utf8 -*-
__author__ = "zhouniandong"
"""
case_tag:cmdc_api,cmdc总站日志管理JDE日志管理,2001,2001-7-2,sit,bs
主数据平台:运营后台管理系统总站日志管理接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
import requests
import json
module = "cmdc_log_manage"
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url7")
#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, "payload7")
"""
场景:总站日志管理()
用例名称:总站日志管理JDE日志管理(总站日志管理)
输出:{"success":true,"code":"200","message":"OK"}
"""
# 发送请求
result = requests.get(url, params=request_body, headers=headers)
#print("\033[031mresult1============\033[0m",result)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
result = json.loads(result.content)
result["api_time"] = api_time
print(api_time)
#print("\033[031mresult2============\033[0m",result)
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict7")
print("\033[031mcheck_dict============\033[0m",check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# -*- encoding=utf8 -*-
__author__ = "zhouniandong"
"""
case_tag:cmdc_api,cmdc总站日志管理内容管理日志,2001,2001-7-2,sit,bs
主数据平台:运营后台管理系统总站日志管理接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
import requests
import json
module = "cmdc_log_manage"
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)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
result = json.loads(result.content)
result["api_time"] = api_time
print(api_time)
#print("\033[031mresult2============\033[0m",result)
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict5")
print("\033[031mcheck_dict============\033[0m",check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# -*- encoding=utf8 -*-
__author__ = "zhouniandong"
"""
case_tag:cmdc_api,cmdc总站日志管理商品上线及管理日志,2001,2001-7-2,sit,bs
主数据平台:运营后台管理系统总站日志管理接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
import requests
import json
module = "cmdc_log_manage"
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url3")
#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, "payload3")
"""
场景:总站日志管理()
用例名称:总站日志管理商品上线及管理日志(总站日志管理)
输出:{"success":true,"code":"200","message":"OK"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
#print("\033[031mresult1============\033[0m",result)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
result = json.loads(result.content)
result["api_time"] = api_time
print(api_time)
#print("\033[031mresult2============\033[0m",result)
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict3")
print("\033[031mcheck_dict============\033[0m",check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# -*- encoding=utf8 -*-
__author__ = "zhouniandong"
"""
case_tag:cmdc_api,cmdc总站日志管理商品分类管理日志,2001,2001-7-2,sit,bs
主数据平台:运营后台管理系统总站日志管理接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
import requests
import json
module = "cmdc_log_manage"
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url2")
#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, "payload2")
"""
场景:总站日志管理()
用例名称:总站日志管理客户日志(总站日志管理)
输出:{"success":true,"code":"200","message":"OK"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
#print("\033[031mresult1============\033[0m",result)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
result = json.loads(result.content)
result["api_time"] = api_time
print(api_time)
#print("\033[031mresult2============\033[0m",result)
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict2")
print("\033[031mcheck_dict============\033[0m",check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# -*- encoding=utf8 -*-
__author__ = "zhouniandong"
"""
case_tag:cmdc_api,cmdc总站日志管理客户日志,2001,2001-7-2,sit,bs
主数据平台:运营后台管理系统总站日志管理接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
import requests
import json
module = "cmdc_log_manage"
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url1")
#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, "payload1")
"""
场景:总站日志管理()
用例名称:总站日志管理客户日志(总站日志管理)
输出:{"success":true,"code":"200","message":"OK"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
#print("\033[031mresult1============\033[0m",result)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
result = json.loads(result.content)
result["api_time"] = api_time
print(api_time)
#print("\033[031mresult2============\033[0m",result)
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict1")
print("\033[031mcheck_dict============\033[0m",check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# -*- encoding=utf8 -*-
__author__ = "zhouniandong"
"""
case_tag:cmdc_api,cmdc总站日志管理控销管理日志,2001,2001-7-2,sit,bs
主数据平台:运营后台管理系统总站日志管理接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
import requests
import json
module = "cmdc_log_manage"
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)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
result = json.loads(result.content)
result["api_time"] = api_time
print(api_time)
#print("\033[031mresult2============\033[0m",result)
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict4")
print("\033[031mcheck_dict============\033[0m",check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# -*- encoding=utf8 -*-
__author__ = "zhouniandong"
"""
case_tag:cmdc_api,cmdc总站日志管理订单操作日志,2001,2001-7-2,sit,bs
主数据平台:运营后台管理系统总站日志管理接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
import requests
import json
module = "cmdc_log_manage"
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url6")
#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, "payload6")
"""
场景:总站日志管理()
用例名称:总站日志管理订单操作日志(总站日志管理)
输出:{"success":true,"code":"200","message":"OK"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
#print("\033[031mresult1============\033[0m",result)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
result = json.loads(result.content)
result["api_time"] = api_time
print(api_time)
#print("\033[031mresult2============\033[0m",result)
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict6")
print("\033[031mcheck_dict============\033[0m",check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
#后台运营管理系统登录信息(总站)
"username": "Admin"
"password": "Aa123456"
json_headers: {
"Content-Type": "application/json",
"Cmdc_access_token": "%s"
}
#总站日志管理客户日志 post
"url1": "/user/queryLogPage"
"payload1": {"pageSize":10,"pageStart":1,"startTime":"","endTime":"","companyName":"","userName":"","operateType":"","describe":""}
#预期结果
checkDict1: {"success":true,"code":"200","message":"OK"}
#总站日志管理商品分类管理日志 post
"url2": "/product/queryProductLogByPage"
"payload2": {"pageSize":10,"pageNum":1,"startTime":"","endTime":"","operationCode":"","operationName":"","operationType":"","operator":"","companyName":"","operationClassify":2}
#预期结果
checkDict2: {"success":true,"code":"200","message":"OK"}
#总站日志管理商品上线及管理日志 post
"url3": "/product/queryProductLogByPage"
"payload3": {"pageSize":10,"pageNum":1,"startTime":"","endTime":"","operationCode":"","operationName":"","operationType":"","operator":"","companyName":"","operationClassify":1}
#预期结果
checkDict3: {"success":true,"code":"200","message":"OK"}
#总站日志管理控销管理日志 post
"url4": "/product/queryProductLogByPage"
"payload4": {"pageSize":10,"pageNum":1,"startTime":"","endTime":"","operationName":"","operationType":"","operator":"","companyName":"","operationClassify":3}
#预期结果
checkDict4: {"success":true,"code":"200","message":"OK"}
#总站日志管理内容管理日志 post
"url5": "/cms/queryLog"
"payload5": {"pageSize":10,"pageNumber":1,"startTime":"","endTime":"","companyName":"","userName":"","operationType":""}
#预期结果
checkDict5: {"success":true,"code":"200","message":"OK"}
#总站日志管理订单操作日志 post
"url6": "/order/back/operationPage"
"payload6": {"pageSize":10,"pageStart":1,"startTime":"","endTime":"","sellerCompanyName":"","demandCode":"","contentType":"","updateName":""}
#预期结果
checkDict6: {"success":true,"code":"200","message":"OK"}
#总站日志管理jde日志管理 get
"url7": "/user/public/userRunnableLogDetail/detail"
"payload7": requestBody=&name=&status=&pageSize=10&pageStart=1
#预期结果
checkDict7: {"success":true,"code":"200","message":"OK"}
\ No newline at end of file
前台分类管理查询产品分类 1719457816883 1719457817841 zhouniandong
总站日志管理JDE日志管理 1719459731197 1719459732601 zhouniandong
......@@ -73,11 +73,11 @@
</tr>
<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/总站日志管理JDE日志管理/log.html' target='_blank'>总站日志管理JDE日志管理</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">0.958</td>
<td class="details-col-elapsed">1.404</td>
<td class="details-col-elapsed">zhouniandong</td>
<td class="details-col-elapsed"> 0.083441</td>
<td class="details-col-elapsed"> 0.343108</td>
</tr>
</table>
......
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