简体   繁体   English

使用量角器完成运行后,发送使用节点js附加HTML文件的电子邮件报告

[英]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.

相关问题 是否可以使用 protractor 在 email 正文中附加 html 报告? - Is it possible to attach an html report in email body using protractor? 如何使用 node.js 运行 html 文件 - How to run html file using node js 使用 JS 从 HTML 页面发送 email - Send email from HTML page using JS 如何将下载页面作为完整的 HTML 文件提供选项(使用 JS/CSS 重新格式化和设置样式后) - How to give the option to download page as a complete HTML file (AFTER being reformatted and styled using JS/CSS) How to import excel file using HTML Input file and read the file content in Node.js (How to send the fullpath to Node.js) - How to import excel file using HTML Input file and read the file contents in Node.js (How to send the fullpath to Node.js) 使用节点量角器js连接oracledb - Connect oracledb using node protractor js 使用Node.js中的Azure SendGrid发送电子邮件 - Send an email using Azure SendGrid in Node.js 在Node.js中使用Express成功后,如何发送JSON响应并重定向到某些html页面? - How to send a JSON response and redirect to some html page after success in Node.js using express? 使用节点运行简单的js文件 - Run simple js file using node 如何使用express js以html形式发送电子邮件 - How to send email in html form using express js
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM