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
b165de3b
Commit
b165de3b
authored
Jan 25, 2024
by
周念东
Browse files
消息管理
parent
77e79513
Changes
3
Hide whitespace changes
Inline
Side-by-side
air_case/cmdc_message_noticelog/消息按公司代码查询公司选项.air/消息按公司代码查询公司选项.py
0 → 100644
View file @
b165de3b
# -*- encoding=utf8 -*-
__author__
=
"zhouniandong"
"""
case_tag:cmdc_api,cmdc消息按公司代码查询公司选项,2293,2293-3,sit,bs
主数据平台:运营后台管理系统消息管理接口
"""
from
common.common_func
import
commonFuc
from
air_case.cmdc_login.后台管理系统登录.后台管理系统登录
import
CmdcDoLogin
import
requests
import
json
module
=
"cmdc_message_noticelog"
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
=
CmdcDoLogin
(
username
,
password
).
get_token
()
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers"
,
cmdc_access_token
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload1"
)
"""
场景:消息管理()
用例名称:消息按公司代码查询公司选项(消息管理)
输出:{"success":true,"code":"200","message":"OK"}
"""
# 发送请求
result
=
requests
.
get
(
url
,
json
=
request_body
,
headers
=
headers
)
#print("\033[031mresult1============\033[0m",result)
result
=
json
.
loads
(
result
.
content
)
#print("\033[031mresult2============\033[0m",result)
# 获取预期结果
check_dict
=
commonFuc
().
get_business_data
(
module
,
"checkDict1"
)
print
(
"
\033
[031mcheck_dict============
\033
[0m"
,
check_dict
)
# 断言实际结果中是否包含预期结果的内容
commonFuc
().
check_result
(
check_dict
,
result
)
air_case/cmdc_message_noticelog/消息查询页面.air/消息查询页面.py
0 → 100644
View file @
b165de3b
# -*- encoding=utf8 -*-
__author__
=
"zhouniandong"
"""
case_tag:cmdc_api,cmdc消息查询页面,2293,2293-3,sit,bs
主数据平台:运营后台管理系统消息管理接口
"""
from
common.common_func
import
commonFuc
from
air_case.cmdc_login.后台管理系统登录.后台管理系统登录
import
CmdcDoLogin
import
requests
import
json
module
=
"cmdc_message_noticelog"
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url2"
)
#print(url)
# 获取登录所需账号密码
username
=
commonFuc
().
get_business_data
(
module
,
"username"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password"
)
print
(
"
\033
[031musername============
\033
[0m"
,
username
)
print
(
"
\033
[031mpassword============
\033
[0m"
,
password
)
# 获取登录后Cmdc_access_token
cmdc_access_token
=
CmdcDoLogin
(
username
,
password
).
get_token
()
print
(
"
\033
[031mcmdc_access_token============
\033
[0m"
,
cmdc_access_token
)
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers"
,
cmdc_access_token
)
print
(
"
\033
[031mheaders============
\033
[0m"
,
headers
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload2"
)
print
(
"
\033
[031mrequest_body
\033
[0m"
,
request_body
)
"""
场景:消息管理()
用例名称:消息查询页面(消息管理)
输出:{"success":true,"code":"200","message":"OK"}
"""
# 发送请求
result
=
requests
.
post
(
url
,
json
=
request_body
,
headers
=
headers
)
print
(
"
\033
[031mresult1============
\033
[0m"
,
result
)
result
=
json
.
loads
(
result
.
content
)
print
(
"
\033
[031mresult2============
\033
[0m"
,
result
)
# 获取预期结果
check_dict
=
commonFuc
().
get_business_data
(
module
,
"checkDict2"
)
print
(
"
\033
[031mcheck_dict============
\033
[0m"
,
check_dict
)
# 断言实际结果中是否包含预期结果的内容
commonFuc
().
check_result
(
check_dict
,
result
)
data/cmdc_message_noticelog/data
0 → 100644
View file @
b165de3b
#后台运营管理系统登录信息(上海公司)
"username": "Admin00111"
"password": "Aa123456"
json_headers: {
"Content-Type": "application/json",
"Cmdc_access_token": "%s"
}
#消息按公司代码查询公司选项
"url1": "/user/public/queryCompanyOptionsByCompanyCode"
"payload1":
#预期结果
checkDict1: {"success":true,"code":"200","message":"OK"}
#消息查询页面接口地址
"url2": "/cms/noticelog/queryPage"
"payload2": {"companyCode":"","title":"","pageNumber":1,"pageSize":10,"startTime":"","endTime":"","auditStatus":""}
#预期结果
checkDict2: {"success":true,"code":"200","message":"操作成功","data":{"pageNum":1,"pageSize":10,"size":0,"startRow":0,"endRow":0,"total":0,"pages":0,"list":[],"prePage":0,"nextPage":0,"isFirstPage":true,"isLastPage":true,"hasPreviousPage":false,"hasNextPage":false,"navigatePages":8,"navigatepageNums":[],"navigateFirstPage":0,"navigateLastPage":0,"firstPage":0,"lastPage":0},"freshToken":null}
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