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-spd
Commits
7853114f
Commit
7853114f
authored
Feb 02, 2024
by
xiao-hesheng
Browse files
基础设置模块-运维管理-消息类型脚本编写
parent
789f7b87
Changes
6
Hide whitespace changes
Inline
Side-by-side
air_case/b2_herp3_bs/n0运维管理_操作日志_列表查询_条件查询_精确查询.air/n0运维管理_操作日志_列表查询_条件查询_精确查询.py
View file @
7853114f
...
...
@@ -12,8 +12,8 @@ from common.timeUtils import timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,n0运维管理_操作日志_列表查询_条件查询,id2263,id2263-152,sit,on
内网:n0运维管理_操作日志_列表查询_条件查询
case_tag:api,herp-web,n0运维管理_操作日志_列表查询_条件查询
_精确查询
,id2263,id2263-152,sit,on
内网:n0运维管理_操作日志_列表查询_条件查询
_精确查询
"""
from
common.common_func
import
commonFuc
...
...
air_case/b2_herp3_bs/n5运维管理_消息通知模板_消息类型_新增消息模板.air/n5运维管理_消息通知模板_消息类型_新增消息模板.py
View file @
7853114f
...
...
@@ -40,7 +40,7 @@ def test1():
# from m2运维管理_PDA授权_列表查询获取id import test1
# id1, lastModified, createTime = test1()
# print(id1, lastModified, createTime)
#n
4
运维管理_消息通知模板_消息类型_新增
类型
#n
5
运维管理_消息通知模板_消息类型_新增
消息模板
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"message_template_save_url"
)
# 获取请求头信息
...
...
air_case/b2_herp3_bs/n5运维管理_消息通知模板_消息类型_新增类型_重复新增.air/n5运维管理_消息通知模板_消息类型_新增类型_重复新增.py
0 → 100644
View file @
7853114f
# -*- encoding=utf8 -*-
import
sys
from
airtest.core.helper
import
using
from
common.db.sql.sql_del_branch_info
import
delData
from
common.db.sql.sql_del_kind_goodsinfo
import
delKindGoodsinfo
from
common.db.sql.sql_del_notices_info
import
delByNoticeName
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,n5运维管理_消息通知模板_消息类型_新增类型_重复新增,id2263,id2263-158,sit,on
内网:n5运维管理_消息通知模板_消息类型_新增类型_重复新增
"""
from
common.common_func
import
commonFuc
from
air_case.b1_herp3_login.登录内网系统.登录内网系统
import
login_system
module
=
"b2_herp3_bs"
def
test1
():
"""
场景:n5运维管理_消息通知模板_消息类型_新增类型_重复新增
用例名称:n5运维管理_消息通知模板_消息类型_新增类型_重复新增
输入:无
输出:"rtn_msg": {"code": 2010, "msg":消息类型编码已存在! , "data": 1}
"""
#内网登录
username
=
commonFuc
().
get_business_data
(
module
,
"username"
)
# # print('医院名称',username)
password
=
commonFuc
().
get_business_data
(
module
,
"password"
)
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
token
,
projectCode
,
uxid
,
corpId
,
info
=
login_system
(
username
,
password
).
get_token
()
# print( token,projectCode,uxid,corpId,info)
# pro_path = commonFuc().get_pro_path()
# sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\m2运维管理_PDA授权_列表查询获取id.air')
# using(pro_path + r'\\air_case\\b2_herp3_bs\\m2运维管理_PDA授权_列表查询获取id.air')
# from m2运维管理_PDA授权_列表查询获取id import test1
# id1, lastModified, createTime = test1()
# print(id1, lastModified, createTime)
#n5运维管理_消息通知模板_消息类型_新增类型_重复新增
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"message_template_saveType_url"
)
# 获取请求头信息
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers2"
,
commonFuc
().
get_business_data
(
module
,
"json_contentType"
),
token
,
commonFuc
().
get_business_data
(
module
,
"X-APP-CODE"
))
# branch_id = FileUtils().r_info(module, '院区新增')["branch_id"]
# str = commonFuc().get_business_data(module, 'data7')
# list2 = list(str.split(","))
# print(list2)
# #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_hms(2)
# for i in list2:
# #请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload57"
)
# # # 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'resultaaaaaaaaaaaaaaaaaaaaaaaaaaa'
,
result
)
#断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
msg
=
commonFuc
().
analysis_json
(
'msg'
,
result
)
# print(msg)
if
code
==
2010
and
msg
==
"消息类型编码已存在!"
:
commonFuc
().
check_text_exist
(
2010
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
air_case/b2_herp3_bs/n6运维管理_消息通知模板_消息类型_新增消息模板_重复新增.air/n6运维管理_消息通知模板_消息类型_新增消息模板_重复新增.py
0 → 100644
View file @
7853114f
# -*- encoding=utf8 -*-
import
sys
from
airtest.core.helper
import
using
from
common.db.sql.sql_del_branch_info
import
delData
from
common.db.sql.sql_del_kind_goodsinfo
import
delKindGoodsinfo
from
common.db.sql.sql_del_notices_info
import
delByNoticeName
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,n6运维管理_消息通知模板_消息类型_新增消息模板_重复新增,id2263,id2263-159,sit,on
内网:n6运维管理_消息通知模板_消息类型_新增消息模板_重复新增
"""
from
common.common_func
import
commonFuc
from
air_case.b1_herp3_login.登录内网系统.登录内网系统
import
login_system
module
=
"b2_herp3_bs"
def
test1
():
"""
场景:n6运维管理_消息通知模板_消息类型_新增消息模板_重复新增
用例名称:n6运维管理_消息通知模板_消息类型_新增消息模板_重复新增
输入:无
输出:"rtn_msg": {"code": 2010, "msg": 模板名称已存在!", "data": 1}
"""
#内网登录
username
=
commonFuc
().
get_business_data
(
module
,
"username"
)
# # print('医院名称',username)
password
=
commonFuc
().
get_business_data
(
module
,
"password"
)
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
token
,
projectCode
,
uxid
,
corpId
,
info
=
login_system
(
username
,
password
).
get_token
()
# print( token,projectCode,uxid,corpId,info)
# pro_path = commonFuc().get_pro_path()
# sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\m2运维管理_PDA授权_列表查询获取id.air')
# using(pro_path + r'\\air_case\\b2_herp3_bs\\m2运维管理_PDA授权_列表查询获取id.air')
# from m2运维管理_PDA授权_列表查询获取id import test1
# id1, lastModified, createTime = test1()
# print(id1, lastModified, createTime)
#n6运维管理_消息通知模板_消息类型_新增消息模板_重复新增
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"message_template_save_url"
)
# 获取请求头信息
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers2"
,
commonFuc
().
get_business_data
(
module
,
"json_contentType"
),
token
,
commonFuc
().
get_business_data
(
module
,
"X-APP-CODE"
))
# branch_id = FileUtils().r_info(module, '院区新增')["branch_id"]
# str = commonFuc().get_business_data(module, 'data7')
# list2 = list(str.split(","))
# print(list2)
# #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_hms(2)
# for i in list2:
# #请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload57_1"
)
# # # 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'resultaaaaaaaaaaaaaaaaaaaaaaaaaaa'
,
result
)
#断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
msg
=
commonFuc
().
analysis_json
(
'msg'
,
result
)
# print(pageSize)
if
code
==
2010
and
msg
==
"模板名称已存在!"
:
commonFuc
().
check_text_exist
(
2010
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
data/b2_herp3_bs/data
View file @
7853114f
...
...
@@ -349,6 +349,7 @@ json_headers2: {
"payload56_5": {"pageNum":1,"pageSize":50,"orderBy":"create_time desc","queryObject":{"projectCode":"herp.","operObjectName":"系统配置信息表","operType":"%s","branchId":"h0347-2011","date1":"%s","date2":"%s"}}
"payload56_6": {"pageNum":1,"pageSize":"%s","orderBy":"create_time desc","queryObject":{"projectCode":"","operObjectName":"","operType":"","branchId":"h0347-2011","date1":null,"date2":null}}
"payload57": {"corpId":"h0347","pid":"EXPIRATION_WARNING","projectCode":"herp","templateTypeCode":"test1","templateTypeName":"test1"}
"payload57_1": {"corpId":"h0347","projectCode":"herp","templateName":"test1","channelType":"7","title":"test1","content":"test1","url":"","tbStatus":1,"messageType":"test1"}
checkDict: {"code": 0,'msg': None,'data': True}
checkDict1: {
...
...
report/summary.html
View file @
7853114f
...
...
@@ -72,9 +72,9 @@
</tr>
<tr
width=
"600"
>
<td
class=
"details-col-elapsed"
><a
href=
'../log/n
4
运维管理_消息通知模板_消息类型_新增
类型
/log.html'
target=
'_blank'
>
n
4
运维管理_消息通知模板_消息类型_新增
类型
</a></td>
<td
class=
"details-col-elapsed"
><a
href=
'../log/n
6
运维管理_消息通知模板_消息类型_新增
消息模板_重复新增
/log.html'
target=
'_blank'
>
n
6
运维管理_消息通知模板_消息类型_新增
消息模板_重复新增
</a></td>
<td
class=
"success"
>
成功
</td>
<td
class=
"details-col-elapsed"
>
1.3
85
</td>
<td
class=
"details-col-elapsed"
>
1.3
77
</td>
<td
class=
"details-col-elapsed"
>
xiaohesheng
</td>
</tr>
...
...
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