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
bd40d9ea
Commit
bd40d9ea
authored
Dec 14, 2023
by
liguangyu06
Browse files
用例优化
parent
92897d84
Changes
6
Hide whitespace changes
Inline
Side-by-side
air_case/cmdc-qos/快速下单权限_否.air/快速下单权限_否.py
View file @
bd40d9ea
...
...
@@ -19,25 +19,22 @@ 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_headers"
,
cmdc_access_token
)
# 第二步查询站点对应的companyId
url1
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url1"
)
request_body1
=
commonFuc
().
get_business_data
(
module
,
"payload1"
)
result1
=
requests
.
post
(
url1
,
json
=
request_body1
,
headers
=
headers
)
result1
=
json
.
loads
(
result1
.
text
)
"""
场景:站点不拥有快速下单权限入口
用例名称:快速下单权限判定接口-站点满足条件显示快速下单入口
输入:companyId
输出:"quickOrderSign": 0
"""
# 发送请求
result1
=
requests
.
post
(
url1
,
json
=
request_body1
,
headers
=
headers
)
result1
=
json
.
loads
(
result1
.
text
)
# 获取站点对应的快速下单标识字段quickOrderSign
result1
=
result1
[
"data"
]
...
...
air_case/cmdc_query_customer/客户查询.air/客户查询.py
View file @
bd40d9ea
...
...
@@ -14,14 +14,16 @@ import json
module
=
"cmdc_query_customer"
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url"
)
# print(url)
# 获取登录所需账号密码
username
=
commonFuc
().
get_business_data
(
module
,
"username"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password"
)
# 获取登录后Cmdc_access_token
cmdc_access_token
=
CmdcDoLogin
(
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
,
"url"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload1"
)
"""
...
...
air_case/cmdc_userinfo_query/用户信息查询.air/用户信息查询.py
View file @
bd40d9ea
...
...
@@ -15,14 +15,15 @@ import json
module
=
"cmdc_userinfo_query"
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url1"
)
print
(
url
)
# 获取登录所需账号密码
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_headers"
,
cmdc_access_token
)
# 进行用户信息查询
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url1"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload1"
)
"""
...
...
air_case/cmdc_website/站点切换.air/站点切换.py
View file @
bd40d9ea
...
...
@@ -15,7 +15,6 @@ import json
module
=
"cmdc_website"
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url2"
)
# print(url)
# 获取登录所需账号密码
username
=
commonFuc
().
get_business_data
(
module
,
"username1"
)
...
...
@@ -23,6 +22,9 @@ password = commonFuc().get_business_data(module, "password1")
# 获取登录后Cmdc_access_token
cmdc_access_token
=
CmdcMaiiLogin
(
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
,
"url2"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload2"
)
"""
...
...
air_case/cmdc_website/获取站点信息.air/获取站点信息.py
View file @
bd40d9ea
...
...
@@ -15,7 +15,6 @@ import json
module
=
"cmdc_website"
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url1"
)
# print(url)
# 获取登录所需账号密码
username
=
commonFuc
().
get_business_data
(
module
,
"username"
)
...
...
@@ -23,6 +22,9 @@ 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_headers"
,
cmdc_access_token
)
# 获取站点信息
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url1"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload1"
)
"""
...
...
air_case/cmdc_website/获取站点商品.air/获取站点商品.py
View file @
bd40d9ea
...
...
@@ -21,6 +21,7 @@ password = commonFuc().get_business_data(module, "password1")
# 获取登录后Cmdc_access_token
cmdc_access_token
=
CmdcMaiiLogin
(
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
,
"url2"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload2"
)
...
...
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