TESTNG:如何通过电子邮件发送可通过电子邮件发送的报告 [英] TESTNG: how to send emailable report as an email
本文介绍了TESTNG:如何通过电子邮件发送可通过电子邮件发送的报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以电子邮件发送测试报告的最佳方法是什么?
what is the best way to send test reports as an email?
我的框架具有WebDriver + TestNG
My framework has WebDriver + TestNG
推荐答案
对于詹金斯(Jenkins).
For Jenkins..
转到您的Project > Configure > Post-build Actions > Editable Email Notification
.
然后单击Advanced Settings....
有一个名为预发送脚本"的框.
There is a box named Pre-send Script.
def reportPath = build.getWorkspace().child("test-output/emailable-report.html")
msg.setContent(reportPath.readToString(), "text/html");
将其复制并粘贴到框中.然后保存. 这将生成彩色页面,您可以通过电子邮件将其作为报告发送.
Copy that and paste it into the box. Then Save it. That will generate the colourfull page and you can send it as a report via email.
这篇关于TESTNG:如何通过电子邮件发送可通过电子邮件发送的报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文