[求助] 如何把 allure 的 index.html 所顯示的內容,展示在 jenkins 傳送的 Email 中?

strayeagle發表於2020-03-19

前言

如何把allure產生的index.html內容(報告在遠端Jenkins伺服器上),顯示在Jenkins傳送的Email中呢?

預期效果

但是目前顯示的效果如下:

說明:
上圖中error提示說檔案不存在,複製這個地址,是可以正常網路訪問的。

如何才能實現預期的效果呢?謝謝~~

Jenkins email html原始碼

<h2><center><font>This email generated by Jenkins, please do not reply!</font><center></h2>
<br>

<hr>
Product Version : ${PRODUCT_VERSION}<br>
Start Time : ${START_TIME}<br>
End Time : ${END_TIME}<br>
Duration Time : ${TIME_DURATION}(s)<br>
<br>

<span style="color: #000000;">Total Cases:&nbsp; &nbsp; ${TEST_COUNTS}</span><br>
<span style="color: #000000; background-color: #008000;">Pass&nbsp; Cases:&nbsp; &nbsp; ${TEST_PASS}</span><br>
<span style="color: #000000; background-color: #ffff00;">Fail&nbsp; &nbsp;Cases:&nbsp; &nbsp; ${TEST_FAIL}</span><br>
<span style="color: #000000; background-color: #3366ff;">Skip&nbsp; Cases:&nbsp; &nbsp; ${TEST_SKIP}</span><br>
<span style="color: #000000; background-color: #ff0000;">Broken Cases:&nbsp; &nbsp; ${TEST_BROKEN}</span><br>
<span style="color: #000000; background-color: #ff0000;">Unknown Cases:&nbsp; &nbsp; ${TEST_UNKNOWN}</span><br>

<br>
Project Name : ${PROJECT_NAME}<br>
Build Number : ${BUILD_NUMBER}<br>
Build Status : ${BUILD_STATUS}<br>
Trigger Reason : ${CAUSE}<br>
Build Address : <A HREF="${BUILD_URL}">${BUILD_URL}</A><br>
Build Log : <A HREF="${BUILD_URL}console">${BUILD_URL}console</A><br>
Allure Test Report : <A HREF="${PROJECT_URL}${BUILD_NUMBER}/allure">${PROJECT_URL}${BUILD_NUMBER}/allure</a><br>
<hr>

<div>
<table>
<tr>
<th><br />
<h2>Test Report</h2>
</th>
</tr>

<tr>
<td>
<div>${FILE,path="${PROJECT_URL}${BUILD_NUMBER}/allure/index.html"}</div>
</td>
</tr>

</table>
</div>

相關文章