xunit.testlogger
xunit.testlogger copied to clipboard
how it works?
sorry but i didn't understand this point
Use the following command line in tests dotnet test --logger:xunit Test results are generated in the TestResults directory relative to the test.csproj A path for the report file can be specified as follows:
dotnet test --logger:"xunit;LogFilePath=test_result.xml"
can I use it to automatically generate reports automatically after my tests run?
Yes, you use the test_results.xml file as the input into a tool of your choice that can generate reports. One example of this is if you are using Jenkins for your builds, you can use this jenkins plugin to display the results based on the test_results.xml file. https://plugins.jenkins.io/xunit/
@AmeerMansourBeca Yeah, thats right. After you add the nuget package to your test project, use the command line in the directory with your test csproj to run dotnet test --logger:xunit
. You will see in the console where your report was written.
As @crainey said, you can run the same command in your CICD pipeline and then have the xml file saved into whatever system you are using.
Closing due to inactivity. Please reopen as appropriate.