Commit 45022760 authored by liguangyu06's avatar liguangyu06
Browse files

用例新增:商品附件列表获取

parent ed47e2df
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:cmdc_api,cmdc商品附件列表获取,2293,2293-011,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, "url11")
request_body = commonFuc().get_business_data(module, "payload11")
"""
场景: 验证商品附件列表接口连通性
用例名称:商品附件列表获取
输出:{"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, "checkDict11")
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
...@@ -82,13 +82,17 @@ checkDict8: {"success":true,"code":"200","message":null,"data":null,"freshToken" ...@@ -82,13 +82,17 @@ checkDict8: {"success":true,"code":"200","message":null,"data":null,"freshToken"
#预期结果 #预期结果
checkDict9: {"productCode":"%s"} checkDict9: {"productCode":"%s"}
#测试场景:导入日志获取 #测试场景:导入日志获取
"url10": "/product/public/excelLog/list" "url10": "/product/public/excelLog/list"
"payload10": {"sheetName":"productProperties","pageStart":"1","pageSize":null,"total":null} "payload10": {"sheetName":"productProperties","pageStart":"1","pageSize":null,"total":null}
#预期结果 #预期结果
checkDict10: {"success":true,"code":"200","message":"OK"} checkDict10: {"success":true,"code":"200","message":"OK"}
#测试场景十一:商品附件列表获取
"url11": "/product/public/queryUploadProductFilePage"
"payload11": {"productLineCode":null,"uploadTimeQuery":[],"fileName":"","enableSign":null,"pageStart":1,"pageSize":10,"total":0}
#预期结果
checkDict11: {"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