Commit be79bf91 authored by liguangyu06's avatar liguangyu06
Browse files

用例新增:仓库查询条件验证_需求单列表

parent ff843eda
No related merge requests found
Showing with 65 additions and 2 deletions
+65 -2
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:cmdc_api,cmdc仓库查询条件验证_需求单列表,33,33-35,sit,be
主数据平台:后台运营系统获取需求单列表接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
import requests
import json
module = "cmdc_33st"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username_do_be")
password = commonFuc().get_business_data(module, "password_do_be")
# 获取登录后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, "url35")
request_body = commonFuc().get_business_data(module, "payload35_1")
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
result = json.loads(result.content)
# 获取仓库信息
storageRoomNo = result["data"]["list"][0]["storageRoomNo"]
# 第三步进行仓库查询
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url35")
request_body = commonFuc().get_business_data(module, "payload35", storageRoomNo)
"""
场景: 仓库查询条件验证_需求单列表
用例名称:仓库查询条件验证_需求单列表
输出:{"storageRoomNo":"%s"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
# 获取仓库信息
result = json.loads(result.content)
result = {"storageRoomNo": result["data"]["list"][0]["storageRoomNo"]}
# 将接口响应时间添加至result
result["api_time"] = api_time
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict35", storageRoomNo)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
......@@ -243,8 +243,12 @@ checkDict33: ["storageRoomName"]
#预期结果
checkDict34: {"stashName":"%s"}
#测试场景35:仓库查询条件验证_需求单列表
"url35": "/order/back/listDemand"
"payload35": {"times":[null],"firstAuditTimes":null,"firstAuditTimeStart":"","firstAuditTimeEnd":"","listOrderStatus":[],"productName":null,"demandCode":null,"demandParentCode":null,"customerName":null,"manufacturer":null,"materialCode":null,"sellerCompanyName":null,"produceRegisterNum":null,"productLineName":null,"auditByName":null,"orderSource":null,"changeTypeList":null,"isRebateEdit":null,"jdeType":null,"pageSize":2000,"pageStart":1,"orderChangeType":null,"snSgin":null,"changeSign":null,"customerCode":null,"distributionType":null,"busCustomerCode":null,"loginName":null,"cancelSign":0,"shipmentType":null,"siteType":null,"siteCompanyCode":null,"groupQuery":0,"promotionTypeList":[],"isGroup":[],"storageRoomNo":"%s","isReplace":null,"stayStatus":null,"closeState":null,"startTime":null,"itemStart":0}
#预期结果
checkDict35: {"storageRoomNo":"%s"}
"payload35_1": {"times":[null],"firstAuditTimes":null,"firstAuditTimeStart":"","firstAuditTimeEnd":"","listOrderStatus":[],"productName":null,"demandCode":null,"demandParentCode":null,"customerName":null,"manufacturer":null,"materialCode":null,"sellerCompanyName":null,"produceRegisterNum":null,"productLineName":null,"auditByName":null,"orderSource":null,"changeTypeList":null,"isRebateEdit":null,"jdeType":null,"pageSize":10,"pageStart":1,"orderChangeType":null,"snSgin":null,"changeSign":null,"customerCode":null,"distributionType":null,"busCustomerCode":null,"loginName":null,"cancelSign":0,"shipmentType":null,"siteType":null,"siteCompanyCode":null,"groupQuery":0,"promotionTypeList":[],"isGroup":[],"storageRoomNo":"102302","isReplace":null,"stayStatus":null,"closeState":null,"startTime":null,"itemStart":0}
......
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