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
91e51ef2
Commit
91e51ef2
authored
Feb 05, 2024
by
liguangyu06
Browse files
优化
parent
1ba11eca
Changes
6
Hide whitespace changes
Inline
Side-by-side
air_case/cmdc_order_merge/列表查询条件验证_配货单列表获取.air/列表查询条件验证_配货单列表获取.py
View file @
91e51ef2
...
@@ -15,8 +15,8 @@ import json
...
@@ -15,8 +15,8 @@ import json
module
=
"cmdc_order_merge"
module
=
"cmdc_order_merge"
# 第一步登录后台运营系统获取token信息
# 第一步登录后台运营系统获取token信息
username
=
commonFuc
().
get_business_data
(
module
,
"username
1
"
)
username
=
commonFuc
().
get_business_data
(
module
,
"username
2
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
1
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
2
"
)
# 获取登录后Cmdc_access_token
# 获取登录后Cmdc_access_token
cmdc_access_token
=
CmdcDoLogin
(
username
,
password
).
get_token
()
cmdc_access_token
=
CmdcDoLogin
(
username
,
password
).
get_token
()
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers"
,
cmdc_access_token
)
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers"
,
cmdc_access_token
)
...
...
air_case/cmdc_order_merge/模糊查询商品编码信息.air/模糊查询商品编码信息.py
View file @
91e51ef2
...
@@ -15,22 +15,22 @@ import json
...
@@ -15,22 +15,22 @@ import json
module
=
"cmdc_order_merge"
module
=
"cmdc_order_merge"
# 获取登录所需账号密码
# 获取登录所需账号密码
username
=
commonFuc
().
get_business_data
(
module
,
"username
1
"
)
username
=
commonFuc
().
get_business_data
(
module
,
"username
2
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
1
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
2
"
)
# 获取登录后Cmdc_access_token
# 获取登录后Cmdc_access_token
cmdc_access_token
=
CmdcDoLogin
(
username
,
password
).
get_token
()
cmdc_access_token
=
CmdcDoLogin
(
username
,
password
).
get_token
()
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers"
,
cmdc_access_token
)
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers"
,
cmdc_access_token
)
# 设置需要查询的商品编码
# 设置需要查询的商品编码
product_code_random
=
"1
6518884
"
product_code_random
=
"1
4384307
"
# 模糊查询商品编码信息
# 模糊查询商品编码信息
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url3"
)
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url3"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload3"
,
product_code_random
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload3"
,
product_code_random
)
"""
"""
场景: 验证模糊查询
客户
信息接口连通性
场景: 验证模糊查询
商品编码
信息接口连通性
用例名称:模糊查询
客户
信息
用例名称:模糊查询
商品编码
信息
输出:{"productCode":"%s"}
输出:{"productCode":"%s"}
"""
"""
# 发送请求
# 发送请求
...
@@ -38,7 +38,7 @@ result = requests.post(url, json=request_body, headers=headers)
...
@@ -38,7 +38,7 @@ result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
# 获取接口响应时间
api_time
=
float
(
result
.
elapsed
.
total_seconds
())
api_time
=
float
(
result
.
elapsed
.
total_seconds
())
result
=
json
.
loads
(
result
.
content
)
result
=
json
.
loads
(
result
.
content
)
# print(result)
# 获取查询结果中商品编码信息
# 获取查询结果中商品编码信息
result
=
{
"productCode"
:
result
[
"data"
][
0
][
"productCode"
]}
result
=
{
"productCode"
:
result
[
"data"
][
0
][
"productCode"
]}
# print(result)
# print(result)
...
...
air_case/cmdc_order_merge/模糊查询客户信息_配货单列表.air/模糊查询客户信息_配货单列表.py
View file @
91e51ef2
...
@@ -15,8 +15,8 @@ import json
...
@@ -15,8 +15,8 @@ import json
module
=
"cmdc_order_merge"
module
=
"cmdc_order_merge"
# 获取登录所需账号密码
# 获取登录所需账号密码
username
=
commonFuc
().
get_business_data
(
module
,
"username
1
"
)
username
=
commonFuc
().
get_business_data
(
module
,
"username
2
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
1
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
2
"
)
# 获取登录后Cmdc_access_token
# 获取登录后Cmdc_access_token
cmdc_access_token
=
CmdcDoLogin
(
username
,
password
).
get_token
()
cmdc_access_token
=
CmdcDoLogin
(
username
,
password
).
get_token
()
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers"
,
cmdc_access_token
)
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers"
,
cmdc_access_token
)
...
...
air_case/cmdc_order_merge/模糊查询物料编码.air/模糊查询物料编码.py
View file @
91e51ef2
...
@@ -15,14 +15,14 @@ import json
...
@@ -15,14 +15,14 @@ import json
module
=
"cmdc_order_merge"
module
=
"cmdc_order_merge"
# 获取登录所需账号密码
# 获取登录所需账号密码
username
=
commonFuc
().
get_business_data
(
module
,
"username
1
"
)
username
=
commonFuc
().
get_business_data
(
module
,
"username
2
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
1
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
2
"
)
# 获取登录后Cmdc_access_token
# 获取登录后Cmdc_access_token
cmdc_access_token
=
CmdcDoLogin
(
username
,
password
).
get_token
()
cmdc_access_token
=
CmdcDoLogin
(
username
,
password
).
get_token
()
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers"
,
cmdc_access_token
)
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers"
,
cmdc_access_token
)
# 设置需要查询的模糊字段
# 设置需要查询的模糊字段
material_code_random
=
"
14306
"
material_code_random
=
"
TPVL200
"
# 模糊查询物料编码
# 模糊查询物料编码
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url6"
)
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url6"
)
...
...
air_case/cmdc_order_merge/获取电商配货详情.air/获取电商配货详情.py
View file @
91e51ef2
...
@@ -15,8 +15,8 @@ import json
...
@@ -15,8 +15,8 @@ import json
module
=
"cmdc_order_merge"
module
=
"cmdc_order_merge"
# 第一步获取登录所需账号密码
# 第一步获取登录所需账号密码
username
=
commonFuc
().
get_business_data
(
module
,
"username
1
"
)
username
=
commonFuc
().
get_business_data
(
module
,
"username
2
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
1
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
2
"
)
# 获取登录后Cmdc_access_token
# 获取登录后Cmdc_access_token
cmdc_access_token
=
CmdcDoLogin
(
username
,
password
).
get_token
()
cmdc_access_token
=
CmdcDoLogin
(
username
,
password
).
get_token
()
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers"
,
cmdc_access_token
)
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers"
,
cmdc_access_token
)
...
...
data/cmdc_order_merge/data
View file @
91e51ef2
...
@@ -6,6 +6,10 @@
...
@@ -6,6 +6,10 @@
"username1": "Admin00111"
"username1": "Admin00111"
"password1": "Aa123456"
"password1": "Aa123456"
#后台运营管理系统登录信息(子站点国联医疗器械有限公司)
"username2": "Admin00102"
"password2": "Aa123456"
#后台管理系统headers
#后台管理系统headers
json_headers: {
json_headers: {
...
@@ -38,7 +42,7 @@ checkDict2: {"cusCompanyName":"%s"}
...
@@ -38,7 +42,7 @@ checkDict2: {"cusCompanyName":"%s"}
#测试场景三:模糊查询商品编码信息
#测试场景三:模糊查询商品编码信息
"url3": "/product/public/getProductVoAll"
"url3": "/product/public/getProductVoAll"
"payload3": {"productCodeList":["%s"],"filialeCode":"001
11
"}
"payload3": {"productCodeList":["%s"],"filialeCode":"001
02
"}
#预期结果
#预期结果
checkDict3: {"productCode":"%s"}
checkDict3: {"productCode":"%s"}
...
...
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