Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加Jenkins报告链接配置 #200

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions httpfpt/core/conf.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ name = 'test_project'
[report]
title = "自动化测试报告"
tester_name = '123'
# jenkins allure
jenkins_url = 'https://foryourself'

# mysql 数据库
[mysql]
Expand Down
1 change: 1 addition & 0 deletions httpfpt/core/get_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def __init__(self) -> None:
# 测试报告
self.TEST_REPORT_TITLE = glom(self.settings, 'report.title')
self.TESTER_NAME = glom(self.settings, 'report.tester_name')
self.JENKINS_URL = glom(self.settings, 'report.jenkins_url')

# mysql 数据库
self.MYSQL_HOST = glom(self.settings, 'mysql.host')
Expand Down
4 changes: 2 additions & 2 deletions httpfpt/templates/email_notification.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title> HttpFpt Run Exception </title>
<title> HTTPFPT Run Exception </title>
</head>
<body>
<div style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif;
Expand All @@ -20,7 +20,7 @@
color: #fff;
background-color: #ff5757;
padding: 20px;">
<span style="margin:20px;display:block;"> HttpFpt 运行异常通知 </span>
<span style="margin:20px;display:block;"> HTTPFPT 运行异常通知 </span>
</div>
<div style="margin: 30px 20px;">
<p>测试运行异常,报错信息如下:</p>
Expand Down
2 changes: 1 addition & 1 deletion httpfpt/utils/send_report/dingding.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def send(self) -> None:
f"> ⚠️ 跳过用例: {self.content['skipped']}\n\n"
f"> ⌛ 开始时间: {self.content['started_time']}\n\n"
f"> ⏱️ 执行耗时: {self.content['elapsed']}\n\n"
f"> ➡️ [查看详情](https://foryourself)",
f"> ➡️ [查看详情]({httpfpt_config.JENKINS_URL})",
},
}
response = requests.session().post(
Expand Down
2 changes: 1 addition & 1 deletion httpfpt/utils/send_report/feishu.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def send(self) -> None:
[{'tag': 'text', 'text': f"⚠️ 跳过用例: {self.content['skipped']}"}],
[{'tag': 'text', 'text': f"⌛ 开始时间: {self.content['started_time']}"}],
[{'tag': 'text', 'text': f"⏱️ 执行耗时: {self.content['elapsed']}"}],
[{'tag': 'a', 'text': '➡️ 查看详情', 'href': 'https://foryourself'}],
[{'tag': 'a', 'text': '➡️ 查看详情', 'href': f'{httpfpt_config.JENKINS_URL}'}],
],
}
}
Expand Down
2 changes: 1 addition & 1 deletion httpfpt/utils/send_report/wechat.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def send(self) -> None:
f"> ⚠️ 跳过用例: **{self.content['skipped']}**\n"
f"> ⌛ 开始时间: **{self.content['started_time']}**\n"
f"> ⏱️ 执行耗时: **{self.content['elapsed']}**\n"
"> ➡️ 查看报告: [点击跳转](https://foryourself)"
f"> ➡️ 查看报告: [点击跳转]({httpfpt_config.JENKINS_URL})"
},
}
response = requests.session().post(
Expand Down
Loading