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
090f6193
Commit
090f6193
authored
Jan 10, 2024
by
xiao-hesheng
Browse files
优化脚本
parent
2c951f6c
Changes
10
Hide whitespace changes
Inline
Side-by-side
air_case/b2_herp3_bs/a8_新增公告_全部.air/a8_新增公告_全部.py
View file @
090f6193
...
...
@@ -5,8 +5,8 @@ from common.timeUtils import timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a
20
_新增公告_
中心库
,id2263,id2263-
10
,sit,on
主数据平台:a
20
_新增公告_
中心库
case_tag:api,herp-web,a
8
_新增公告_
全部
,id2263,id2263-
8
,sit,on
主数据平台:a
8
_新增公告_
全部
"""
from
common.common_func
import
commonFuc
...
...
@@ -17,8 +17,8 @@ from common.fileUtls import FileUtils
module
=
"b2_herp3_bs"
def
add_notices
():
"""
场景:新增公告_
中心库
用例名称:a
20
_新增公告_
中心库
场景:
a8_
新增公告_
全部
用例名称:a
8
_新增公告_
全部
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": 1}
"""
...
...
@@ -31,7 +31,7 @@ def add_notices():
token
,
projectCode
,
uxid
,
corpId
,
info
=
login_system
(
username
,
password
).
get_token
()
# print( token,projectCode,uxid,corpId,info)
#a8_新增公告_全部
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"save_url"
)
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"save_url
1
"
)
print
(
url
)
# 获取请求头信息
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers2"
,
...
...
@@ -39,10 +39,11 @@ def add_notices():
commonFuc
().
get_business_data
(
module
,
"X-APP-CODE"
))
expireDate
=
timeUtils
().
get_time_add
(
30
)
title
=
"公告发布测试"
# print(expireDate)
#请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload3"
,
expireDate
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload3"
,
title
,
expireDate
,
title
)
print
(
'request_body'
,
request_body
)
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'result'
,
result
)
...
...
air_case/b2_herp3_bs/a9_新增公告_全院.air/a9_新增公告_全院.py
View file @
090f6193
...
...
@@ -38,9 +38,10 @@ def add_notices():
commonFuc
().
get_business_data
(
module
,
"X-APP-CODE"
))
expireDate
=
timeUtils
().
get_time_add
(
30
)
title
=
"公告发布测试"
+
commonFuc
().
randomString
(
5
)
# print(expireDate)
#请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload4"
,
expireDate
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload4"
,
title
,
expireDate
,
title
)
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
...
...
air_case/b2_herp3_bs/b0_新增公告_中心库.air/b0_新增公告_中心库.py
View file @
090f6193
...
...
@@ -38,8 +38,9 @@ def add_notices():
expireDate
=
timeUtils
().
get_time_add
(
30
)
# print(expireDate)
title
=
"公告发布测试"
+
commonFuc
().
randomString
(
5
)
#请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload5"
,
expireDate
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload5"
,
title
,
expireDate
,
title
)
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
...
...
air_case/b2_herp3_bs/b1_新增公告_供应商.air/b1_新增公告_供应商.py
View file @
090f6193
...
...
@@ -38,8 +38,9 @@ def add_notices():
expireDate
=
timeUtils
().
get_time_add
(
30
)
# print(expireDate)
title
=
"公告发布测试"
+
commonFuc
().
randomString
(
5
)
#请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload6"
,
expireDate
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload6"
,
title
,
expireDate
,
title
)
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
...
...
air_case/b2_herp3_bs/b6_删除公告.air/b6_删除公告.py
View file @
090f6193
...
...
@@ -15,7 +15,7 @@ from common.common_func import commonFuc
from
air_case.b1_herp3_login.登录内网系统.登录内网系统
import
login_system
module
=
"b2_herp3_bs"
def
modify
_notices
():
def
del
_notices
():
"""
场景:b6_删除公告
用例名称:b6_删除公告
...
...
@@ -52,6 +52,6 @@ def modify_notices():
checkDict
=
commonFuc
().
get_business_data
(
module
,
'checkDict2'
)
# #断言
commonFuc
().
check_result
(
checkDict
,
result
)
modify
_notices
()
del
_notices
()
#调用数据库处理类删除发布的公告,是逻辑删除
delByNoticeName
().
delete_ByNoticeName
()
air_case/b2_herp3_bs/g8_8修改产品价格_暂存.air/g8_8修改产品价格_暂存.py
View file @
090f6193
...
...
@@ -29,7 +29,7 @@ def test1():
"""
#内网登录
username
=
commonFuc
().
get_business_data
(
module
,
"username"
)
#
# print('医院名称',username)
# # print('医院名称',username)
password
=
commonFuc
().
get_business_data
(
module
,
"password"
)
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
...
...
common/common_func.py
View file @
090f6193
...
...
@@ -551,4 +551,14 @@ class commonFuc(object):
curPath
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
))
# 获取当前文件的所在目录的绝对路径
# print(os.path.split(curPath))
rootPath
=
os
.
path
.
split
(
curPath
)[
0
]
return
rootPath
\ No newline at end of file
return
rootPath
# 截图
def
getPhoto
(
self
,
chrome
):
import
time
# imgName = time.strftime("%Y%m%d_%H%M%S", time.localtime()) + ".png"
imgName
=
"info.png"
pro_path
=
self
.
get_pro_path
()
# 获取项目的根目录的路径
image_path
=
pro_path
+
"//log//"
+
imgName
chrome
.
get_screenshot_as_file
(
image_path
)
return
imgName
,
image_path
common/db/sql/sql_del_notices_info.py
View file @
090f6193
...
...
@@ -10,7 +10,7 @@ class delByNoticeName(object):
charset
=
"utf8"
)
cursor
=
connection
.
cursor
()
# 删除新增的院区数据,减少垃圾数据的产生,保证脚本下次还可以正常运行,接口脚本每次都使用新增数据
sql
=
"update sys_notice set del_flag=1 where title like '%
test
%';"
sql
=
"update sys_notice set del_flag=1 where title like '%
公告发布测试
%';"
print
(
sql
)
cursor
.
execute
(
sql
)
cursor
.
execute
(
"commit;"
)
...
...
data/b2_herp3_bs/data
View file @
090f6193
...
...
@@ -5,6 +5,7 @@
"page_url": "/hospitaltest2api/platformService/basic/branch/page/"
"edit_url": "/hospitaltest2api/platformService/basic/branch/edit/"
"save_url": "/hospitaltest2api/platformService/basic/notice/save"
"save_url1": "/hospitaltest2api/herpService/basic/notice/save"
"page_url1": "/hospitaltest2api/platformService/basic/notice/page"
"update_url": "/hospitaltest2api/platformService/basic/notice/update"
"del_url": "/hospitaltest2api/platformService/basic/notice/del/"
...
...
@@ -91,12 +92,12 @@ json_headers2: {
"ybFlag": "0",
"address": "东土城路院区"
}
"payload3": {"content":"
xhstest
","corpId":"h0347","expireDate":"%s","id":"","mgrRangeId":"","mgrRangeKind":"0","noticeType":1,"title":"
xhstest
","topFlag":"0"}
"payload4": {"content":"
xhstest
","corpId":"h0347","expireDate":"%s","id":"","mgrRangeId":"","mgrRangeKind":"1","noticeType":1,"title":"
xhstest
","topFlag":"0"}
"payload5": {"content":"
xhstest
","corpId":"h0347","expireDate":"%s","id":"","mgrRangeId":"","mgrRangeKind":"2","noticeType":1,"title":"
xhstest
","topFlag":"0"}
"payload6": {"content":"
xhstest
","corpId":"h0347","expireDate":"%s","id":"","mgrRangeId":"","mgrRangeKind":"3","noticeType":1,"title":"
xhstest
","topFlag":"0"}
"payload7": {"pageNum": 1,"pageSize": 50,"queryObject": {"title": "
xhstest
","mgrRangeKind": "","publishDateBegin": "", "publishDateEnd": "", "corpId": "h0347"}}
"payload8": {"pageNum": 1,"pageSize": 50,"queryObject": {"title": "
xhs
","mgrRangeKind": "","publishDateBegin": "", "publishDateEnd": "", "corpId": "h0347"}}
"payload3": {"content":"
%s
","corpId":"h0347","expireDate":"%s","id":"","mgrRangeId":"","mgrRangeKind":"0","noticeType":1,"title":"
%s
","topFlag":"0"}
"payload4": {"content":"
%s
","corpId":"h0347","expireDate":"%s","id":"","mgrRangeId":"","mgrRangeKind":"1","noticeType":1,"title":"
%s
","topFlag":"0"}
"payload5": {"content":"
%s
","corpId":"h0347","expireDate":"%s","id":"","mgrRangeId":"","mgrRangeKind":"2","noticeType":1,"title":"
%s
","topFlag":"0"}
"payload6": {"content":"
%s
","corpId":"h0347","expireDate":"%s","id":"","mgrRangeId":"","mgrRangeKind":"3","noticeType":1,"title":"
%s
","topFlag":"0"}
"payload7": {"pageNum": 1,"pageSize": 50,"queryObject": {"title": "
公告发布测试
","mgrRangeKind": "","publishDateBegin": "", "publishDateEnd": "", "corpId": "h0347"}}
"payload8": {"pageNum": 1,"pageSize": 50,"queryObject": {"title": "
公告发布
","mgrRangeKind": "","publishDateBegin": "", "publishDateEnd": "", "corpId": "h0347"}}
"payload9": {"pageNum": 1,"pageSize": 50,"queryObject": {"title": "不存在的公告","mgrRangeKind": "","publishDateBegin": "", "publishDateEnd": "", "corpId": "h0347"}}
"payload10": {"content": "%s","expireDate": "%s","mgrRangeId": "","title": "%supdate","id": "%s","topFlag": "0","mgrRangeKind": "1","corpId": "h0347","noticeType": 1}
"payload11": {"pageNum": 1,"pageSize": 50,"queryObject": {"hosId": "h0347","searchText": "p56a4","firmType": 1}}
...
...
report/summary.html
View file @
090f6193
...
...
@@ -56,7 +56,7 @@
<tr
width=
"600"
>
<td
class=
'details-col-elapsed'
>
1
</td>
<td
class=
'details-col-elapsed'
>
1
</td>
<td
class=
'details-col-elapsed'
>
0分
2
秒
</td>
<td
class=
'details-col-elapsed'
>
0分
0
秒
</td>
<td
class=
"details-col-elapsed"
>
100.0%
</td>
</tr>
</table>
...
...
@@ -72,9 +72,9 @@
</tr>
<tr
width=
"600"
>
<td
class=
"details-col-elapsed"
><a
href=
'../log/
g8_7添加产品列表_确定添加产品
/log.html'
target=
'_blank'
>
g8_7添加产品列表_确定添加产品
</a></td>
<td
class=
"details-col-elapsed"
><a
href=
'../log/
b6_删除公告
/log.html'
target=
'_blank'
>
b6_删除公告
</a></td>
<td
class=
"success"
>
成功
</td>
<td
class=
"details-col-elapsed"
>
2.508
</td>
<td
class=
"details-col-elapsed"
>
0.886
</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