Commit 8c33e77f authored by 周念东's avatar 周念东
Browse files

用例优化

parent 054965c3
# -*- encoding=utf8 -*-
__author__ = "zhouniandong"
"""
case_tag:cmdc_api,cmdc总站厂家管理列表查询产品线列表,2293,2293-3,sit,bs
主数据平台:运营后台管理系统总站厂家管理列表接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
import requests
import json
module = "cmdc_data_kanban"
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总站厂家管理列表查询厂家管理页面,2293,2293-3,sit,bs
主数据平台:运营后台管理系统总站厂家管理列表接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
import requests
import json
module = "cmdc_data_kanban"
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)
#后台运营管理系统登录信息(总站)
"username": "Admin"
"password": "Aa123456"
json_headers: {
"Content-Type": "application/json",
"Cmdc_access_token": "%s"
}
#总站厂家管理列表查询产品线列表 post
"url1": "/user/public/manufacturerProduct/queryProductLineList"
"payload1": {"productLineCode":null,"productLineName":null}
#预期结果
checkDict1: {"success":true,"code":"200","message":"OK"}
#总站厂家管理列表查询厂家管理页面 post
"url2": "/user/public/manufacturerManage/queryManufacturerManageByPage"
"payload2": {"manufacturerName":"","productLineCodeList":[],"account":null,"pageStart":1,"pageSize":10}
#预期结果
checkDict2: {"success":true,"code":"200","message":"OK"}
#终端流向管理查询流向管理页面 post
"url3": "/order/back/queryFlowDirectionManagePage"
"payload3": {"table":0,"endCustomerName":"","invoiceNo":"","manufacturer":"","productInfo":"","materialCode":"","orderStartTime":"","customerCode":"","customerName":"","companyCode":"","uploadStartTime":"","uploadEndTime":"","pageStart":1,"pageSize":10,"total":0}
#预期结果
checkDict3: {"success":true,"code":"200","message":"OK"}
#终端流向管理获取生产厂商 get
"url4": "/product/public/getManufacturers"
"payload4":
#预期结果
checkDict4: {"success":true,"code":"200","message":"OK"}
总站日志管理JDE日志管理 1719459731197 1719459732601 zhouniandong
总站厂家管理列表查询厂家管理页面 1719466860474 1719466862614 zhouniandong
......@@ -56,7 +56,7 @@
<tr width="600">
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0分1</td>
<td class='details-col-elapsed'>0分2</td>
<td class="details-col-elapsed">100.0%</td>
</tr>
</table>
......@@ -73,11 +73,11 @@
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/总站日志管理JDE日志管理/log.html' target='_blank'>总站日志管理JDE日志管理</a></td>
<td class="details-col-elapsed"><a href='../log/总站厂家管理列表查询厂家管理页面/log.html' target='_blank'>总站厂家管理列表查询厂家管理页面</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">1.404</td>
<td class="details-col-elapsed">2.14</td>
<td class="details-col-elapsed">zhouniandong</td>
<td class="details-col-elapsed"> 0.343108</td>
<td class="details-col-elapsed"> 0.975654</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