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
38ccd7f9
Commit
38ccd7f9
authored
1 year ago
by
liguangyu06
Browse files
Options
Download
Email Patches
Plain Diff
优化
parent
71075936
main
master
1 merge request
!6
Master|代码更新归档
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
air_case/cmdc_product/产品线分配制单员功能验证.air/产品线分配制单员功能验证.py
+2
-2
air_case/cmdc_product/产品线分配制单员功能验证.air/产品线分配制单员功能验证.py
air_case/cmdc_product/列表查询条件验证_商品列表_库存配置.air/列表查询条件验证_商品列表_库存配置.py
+4
-4
...cmdc_product/列表查询条件验证_商品列表_库存配置.air/列表查询条件验证_商品列表_库存配置.py
air_case/cmdc_product/列表查询条件验证_商品属性列表.air/列表查询条件验证_商品属性列表.py
+2
-2
air_case/cmdc_product/列表查询条件验证_商品属性列表.air/列表查询条件验证_商品属性列表.py
air_case/cmdc_product/列表查询条件验证_库存配置列表.air/列表查询条件验证_库存配置列表.py
+2
-2
air_case/cmdc_product/列表查询条件验证_库存配置列表.air/列表查询条件验证_库存配置列表.py
air_case/cmdc_product/发货时间规则启用用功能验证.air/发货时间规则启用用功能验证.py
+2
-2
air_case/cmdc_product/发货时间规则启用用功能验证.air/发货时间规则启用用功能验证.py
air_case/cmdc_product/查询条件验证_产品线管理.air/查询条件验证_产品线管理.py
+2
-2
air_case/cmdc_product/查询条件验证_产品线管理.air/查询条件验证_产品线管理.py
air_case/cmdc_product/查询条件验证_产品线详情.air/查询条件验证_产品线详情.py
+2
-2
air_case/cmdc_product/查询条件验证_产品线详情.air/查询条件验证_产品线详情.py
air_case/cmdc_product/查询条件验证_商品限购列表.air/查询条件验证_商品限购列表.py
+3
-3
air_case/cmdc_product/查询条件验证_商品限购列表.air/查询条件验证_商品限购列表.py
air_case/cmdc_product/模糊查询客户信息.air/模糊查询客户信息.py
+3
-3
air_case/cmdc_product/模糊查询客户信息.air/模糊查询客户信息.py
air_case/cmdc_product/获取产品线制单员列表.air/获取产品线制单员列表.py
+3
-3
air_case/cmdc_product/获取产品线制单员列表.air/获取产品线制单员列表.py
air_case/cmdc_product/获取制单员或者业务员列表.air/获取制单员或者业务员列表.py
+3
-3
air_case/cmdc_product/获取制单员或者业务员列表.air/获取制单员或者业务员列表.py
air_case/cmdc_product/获取商品属性列表.air/获取商品属性列表.py
+3
-3
air_case/cmdc_product/获取商品属性列表.air/获取商品属性列表.py
air_case/cmdc_product/获取属性值配置列表.air/获取属性值配置列表.py
+2
-2
air_case/cmdc_product/获取属性值配置列表.air/获取属性值配置列表.py
air_case/cmdc_product/获取库存配置详情.air/获取库存配置详情.py
+2
-2
air_case/cmdc_product/获取库存配置详情.air/获取库存配置详情.py
data/cmdc_product/data
+4
-4
data/cmdc_product/data
with
39 additions
and
39 deletions
+39
-39
air_case/cmdc_product/产品线分配制单员功能验证.air/产品线分配制单员功能验证.py
+
2
-
2
View file @
38ccd7f9
...
...
@@ -15,8 +15,8 @@ import json
module
=
"cmdc_product"
# 第一步登录获取登录所需账号密码
username
=
commonFuc
().
get_business_data
(
module
,
"username
1
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
1
"
)
username
=
commonFuc
().
get_business_data
(
module
,
"username
2
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
2
"
)
# 获取登录后Cmdc_access_token
cmdc_access_token
=
CmdcDoLogin
(
username
,
password
).
get_token
()
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers"
,
cmdc_access_token
)
...
...
This diff is collapsed.
Click to expand it.
air_case/cmdc_product/列表查询条件验证_商品列表_库存配置.air/列表查询条件验证_商品列表_库存配置.py
+
4
-
4
View file @
38ccd7f9
...
...
@@ -16,19 +16,19 @@ import json
module
=
"cmdc_product"
# 获取登录所需账号密码
username
=
commonFuc
().
get_business_data
(
module
,
"username
1
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
1
"
)
username
=
commonFuc
().
get_business_data
(
module
,
"username
2
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
2
"
)
# 获取登录后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
,
"url20"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload20"
)
# 发送请求
result
=
requests
.
post
(
url
,
json
=
request_body
,
headers
=
headers
)
result
=
json
.
loads
(
result
.
content
)
# print(result)
# 生成一个随机数字,用于后续随机选择某一条商品属性信息
rebate_random
=
random
.
randint
(
0
,
len
(
result
[
"data"
][
"list"
])
-
1
)
# 获取商品信息
...
...
This diff is collapsed.
Click to expand it.
air_case/cmdc_product/列表查询条件验证_商品属性列表.air/列表查询条件验证_商品属性列表.py
+
2
-
2
View file @
38ccd7f9
...
...
@@ -17,8 +17,8 @@ module = "cmdc_product"
# 第一步登录后台运营平台获取cmdc_access_token
# 获取登录所需账号密码
username
=
commonFuc
().
get_business_data
(
module
,
"username
1
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
1
"
)
username
=
commonFuc
().
get_business_data
(
module
,
"username
2
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
2
"
)
# 获取登录后Cmdc_access_token
cmdc_access_token
=
CmdcDoLogin
(
username
,
password
).
get_token
()
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers"
,
cmdc_access_token
)
...
...
This diff is collapsed.
Click to expand it.
air_case/cmdc_product/列表查询条件验证_库存配置列表.air/列表查询条件验证_库存配置列表.py
+
2
-
2
View file @
38ccd7f9
...
...
@@ -16,8 +16,8 @@ import json
module
=
"cmdc_product"
# 获取登录所需账号密码
username
=
commonFuc
().
get_business_data
(
module
,
"username
1
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
1
"
)
username
=
commonFuc
().
get_business_data
(
module
,
"username
2
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
2
"
)
# 获取登录后Cmdc_access_token
cmdc_access_token
=
CmdcDoLogin
(
username
,
password
).
get_token
()
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers"
,
cmdc_access_token
)
...
...
This diff is collapsed.
Click to expand it.
air_case/cmdc_product/发货时间规则启用用功能验证.air/发货时间规则启用用功能验证.py
+
2
-
2
View file @
38ccd7f9
...
...
@@ -15,8 +15,8 @@ import json
module
=
"cmdc_product"
# 获取登录所需账号密码
username
=
commonFuc
().
get_business_data
(
module
,
"username
1
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
1
"
)
username
=
commonFuc
().
get_business_data
(
module
,
"username
2
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
2
"
)
# 获取登录后Cmdc_access_token
cmdc_access_token
=
CmdcDoLogin
(
username
,
password
).
get_token
()
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers"
,
cmdc_access_token
)
...
...
This diff is collapsed.
Click to expand it.
air_case/cmdc_product/查询条件验证_产品线管理.air/查询条件验证_产品线管理.py
+
2
-
2
View file @
38ccd7f9
...
...
@@ -15,8 +15,8 @@ import json
module
=
"cmdc_product"
# 获取登录所需账号密码
username
=
commonFuc
().
get_business_data
(
module
,
"username
1
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
1
"
)
username
=
commonFuc
().
get_business_data
(
module
,
"username
2
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
2
"
)
# 获取登录后Cmdc_access_token
cmdc_access_token
=
CmdcDoLogin
(
username
,
password
).
get_token
()
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers"
,
cmdc_access_token
)
...
...
This diff is collapsed.
Click to expand it.
air_case/cmdc_product/查询条件验证_产品线详情.air/查询条件验证_产品线详情.py
+
2
-
2
View file @
38ccd7f9
...
...
@@ -15,8 +15,8 @@ import json
module
=
"cmdc_product"
# 获取登录所需账号密码
username
=
commonFuc
().
get_business_data
(
module
,
"username
1
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
1
"
)
username
=
commonFuc
().
get_business_data
(
module
,
"username
2
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
2
"
)
# 获取登录后Cmdc_access_token
cmdc_access_token
=
CmdcDoLogin
(
username
,
password
).
get_token
()
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers"
,
cmdc_access_token
)
...
...
This diff is collapsed.
Click to expand it.
air_case/cmdc_product/查询条件验证_商品限购列表.air/查询条件验证_商品限购列表.py
+
3
-
3
View file @
38ccd7f9
...
...
@@ -15,8 +15,8 @@ import json
module
=
"cmdc_product"
# 获取登录所需账号密码
username
=
commonFuc
().
get_business_data
(
module
,
"username
1
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
1
"
)
username
=
commonFuc
().
get_business_data
(
module
,
"username
2
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
2
"
)
# 获取登录后Cmdc_access_token
cmdc_access_token
=
CmdcDoLogin
(
username
,
password
).
get_token
()
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers"
,
cmdc_access_token
)
...
...
@@ -27,7 +27,7 @@ request_body = commonFuc().get_business_data(module, "payload41")
# 发送请求
result
=
requests
.
get
(
url
,
params
=
request_body
,
headers
=
headers
)
result
=
json
.
loads
(
result
.
content
)
# print(result)
# 生成随机数
product_random
=
random
.
randint
(
0
,
len
(
result
[
"data"
][
"list"
])
-
1
)
# 获取商品限购信息
...
...
This diff is collapsed.
Click to expand it.
air_case/cmdc_product/模糊查询客户信息.air/模糊查询客户信息.py
+
3
-
3
View file @
38ccd7f9
...
...
@@ -15,14 +15,14 @@ import json
module
=
"cmdc_product"
# 获取登录所需账号密码
username
=
commonFuc
().
get_business_data
(
module
,
"username
1
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
1
"
)
username
=
commonFuc
().
get_business_data
(
module
,
"username
2
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
2
"
)
# 获取登录后Cmdc_access_token
cmdc_access_token
=
CmdcDoLogin
(
username
,
password
).
get_token
()
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers"
,
cmdc_access_token
)
# 模糊查询字段
customer_msg
=
"
湖南
"
customer_msg
=
"
广州
"
# 进行客户信息模糊查询
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url15"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload15"
,
customer_msg
)
...
...
This diff is collapsed.
Click to expand it.
air_case/cmdc_product/获取产品线制单员列表.air/获取产品线制单员列表.py
+
3
-
3
View file @
38ccd7f9
...
...
@@ -17,8 +17,8 @@ module = "cmdc_product"
# 第一步登录
# 获取登录所需账号密码
username
=
commonFuc
().
get_business_data
(
module
,
"username
1
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
1
"
)
username
=
commonFuc
().
get_business_data
(
module
,
"username
2
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
2
"
)
# 获取登录后Cmdc_access_token
cmdc_access_token
=
CmdcDoLogin
(
username
,
password
).
get_token
()
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers"
,
cmdc_access_token
)
...
...
@@ -65,7 +65,7 @@ host, port, user, pwd = mysql_handle.getConf(db="cmdc_db")
# 查询数据库中产品线对应制单员数量
sql
=
"SELECT count(t.id) FROM `cmdc-product`.ic_marker_member t "
\
"WHERE userId =
2795
and productLineCode = '{}'"
.
format
(
product_line_code
)
"WHERE userId =
114378
and productLineCode = '{}'"
.
format
(
product_line_code
)
total
=
mysql_handle
.
selectSql
(
host
,
port
,
user
,
pwd
,
"cmdc-product"
,
sql
)[
0
][
0
]
# 获取预期结果
...
...
This diff is collapsed.
Click to expand it.
air_case/cmdc_product/获取制单员或者业务员列表.air/获取制单员或者业务员列表.py
+
3
-
3
View file @
38ccd7f9
...
...
@@ -16,8 +16,8 @@ import json
module
=
"cmdc_product"
# 获取登录所需账号密码
username
=
commonFuc
().
get_business_data
(
module
,
"username
1
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
1
"
)
username
=
commonFuc
().
get_business_data
(
module
,
"username
2
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
2
"
)
# 获取登录后Cmdc_access_token
cmdc_access_token
=
CmdcDoLogin
(
username
,
password
).
get_token
()
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers"
,
cmdc_access_token
)
...
...
@@ -51,7 +51,7 @@ host, port, user, pwd = mysql_handle.getConf(db="cmdc_db")
# 查询数据库中对应制单员数量
sql
=
"SELECT count(t.userId) FROM `cmdc-user`.cmdc_user t "
\
"WHERE userType = 1 and companyId =
6
and deleteSign = 0 in"
\
"WHERE userType = 1 and companyId =
7
and deleteSign = 0 in"
\
"(SELECT t.userId FROM `cmdc-user`.cmdc_manager_user t)"
total
=
mysql_handle
.
selectSql
(
host
,
port
,
user
,
pwd
,
"cmdc-user"
,
sql
)[
0
][
0
]
...
...
This diff is collapsed.
Click to expand it.
air_case/cmdc_product/获取商品属性列表.air/获取商品属性列表.py
+
3
-
3
View file @
38ccd7f9
...
...
@@ -16,8 +16,8 @@ import json
module
=
"cmdc_product"
# 获取登录所需账号密码
username
=
commonFuc
().
get_business_data
(
module
,
"username
1
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
1
"
)
username
=
commonFuc
().
get_business_data
(
module
,
"username
2
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
2
"
)
# 获取登录后Cmdc_access_token
cmdc_access_token
=
CmdcDoLogin
(
username
,
password
).
get_token
()
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers"
,
cmdc_access_token
)
...
...
@@ -47,7 +47,7 @@ result = {"total": result["data"]["total"]}
result
[
"api_time"
]
=
api_time
# print(result)
# 查询数据库中对应公司对应的商品属性数量
sql
=
"SELECT count(t.productId) FROM `cmdc-product`.ic_product_properties t WHERE companyCode = 001
11
and deleteSign = 0"
sql
=
"SELECT count(t.productId) FROM `cmdc-product`.ic_product_properties t WHERE companyCode = 001
02
and deleteSign = 0"
total
=
mysql_handle
.
selectSql
(
host
,
port
,
user
,
pwd
,
"cmdc-product"
,
sql
)[
0
][
0
]
# 获取预期结果
...
...
This diff is collapsed.
Click to expand it.
air_case/cmdc_product/获取属性值配置列表.air/获取属性值配置列表.py
+
2
-
2
View file @
38ccd7f9
...
...
@@ -15,8 +15,8 @@ import json
module
=
"cmdc_product"
# 获取登录所需账号密码
username
=
commonFuc
().
get_business_data
(
module
,
"username
1
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
1
"
)
username
=
commonFuc
().
get_business_data
(
module
,
"username
2
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
2
"
)
# 获取登录后Cmdc_access_token
cmdc_access_token
=
CmdcDoLogin
(
username
,
password
).
get_token
()
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers"
,
cmdc_access_token
)
...
...
This diff is collapsed.
Click to expand it.
air_case/cmdc_product/获取库存配置详情.air/获取库存配置详情.py
+
2
-
2
View file @
38ccd7f9
...
...
@@ -16,8 +16,8 @@ import json
module
=
"cmdc_product"
# 获取登录所需账号密码
username
=
commonFuc
().
get_business_data
(
module
,
"username
1
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
1
"
)
username
=
commonFuc
().
get_business_data
(
module
,
"username
2
"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password
2
"
)
# 获取登录后Cmdc_access_token
cmdc_access_token
=
CmdcDoLogin
(
username
,
password
).
get_token
()
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers"
,
cmdc_access_token
)
...
...
This diff is collapsed.
Click to expand it.
data/cmdc_product/data
+
4
-
4
View file @
38ccd7f9
...
...
@@ -159,13 +159,13 @@ checkDict19: {"lineCode":"%s"}
#测试场景二十:获取商品列表_库存配置
"url20": "/product/public/getListed"
"payload20": {"pageNumber":10,"pageStart":1,"productCode":"","productName":"","userNo":"","companyCode":"001
11
","pageSize":10,"pageNum":1,"specifications":""}
"payload20": {"pageNumber":10,"pageStart":1,"productCode":"","productName":"","userNo":"","companyCode":"001
02
","pageSize":10,"pageNum":1,"specifications":""}
#预期结果
checkDict20: {"success":true,"code":"200","message":"OK"}
#测试场景二十一:列表查询条件验证_商品列表_库存配置
"url21": "/product/public/getListed"
"payload21": {"pageNumber":10,"pageStart":1,"productCode":"%s","productName":"%s","userNo":"","companyCode":"001
11
","pageSize":10,"pageNum":1,"specifications":"","total":1629}
"payload21": {"pageNumber":10,"pageStart":1,"productCode":"%s","productName":"%s","userNo":"","companyCode":"001
02
","pageSize":10,"pageNum":1,"specifications":"","total":1629}
#预期结果
checkDict21: {"productCode":"%s"}
...
...
@@ -556,13 +556,13 @@ checkDict76: {"success":false,"code":"200","message":"操作成功!","data":null
#测试场景七十七:获取产品线详情
"url77": "/product/back/queryProductLineDetail"
"payload77": {"productCode":"","productName":"","specifications":"","materialCode":"","manufacturer":"","pageNum":1,"pageSize":10,"productLineCode":"
3041
"}
"payload77": {"productCode":"","productName":"","specifications":"","materialCode":"","manufacturer":"","pageNum":1,"pageSize":10,"productLineCode":"
10052433
"}
#预期结果
checkDict77: {"success":true,"code":"200","message":"OK"}
#测试场景七十八:查询条件验证_产品线详情
"url78": "/product/back/queryProductLineDetail"
"payload78": {"productCode":"%s","productName":"%s","specifications":"%s","materialCode":"%s","manufacturer":"%s","pageNum":1,"pageSize":10,"productLineCode":"
3041
"}
"payload78": {"productCode":"%s","productName":"%s","specifications":"%s","materialCode":"%s","manufacturer":"%s","pageNum":1,"pageSize":10,"productLineCode":"
10052433
"}
#预期结果
checkDict78: {"productCode":"%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
Menu
Explore
Projects
Groups
Snippets