TESTNG: how to send emailable report as an email

selenium-webdrivertestng

what is the best way to send test reports as an email?

My framework has WebDriver + TestNG

Best Answer

For Jenkins..

Go to Your Project > Configure > Post-build Actions > Editable Email Notification.

Then click on 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.

Related Topic