From 2bb49e3f9080e6f6172f120319e5d0bb9c51498a Mon Sep 17 00:00:00 2001 From: liguangyu06 <1666071293@qq.com> Date: Tue, 23 Jan 2024 14:21:22 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E4=BE=8B=E6=96=B0=E5=A2=9E=EF=BC=9A?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=8F=91=E7=A5=A8=E6=B8=85=E5=8D=95=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...05\345\215\225\345\210\227\350\241\250.py" | 45 +++++++++++++++++++ data/cmdc_trade/data | 5 ++- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 "air_case/cmdc_trade/\350\216\267\345\217\226\345\217\221\347\245\250\346\270\205\345\215\225\345\210\227\350\241\250.air/\350\216\267\345\217\226\345\217\221\347\245\250\346\270\205\345\215\225\345\210\227\350\241\250.py" diff --git "a/air_case/cmdc_trade/\350\216\267\345\217\226\345\217\221\347\245\250\346\270\205\345\215\225\345\210\227\350\241\250.air/\350\216\267\345\217\226\345\217\221\347\245\250\346\270\205\345\215\225\345\210\227\350\241\250.py" "b/air_case/cmdc_trade/\350\216\267\345\217\226\345\217\221\347\245\250\346\270\205\345\215\225\345\210\227\350\241\250.air/\350\216\267\345\217\226\345\217\221\347\245\250\346\270\205\345\215\225\345\210\227\350\241\250.py" new file mode 100644 index 00000000..4b4fd79b --- /dev/null +++ "b/air_case/cmdc_trade/\350\216\267\345\217\226\345\217\221\347\245\250\346\270\205\345\215\225\345\210\227\350\241\250.air/\350\216\267\345\217\226\345\217\221\347\245\250\346\270\205\345\215\225\345\210\227\350\241\250.py" @@ -0,0 +1,45 @@ +# -*- encoding=utf8 -*- +__author__ = "liguangyu" + +""" +case_tag:cmdc_api,cmdc获取发票清单列表,2294,2294-36,sit,be +主数据平台:多采商城获取发票清单列表接口 +""" + +from common.common_func import commonFuc +from air_case.cmdc_login.多采商城登录.多采商城登录 import CmdcMaiiLogin +import requests +import json + +module = "cmdc_trade" + +# 第一步获取登录多采商城所需账号密码 +username = commonFuc().get_business_data(module, "username_be") +password = commonFuc().get_business_data(module, "password_be") +# 获取登录后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, "url35") +request_body = commonFuc().get_business_data(module, "payload35") + +""" + + 场景: 获取发票清单列表 + 用例名称:获取发票清单列表 + 输出:{"success":true,"code":"200","message":"操作成功"} +""" + +# 发送请求 +result = requests.post(url, json=request_body, headers=headers) +# 获取接口响应时间 +api_time = float(result.elapsed.total_seconds()) +result = json.loads(result.content) + +result["api_time"] = api_time +# 获取预期结果 +check_dict = commonFuc().get_business_data(module, "checkDict35") +# print(check_dict) +# 断言实际结果中是否包含预期结果的内容 +commonFuc().check_result(check_dict, result) diff --git a/data/cmdc_trade/data b/data/cmdc_trade/data index f569840c..5c6555e0 100644 --- a/data/cmdc_trade/data +++ b/data/cmdc_trade/data @@ -242,7 +242,10 @@ checkDict33: {"refundCode":"%s"} "payload34": {"refundId":"%s","pageStart":1,"pageSize":10} checkDict34: {"refundId":"%s"} - +#测试场景三十五:获取发票清单列表 +"url35": "/order/mall/queryInvoicePage" +"payload35": {"companyId":"","demandCode":"","invoiceNo":"","invoiceTimeBegin":"","invoiceTimeEnd":"","pageNumber":1,"pageSize":10} +checkDict35: {"success":true,"code":"200","message":"操作成功"} -- GitLab