Commit 8dabe6fd authored by liguangyu06's avatar liguangyu06
Browse files

用例新增:上传日志信息获取

parent c6007695
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:cmdc_api,cmdc上传日志信息获取,2293,2293-013,sit,bs
主数据平台:运营后台管理系统上传日志接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
import requests
import json
module = "cmdc_product"
# 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 获取商品附件上传日志信息
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url27")
request_body = commonFuc().get_business_data(module, "payload27")
"""
场景: 验证商品附件列表接口连通性
用例名称:商品附件列表获取
输出:{"success":true,"code":"200","message":"OK"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
result = json.loads(result.content)
# print(result)
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict27")
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
...@@ -198,7 +198,11 @@ checkDict25: {"stockRuleId":"%s"} ...@@ -198,7 +198,11 @@ checkDict25: {"stockRuleId":"%s"}
checkDict26: {"productLineCode":"%s"} checkDict26: {"productLineCode":"%s"}
#测试场景二十七:上传日志信息获取
"url27": "/product/public/queryOperationLog"
"payload27": {"pageStart":1,"pageSize":10,"total":0,"operationTask":"productFileDownload","companyCode":"00111"}
#预期结果
checkDict27: {"success":true,"code":"200","message":"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