Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
gm-zhuanzhen-test
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘丙寅
gm-zhuanzhen-test
Commits
4a74035a
Commit
4a74035a
authored
Aug 12, 2021
by
刘丙寅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
注释报警
parent
cbfa6aba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
41 deletions
+41
-41
allcase.py
allcase.py
+41
-41
No files found.
allcase.py
View file @
4a74035a
...
@@ -135,44 +135,44 @@ if __name__ == "__main__":
...
@@ -135,44 +135,44 @@ if __name__ == "__main__":
# 生成测试报告的路径
# 生成测试报告的路径
error_count
,
failure_count
=
run_case
(
all_case
)
# 2执行用例
error_count
,
failure_count
=
run_case
(
all_case
)
# 2执行用例
bug_number
=
int
(
error_count
)
+
int
(
failure_count
)
bug_number
=
int
(
error_count
)
+
int
(
failure_count
)
#
if bug_number!=0:
if
bug_number
!=
0
:
#
# 获取最新的测试报告文件
# 获取最新的测试报告文件
#
report_path = os.path.join(cur_path, "report") # 用例文件夹
report_path
=
os
.
path
.
join
(
cur_path
,
"report"
)
# 用例文件夹
#
#
report_file = get_report_file(report_path) # 3获取最新的测试报告
report_file
=
get_report_file
(
report_path
)
# 3获取最新的测试报告
#
# #邮箱配置 发送邮箱的地址
# #邮箱配置 发送邮箱的地址
#
# sender = "l709188456@163.com"
# sender = "l709188456@163.com"
#
sender = "liubingyin@igengmei.com"
sender
=
"liubingyin@igengmei.com"
#
#邮箱密码
#邮箱密码
#
#psw = "3328378"
#psw = "3328378"
#
psw = "cgBP3fw2ZNgp3L5r"
psw
=
"cgBP3fw2ZNgp3L5r"
#
# 163服务器的servers
# 163服务器的servers
#
#smtp_server = "smtp.163.com"
#smtp_server = "smtp.163.com"
#
#公司地址的服务器server
#公司地址的服务器server
#
smtp_server = "smtp.exmail.qq.com"
smtp_server
=
"smtp.exmail.qq.com"
#
port = 465
port
=
465
#
#发给谁的邮箱
#发给谁的邮箱
#
receiver = ["liubingyin@igengmei.com", "chenxiangxiang@igengmei.com"]
receiver
=
[
"liubingyin@igengmei.com"
,
"chenxiangxiang@igengmei.com"
]
#
send_mail(sender, psw, receiver, smtp_server, report_file, port) # 4最后一步发送报告
send_mail
(
sender
,
psw
,
receiver
,
smtp_server
,
report_file
,
port
)
# 4最后一步发送报告
#
dd_url = "https://oapi.dingtalk.com/robot/send?access_token=4aa12245f7b6c273dde43c4a547b386cd12dc59f22a475f2efbd494094be15b9"
#
dd_url = "https://oapi.dingtalk.com/robot/send?access_token=4aa12245f7b6c273dde43c4a547b386cd12dc59f22a475f2efbd494094be15b9"
#
text = "监控报警:接口出现异常,请查看邮件排查问题"
#
text = "监控报警:接口出现异常,请查看邮件排查问题"
#
json_text = {
#
json_text = {
#
"msgtype": "text",
#
"msgtype": "text",
#
"at": {
#
"at": {
#
"atMobiles": [
#
"atMobiles": [
#
# 变为所有人 这里要改
#
# 变为所有人 这里要改
#
"all"
#
"all"
#
],
#
],
#
# 变为true 就会@所有人
#
# 变为true 就会@所有人
#
#"isAtAll": False
#
#"isAtAll": False
#
"isAtAll": True
#
"isAtAll": True
#
},
#
},
#
"text": {
#
"text": {
#
"content": text
#
"content": text
#
}
#
}
#
}
#
}
#
#
#
requests.post(url=dd_url, json=json_text, verify=False)
#
requests.post(url=dd_url, json=json_text, verify=False)
#
#
else:
else
:
#
print("无问题 不发送测试报告哦")
print
(
"无问题 不发送测试报告哦"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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