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
03f6a703
Commit
03f6a703
authored
1 year ago
by
liguangyu06
Browse files
Options
Download
Email Patches
Plain Diff
用例新增:订单变更标签验证
parent
fc296513
master
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
air_case/cmdc_33st/p_订单变更标签验证.air/p_订单变更标签验证.py
+49
-0
air_case/cmdc_33st/p_订单变更标签验证.air/p_订单变更标签验证.py
data/cmdc_33st/data
+5
-1
data/cmdc_33st/data
with
54 additions
and
1 deletion
+54
-1
air_case/cmdc_33st/p_订单变更标签验证.air/p_订单变更标签验证.py
0 → 100644
+
49
-
0
View file @
03f6a703
# -*- encoding=utf8 -*-
__author__
=
"liguangyu"
"""
case_tag:cmdc_api,cmdc订单变更标签验证,33,33-48,sit,be
主数据平台:多采商城获取需求单列表接口
"""
from
common.common_func
import
commonFuc
from
air_case.cmdc_login.多采商城登录.多采商城登录
import
CmdcMaiiLogin
import
requests
import
json
module
=
"cmdc_33st"
# 第一步登录多采商城获取token
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
,
"url48"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload48"
)
"""
场景: 订单变更标签验证
用例名称:订单变更标签验证
输出:{"custModify": 1}
"""
# 发送请求
result
=
requests
.
post
(
url
,
json
=
request_body
,
headers
=
headers
)
# 获取接口响应时间
api_time
=
float
(
result
.
elapsed
.
total_seconds
())
# 获取需求单信息
result
=
json
.
loads
(
result
.
content
)
# print(result)
result
=
{
"custModify"
:
result
[
"data"
][
"list"
][
0
][
"custModify"
]}
# 将接口响应时间添加至result
result
[
"api_time"
]
=
api_time
# 获取预期结果
check_dict
=
commonFuc
().
get_business_data
(
module
,
"checkDict48"
)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc
().
check_result
(
check_dict
,
result
)
This diff is collapsed.
Click to expand it.
data/cmdc_33st/data
+
5
-
1
View file @
03f6a703
...
...
@@ -334,7 +334,11 @@ checkDict46: {"quantity":2.0000}
checkDict49: {"content": "客户修改了订单"}
#测试场景48:订单变更标签验证
"url48": "/order/public/ownListDemand"
"payload48": {"sellerCompanyCodes":[],"materialCode":"","productCode":"","productInfoValue":"","manufacturerList":null,"orderNum":"","paymentType":null,"preferenceType":null,"changeSign":null,"mainOrderStatus":null,"shipmentType":null,"stayStatus":null,"closeState":null,"orderSource":null,"pageStart":1,"pageSize":10}
#预期结果
checkDict48: {"custModify": 1}
...
...
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