How can I send email with information from NUnit test suite execution with some extra details?

Hi, I would like to send email from TeamCity when build project with test automation suite finished. I run automated tests (NUnit + Selenium WebDriver) on build agent machine. In TeamCity, I execute automated tests using NUnit runner type. Email should be sent to all developers despite the build status. I would like to include the following information to this email:

  1. Number of tests executed;
  2. Number of successful tests;
  3. Number of failed tests;
  4. Link to this build;
  5. And some custom messages with configuration variables.

How this can be implemented? I couldn't find where exactly XML report from NUnit is generated. Where can I find it?

Is it possible to have an access to NUnit variables from build step in TeamCity like number of passed tests, number of failed tests etc?

Thank you.

0
1 comment

Hi Stanislav,

Regarding the content of the emails, you can customize them following the instructions here: https://confluence.jetbrains.com/display/TCD10/Customizing+Notifications

This said, many of the things you want to include aren't available directly. You can extend the customization models by creating a custom plugin as detailed here: https://confluence.jetbrains.com/display/TCD10/Extending+Notification+Templates+Model

This said, you won't have access to NUnit variables, as nunit runs on its own process, and the teamcity reports are taken from what nunit provides. You would need to pick up the XML report from NUnit, parse it yourself and add the data you need as values that you can later pass on (via the extension) to the notifications. The XML Report is stored as a hidden artifact of the build.

0

Please sign in to leave a comment.