[英]Send email report with HTML file attached using node js after the run is complete using protractor
I am using nodemailer for email sending in my code. 我正在使用nodemailer在我的代码中发送电子邮件。 I want to run it after my test cases have been executed by protractor.
我想在量角器执行完我的测试用例之后运行它。 Right now, it is mailing me the old HTML file that I have in my directory before the run gets completed.
目前,它是在运行完成之前通过邮件发送给我目录中的旧HTML文件。
I also tried using EmailJS, but got to the same result. 我也尝试使用EmailJS,但是得到了相同的结果。
I want it to run after my test gets completed and report is generated, so that I receive the latest report. 我希望它在测试完成并生成报告后运行,以便我收到最新报告。
Place your mail send script in the onComplete
function in the protractor.conf.js file. 将您的邮件发送脚本放在protractor.conf.js文件中的
onComplete
函数中。
var mailer = require(/* Mail module */);
exports.config = {
// Other config...
onComplete: function () {
// Send mail...
}
};
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.