Install ReportPortal.VSTest.TestLogger NuGet package into your project with tests.
Add new ReportPortal.config.json file into your project with Copy if newer value for Copy to Output Directory property.
Example of config file:
{
"$schema": "https://raw.githubusercontent.com/reportportal/agent-net-vstest/master/ReportPortal.VSTest.TestLogger/ReportPortal.config.schema",
"enabled": true,
"server": {
"url": "https://rp.epam.com/api/v1/",
"project": "default_project",
"authentication": {
"uuid": "7853c7a9-7f27-43ea-835a-cab01355fd17"
}
},
"launch": {
"name": "VS Test Demo Launch",
"description": "this is description",
"debugMode": true,
"tags": [ "t1", "t2" ]
}
}
To publish test results in real-time to the ReportPortal specify Logger
argument.
vstest.console.exe MyTests.dll /TestAdapterPath:. /Logger:ReportPortal
dotnet vstest MyTests.dll --logger:ReportPortal
In case if you see
Could not find a test logger with AssemblyQualifiedName, URI or FriendlyName 'ReportPortal'.
error message after executing tests, and your target framework is netcoreapp, it's recommended to makedotnet publish
before executing tests. It's needed to copy TestLogger with dependencies to output folder, so vstest is able to discover TestLogger.
--logger:ReportPortal;Launch.Name="My new launch name"
-
Launch.Name
-
Launch.Description
-
Launch.Tags
- comma-separated list -
Launch.IsDebugMode
- true/false -
Server.Project
-
Server.Authentication.Uuid