jenkins - 有没有办法通过詹金斯在电子邮件正文中显示失败测试的名称
问题描述
当詹金斯使用可编辑的电子邮件通知插件触发电子邮件时,我想在电子邮件正文中查看所有失败测试的名称。
我正在将 TestNg 与 selenium+java 一起使用。
解决方案
您可以在测试中添加魅力报告,并通过 emial 发送魅力链接或文件,如下代码所示:
stage('Create properties file for allure') {
steps {
sh '''
export CHATBOT_ENV
touch allure-results/environment.properties
'''
}
}
stage('Allure reports') {
steps {
script {
allure([
includeProperties: true,
jdk: '',
properties: [],
reportBuildPolicy: 'ALWAYS',
results: [[path: 'allure-results/']]
])
}
}
}
}
post
{
always
{
echo 'This will always run'
emailext body: "Build URL: ${BUILD_URL}",
attachmentsPattern: "**/path_to_your_report",
subject: "$currentBuild.currentResult-$JOB_NAME",
to: 'nobody@optum.com'
}
}
}
构建 URL 可用于导航到诱惑报告。
推荐阅读
- azure - Azure Pipeline 完成后看不到我的构建工件
- arrays - 在反应数组中推送json对象
- javascript - 仅针对特定目录将 SVG Loader 添加到 Vue-cli 项目
- ios - 将 UIViewController 添加为子视图后取消初始化 UIViewController
- firebase - 如何从 Gitlab CD 部署 firebase 网站?
- r - 来自 metafor 的 replmiss 不起作用 - 仍然有 NA
- c# - 如何在没有 If/Else 或 Try/Catch 的情况下在 C#/MVC 中传播空实例?
- linux - 空的bash变量吃掉下一个的开始?
- python - 用两个变量绘制熊猫 df
- swift - 如何仅在 SonarCloud 上导入外部问题