Commit 4041014e authored by liguangyu06's avatar liguangyu06
Browse files

用例新增:获取订单欠货列表

parent 02e65f28
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:cmdc_api,cmdc获取订单欠货列表,2294,2294-6,sit,bs
主数据平台:多采商城获获取订单欠货列表接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.多采商城登录.多采商城登录 import CmdcMaiiLogin
from common.db.db import mySql
import requests
import json
module = "cmdc_trade"
# 第一步获取登录多采商城所需账号密码
username = commonFuc().get_business_data(module, "username")
password = commonFuc().get_business_data(module, "password")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcMaiiLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers1", cmdc_access_token)
# 第二步获取订单欠货列
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url6")
request_body = commonFuc().get_business_data(module, "payload6")
"""
场景: 验证获取订单欠货列表接口连通性
用例名称:获取订单欠货列表
输出:{"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, "checkDict6")
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
...@@ -55,7 +55,11 @@ checkDict4: {"success":true,"code":"200","message":"OK","data":"success"} ...@@ -55,7 +55,11 @@ checkDict4: {"success":true,"code":"200","message":"OK","data":"success"}
#预期结果 #预期结果
checkDict5: {"total":"%s"} checkDict5: {"total":"%s"}
#测试场景六:获取订单欠货列表
"url6": "/order/mall/queryDebtStatements"
"payload6": {"sellerCompanyCodes":[],"demandCode":"","paidSearch":null,"manufacturers":[],"materialCodes":[],"productCode":"","paymentType":"","pageSize":10,"pageStart":1}
#预期结果
checkDict6: {"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