AceReports.MSTest
1.0.1
dotnet add package AceReports.MSTest --version 1.0.1
NuGet\Install-Package AceReports.MSTest -Version 1.0.1
<PackageReference Include="AceReports.MSTest" Version="1.0.1" />
<PackageVersion Include="AceReports.MSTest" Version="1.0.1" />
<PackageReference Include="AceReports.MSTest" />
paket add AceReports.MSTest --version 1.0.1
#r "nuget: AceReports.MSTest, 1.0.1"
#:package AceReports.MSTest@1.0.1
#addin nuget:?package=AceReports.MSTest&version=1.0.1
#tool nuget:?package=AceReports.MSTest&version=1.0.1
AceReports.MSTest
Zero-setup HTML reporting for MSTest: one self-contained file per run with logs, API traffic, screenshots, retries and flaky-test detection.
Setup
Install the package. That's all:
dotnet add package AceReports.MSTest
Requires MSTest 3.10 or later. MSTest only picks up lifecycle methods declared inside the test
project, so the package adds one small, hidden file to the build: a class with a
[GlobalTestInitialize] and a [GlobalTestCleanup] method that hand over to Ace Reports. Global test
fixtures run in addition to your own [TestInitialize], [AssemblyInitialize] and cleanup
methods — nothing of yours is replaced. The report is written when the test run finishes, to
TestResults/AceReport_<timestamp>.html next to your test binaries.
To turn reporting off for a project: <EnableAceReports>false</EnableAceReports>.
Configuration
Add a class implementing IAceReportsStartup anywhere in the test project. Ace Reports finds it and
calls it before the first test runs:
using AceReports;
using AceReports.Configuration;
internal sealed class AceReportsStartup : IAceReportsStartup
{
public void Configure(AceReportsConfiguration options)
{
Ace.SuiteName("Smoke Suite");
Ace.EnvironmentName("UAT");
Ace.DarkTheme();
}
}
What is recorded
| MSTest | Report |
|---|---|
[TestMethod], [DataRow(...)] |
one row per test / data row; row values listed as name=value |
[TestCategory] on the method, its class or the assembly |
category tags (a test can have several) |
[Retry(n)] |
every attempt, with its own logs, API calls, error and screenshots; a test that passes after failing is marked flaky |
[Ignore], Assert.Inconclusive |
left out of the table |
Logging and screenshots
Ace.Info("Submitting payment");
Ace.TakeScreenshot("After login");
A screenshot is taken automatically when a test fails. MSTest does not expose the running test
class instance, so hand the page or driver over once and both Ace.TakeScreenshot() and the
failure screenshot use it:
Ace.UseScreenshotSource(page); // Playwright IPage, Selenium IWebDriver, ...
Screenshots and teardown
The automatic failure screenshot is taken when Ace Reports records the test, and that happens after the
framework's own teardown ([TearDown] in NUnit, [TestCleanup] in MSTest, [AfterScenario] in
Reqnroll). A teardown that closes the browser therefore leaves nothing to photograph. Either let the
run close the browser at the end, or take the screenshot yourself before closing:
Ace.TakeScreenshot("Final state");
await _browser.CloseAsync();
License
Ace Reports is source-available under the PolyForm Perimeter License 1.0.1.
Commercial terms (OEM, white-label, or a full buy-out) are available — see COMMERCIAL-LICENSE.md.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- AceReports (>= 1.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Fixes an ambiguous IAceReportsStartup reference in AceReports.Xunit: If you referenced AceReports.Xunit.IAceReportsStartup, please change it to AceReports.IAceReportsStartup. Requires xUnit v3 4.0 or later.