How can I email reports generated from 'protractor-jasmine2-html-reporter' to stakeholders after successful test execution.

巧了我就是萌 提交于 2020-03-05 05:57:11

问题


I have a config file as below:

var Jasmine2HtmlReporter = require('protractor-jasmine2-html-reporter');

exports.config = {  
directConnect: true,

onPrepare: function() {
  jasmine.getEnv().addReporter(
    new Jasmine2HtmlReporter({
      savePath: './test/reports/',
      screenshotsFolder: 'images',
    })
  );
},

multiCapabilities: [
                   {
                     'browserName': 'chrome',
                   }],

framework: 'jasmine',



specs: ['zoo_spec.js'],


jasmineNodeOpts: {
showColors: true,  
defaultTimeoutInterval: 30000
                 }  
};

My question is is there any code i can write in order to send the report generated from jasmine2-html-reporter as soon as test execution is complete.


回答1:


Did you try using onComplete instead? Please refer below previous answer

Unable to send Email using nodemailer in protractor.conf.js onComplete: function()




回答2:


In the config onComplete:function(){} you can write custom code to send email. There are many nodejs email clients that you can reuse to send emails without reinventing. Here is the example client you can use https://nodemailer.com/about/ and also review SMTP section to for configuration;



来源:https://stackoverflow.com/questions/49158903/how-can-i-email-reports-generated-from-protractor-jasmine2-html-reporter-to-st

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!