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
7a70c60b
Commit
7a70c60b
authored
Mar 05, 2024
by
liguangyu06
Browse files
优化
parent
6dcbcf33
Changes
2
Hide whitespace changes
Inline
Side-by-side
air_case/cmdc_website/获取站点退货地址信息.air/获取站点退货地址信息.py
View file @
7a70c60b
...
...
@@ -8,6 +8,7 @@ case_tag:cmdc_api,cmdc获取站点退货地址信息,2256,2256-14,sit,bs
from
common.common_func
import
commonFuc
from
air_case.cmdc_login.后台管理系统登录.后台管理系统登录
import
CmdcDoLogin
from
common.db.db
import
mySql
import
requests
import
random
import
json
...
...
@@ -51,13 +52,22 @@ api_time = float(result.elapsed.total_seconds())
# 获取站点退货信息
result
=
json
.
loads
(
result
.
content
)
# print(result)
result
=
{
"data"
:
result
[
"data"
]}
result
=
{
"data"
:
len
(
result
[
"data"
]
)
}
# print(result)
# 将接口响应时间添加至result
result
[
"api_time"
]
=
api_time
# 数据库操作
mysql_handle
=
mySql
()
# 获取conf.ini文件中配置的数据库信息
host
,
port
,
user
,
pwd
=
mysql_handle
.
getConf
(
db
=
"cmdc_db"
)
# 查询数据库中退货地址信息
sql
=
"SELECT count(t.returnAddressId) FROM `cmdc-user`.cmdc_return_address t WHERE companyCode = 00102"
total
=
mysql_handle
.
selectSql
(
host
,
port
,
user
,
pwd
,
"cmdc-user"
,
sql
)[
0
][
0
]
# 获取预期结果
check_dict
=
commonFuc
().
get_business_data
(
module
,
"checkDict14"
)
check_dict
=
commonFuc
().
get_business_data
(
module
,
"checkDict14"
,
total
)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc
().
check_result
(
check_dict
,
result
)
data/cmdc_website/data
View file @
7a70c60b
...
...
@@ -110,7 +110,7 @@ checkDict13: {"companyId":"%s"}
"url14": "/user/public/getReturnAddressList"
"payload14": {"companyId":"%s"}
#预期结果
checkDict14: {"data":
[]
}
checkDict14: {"data":
"%s"
}
#测试场景15:获取公司站点信息
"url15": "/cms/public/website/queryListByCompanyId"
...
...
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