问题
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