Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
test
autotest-airtest-web-cmdc
Commits
be79bf91
Commit
be79bf91
authored
1 year ago
by
liguangyu06
Browse files
Options
Download
Email Patches
Plain Diff
用例新增:仓库查询条件验证_需求单列表
parent
ff843eda
master
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
air_case/cmdc_33st/仓库查询条件验证_需求单列表.air/仓库查询条件验证_需求单列表.py
+59
-0
air_case/cmdc_33st/仓库查询条件验证_需求单列表.air/仓库查询条件验证_需求单列表.py
data/cmdc_33st/data
+6
-2
data/cmdc_33st/data
with
65 additions
and
2 deletions
+65
-2
air_case/cmdc_33st/仓库查询条件验证_需求单列表.air/仓库查询条件验证_需求单列表.py
0 → 100644
+
59
-
0
View file @
be79bf91
# -*- 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
)
This diff is collapsed.
Click to expand it.
data/cmdc_33st/data
+
6
-
2
View file @
be79bf91
...
...
@@ -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}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets