Napomena
Za pristup ovoj stranici potrebna je autorizacija. Možete se pokušati prijaviti ili promijeniti direktorije.
Za pristup ovoj stranici potrebna je autorizacija. Možete pokušati promijeniti direktorije.
MTP ships with built-in features and can be extended through NuGet packages.
When using Microsoft.Testing.Platform.MSBuild (included transitively by MSTest, NUnit, and xUnit runners), installing an extension NuGet package is all you need — extensions are automatically detected and registered, and the entry point is generated for you.
If you opt out of the auto-generated entry point by setting <GenerateTestingPlatformEntryPoint>false</GenerateTestingPlatformEntryPoint>, you must register extensions manually in your Main method. Each extension page documents the manual registration call.
Extensions that require a NuGet package are shipped with their own licensing model (some less permissive), be sure to refer to the license associated with the extensions you want to use.
Some extensions are experimental: their APIs are annotated with the TPEXP diagnostic and might change in a future release, so you must acknowledge the diagnostic to use them. Experimental extensions are marked (experimental) in the following lists.
Start here
Use the following path based on your goal:
- Find command-line switches in one place: MTP CLI options reference.
- Add capabilities to your test runs: use the feature pages in this article.
- Create your own extension: MTP architecture, Extension points, and Services.
Choose by scenario
- Need to customize terminal output: Terminal output (built-in)
- Need TRX or Azure DevOps reports: Test reports (extension)
- Need GitHub Actions-native output (log groups, annotations, and job summary): GitHub Actions report (extension, experimental)
- Need coverage data: Code coverage (extension)
- Need crash or hang diagnostics: Crash and hang dumps (extension)
- Need to record the screen during a run: Diagnostics (extension, experimental)
- Need to deploy and launch a packaged-app test host: Test host deployment (extension, experimental)
- Need to route platform logs through
Microsoft.Extensions.Logging: Microsoft.Extensions integration (extension, experimental) - Need to retry failed tests: Retry (extension)
- Need hot reload support: Hot Reload (extension)
- Need Microsoft Fakes support: Microsoft Fakes (extension)
- Need OpenTelemetry traces and metrics: OpenTelemetry (extension)
- Telemetry data collection and opt-out: Telemetry (extension)
Built-in features
These features are part of the core platform and don't require additional NuGet packages.
Status and progress reporting to the terminal: output modes, ANSI support, and progress indicators.
Extension features
These features require installing NuGet packages.
Generate test report files (TRX, HTML, JUnit, CTRF, Azure DevOps, GitHub Actions).
Collect code coverage data during test execution.
Collect process dump files when the test host crashes or hangs.
Emit traces and metrics through OpenTelemetry during test runs.
Retry failed tests with configurable policies.
Run tests with hot reload support for rapid iteration.
Run tests that use Microsoft Fakes for stubs and shims.
Telemetry collection. Learn how to opt out and what data is collected.
Diagnostics (experimental, introduced in MTP 2.3.0)
Capture evidence to diagnose a run, such as recording the screen with the video recorder.
Test host deployment (experimental, introduced in MTP 2.3.0)
Control how and where the test host is deployed and launched, such as deploying and launching a packaged-app test host.
Microsoft.Extensions integration (experimental, introduced in MTP 2.3.0)
Bridge platform and extension diagnostics into the Microsoft.Extensions.* libraries your application already uses, such as forwarding logs through the Microsoft.Extensions.Logging pipeline.