nunit / teamcity-event-listener

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

[Feature request] Add support for NUnit test properties #87

Open elv1s42 opened 1 year ago

elv1s42 commented 1 year ago

When using NUnit, we can create custom properties for different purposes:

[Test]
[Description("This test tests awesome features")]
[Property("Priority", "High")]
[Property("Severity", "High")]
[Property("Subsystem", "User dashboard")]
public async Task TestDashboardLogin()
{
  // test
}

These properties are saved in the NUnit .xml result file:

<test-case id="0-2815" name="TestDashboardLogin" fullname="Tests.Dashboard.TestDashboardLogin" methodname="TestDashboardLogin" classname="Tests.Dashboard" runstate="Runnable" seed="949643898" result="Passed" start-time="2023-10-24T12:09:06.3087925Z" end-time="2023-10-24T12:09:12.0604303Z" duration="5.751055" asserts="0">
  <properties>
    <property name="Description" value="This test tests awesome features"/>
    <property name="Priority" value="High"/>
    <property name="Severity" value="High"/>
    <property name="Subsystem" value="User dashboard"/>
  </properties>
  <output>
  </output>
  <attachments>
  </attachments>
</test-case>

I think it will make sense to include these properties as test metadata to have them in TeamCity. They will be visible in TeamCity UI, and they will be accessible via TeamCity API:

<metadata count="15">
  <typedValues name="Description" type="text" value="This test tests awesome features"/>
  <typedValues name="Priority" type="text" value="High"/>
  <typedValues name="Severity" type="text" value="High"/>
  <typedValues name="Subsystem" type="text" value="User dashboard"/>
</metadata>