Skip to content
GitLab
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
018def49
Commit
018def49
authored
1 year ago
by
liguangyu06
Browse files
Options
Download
Email Patches
Plain Diff
新增用例:物料编码查询以及查询商品接口用例
parent
a4ab7100
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
air_case/cmdc_order_handle/物料编码模糊查询验证_结算页面.air/物料编码模糊查询验证_结算页面.py
+47
-0
.../cmdc_order_handle/物料编码模糊查询验证_结算页面.air/物料编码模糊查询验证_结算页面.py
air_case/cmdc_order_handle/通过物料编码查询商品验证_结算页面.air/通过物料编码查询商品验证_结算页面.py
+39
-0
...c_order_handle/通过物料编码查询商品验证_结算页面.air/通过物料编码查询商品验证_结算页面.py
data/cmdc_order_handle/data
+12
-2
data/cmdc_order_handle/data
with
98 additions
and
2 deletions
+98
-2
air_case/cmdc_order_handle/物料编码模糊查询验证_结算页面.air/物料编码模糊查询验证_结算页面.py
0 → 100644
+
47
-
0
View file @
018def49
# -*- encoding=utf8 -*-
__author__
=
"liguangyu"
"""
case_tag:cmdc_api,cmdc物料编码模糊查询验证_结算页面,2288,2288-16,sit,bs
涉及到接口:多采商城物料编码模糊查询接口
"""
from
common.common_func
import
commonFuc
from
air_case.cmdc_login.多采商城登录.多采商城登录
import
CmdcMaiiLogin
import
requests
import
random
import
json
module
=
"cmdc_order_handle"
# 第一步登录多采商城获取token
# 获取登录所需账号密码
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
)
# 生成随机数据
random_code
=
random
.
randint
(
0
,
10
)
# 第二步进行物料编码模糊匹配查询
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url12"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload12"
,
random_code
)
"""
场景:验证结算页面物料编码模糊查询接口连通性
用例名称:物料编码模糊查询验证_结算页面
输出:{"data":["%s"]}
"""
# 发送请求
result
=
requests
.
get
(
url
,
params
=
request_body
,
headers
=
headers
)
result
=
json
.
loads
(
result
.
content
)
# print(result)
# 获取查询结果中数据
result
=
{
"data"
:
result
[
"data"
][
0
][
0
]}
# 获取预期结果
check_dict
=
commonFuc
().
get_business_data
(
module
,
"checkDict12"
,
random_code
)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc
().
check_result
(
check_dict
,
result
)
This diff is collapsed.
Click to expand it.
air_case/cmdc_order_handle/通过物料编码查询商品验证_结算页面.air/通过物料编码查询商品验证_结算页面.py
0 → 100644
+
39
-
0
View file @
018def49
# -*- encoding=utf8 -*-
__author__
=
"liguangyu"
"""
case_tag:cmdc_api,cmdc通过物料编码查询商品验证_结算页面,2288,2288-17,sit,bs
涉及到接口:多采商城根据物料编码查询商品信息接口
"""
from
common.common_func
import
commonFuc
import
requests
import
json
module
=
"cmdc_order_handle"
# 规格型号
material_code
=
"00-8800-000-10"
# 根据物料编码查询商品信息
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url13"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload13"
,
material_code
)
"""
场景: 验证结算页面通过规格型号查询商品信息接口连通性
用例名称:通过规格型号查询商品验证_结算页面
输出:{"materialCode":"%s"}
"""
# 发送请求
result
=
requests
.
get
(
url
,
params
=
request_body
)
result
=
json
.
loads
(
result
.
content
)
# print(result)
# 获取查询结果中商品对应的物料编码
result
=
{
"materialCode"
:
result
[
"data"
][
"list"
][
0
][
"materialCode"
]}
# 获取预期结果
check_dict
=
commonFuc
().
get_business_data
(
module
,
"checkDict13"
,
material_code
)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc
().
check_result
(
check_dict
,
result
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
data/cmdc_order_handle/data
+
12
-
2
View file @
018def49
...
...
@@ -114,9 +114,19 @@ checkDict10: {"data":"%s"}
#预期结果
checkDict11: {"specifications":"%s"}
#测试场景十二:物料编码模糊查询验证_结算页面
#接口信息
"url12": "/product/public/getMaterialCodeList"
"payload12": {"allMaterialSign":1,"companyCode":"00102","userNo":"1068927","materialCodeInput":"%s"}
#预期结果
checkDict12: {"data":"%s"}
#测试场景十三:通过物料编码查询商品验证_结算页面
#接口信息
"url13": "/product/public/listQuickOrderProduct"
"payload13": {"type":1,"companyCode":"00102","userNo":"1068927","materialCodeExact":"%s"}
#预期结果
checkDict13: {"materialCode":"%s"}
...
...
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