nunit / teamcity-event-listener

NUnit Engine extension that helps integration with teamcity
MIT License
11 stars 10 forks source link

Supporting test artifacts and test metadata #63

Closed NikolayPianikov closed 5 years ago

NikolayPianikov commented 5 years ago

Related issue

TeamCity 2018.2 + supports test metadata, i.e. images, statistics. Previous versions support artifacts publishing.

This code

TestContext.AddTestAttachment(@"data\MyImage.jpg", "My Image");
TestContext.AddTestAttachment(@"data\report.txt";

will attach artifacts to TeamCity test for TeamCity 2018.2 + and just will add artifacts for previous versions.

Also it is possible to specify artifact location in the TeamCity for later use

TestContext.AddTestAttachment(@"data\MyImage.jpg", "My Image => images");

or just

TestContext.AddTestAttachment(@"data\MyImage.jpg", "=> images");

The artifact directory is "images" now. This artifact is accessible, for example via REST API, by specific path like images/MyImage.jpg.