ReportUI.TrxToHtml
1.0.0
See the version list below for details.
dotnet add package ReportUI.TrxToHtml --version 1.0.0
NuGet\Install-Package ReportUI.TrxToHtml -Version 1.0.0
<PackageReference Include="ReportUI.TrxToHtml" Version="1.0.0" />
<PackageVersion Include="ReportUI.TrxToHtml" Version="1.0.0" />
<PackageReference Include="ReportUI.TrxToHtml" />
paket add ReportUI.TrxToHtml --version 1.0.0
#r "nuget: ReportUI.TrxToHtml, 1.0.0"
#:package ReportUI.TrxToHtml@1.0.0
#addin nuget:?package=ReportUI.TrxToHtml&version=1.0.0
#tool nuget:?package=ReportUI.TrxToHtml&version=1.0.0
OpenSource: https://github.com/Asher-P/ReportUI.TrxToHtml
For .net MSTests trx report
Purpose This file contains the implementation of a static class HtmlReportGenerator designed to generate and save an HTML report based on test results. It provides methods to format the data into a styled, user-friendly HTML structure and save it to a specified location.
Dependencies The following namespaces and external components are required for the functionality of HtmlReportGenerator:
System.Text Used for the efficient construction of the HTML string using the StringBuilder class.
TrxToHtml.Entities Likely contains the TestReport class and related entities that represent the structure of the test report.
TrxToHtml.Helpers Likely includes helper classes like TrxHelper for deserialization of .trx reports.
System.IO Required for writing the generated HTML to a file.
How to Import and Use To use the HtmlReportGenerator class in your project, follow these steps:
Add the File Ensure HtmlReportGenerator.cs is added to your project structure.
Include Required Dependencies Make sure the TrxToHtml.Entities and TrxToHtml.Helpers namespaces are referenced. If these are part of an external library, include the library in your project.
Add Namespace In the file where you want to use this generator, include the namespace:
csharp Copy code using TrxToHtml; Usage Example To generate and save an HTML report:
csharp Copy code string trxFilePath = "path/to/your/test-report.trx"; string outputHtmlPath = "path/to/save/test-report.html";
HtmlReportGenerator.SaveReportToFile(trxFilePath, outputHtmlPath); Core Functionalities GenerateHtmlReport(TestReport testReport)
Input: A TestReport object containing details of the test execution. Output: A formatted HTML string. Features: Applies inline CSS for styling. Creates a responsive table for test results. Implements JavaScript for expandable sections in the report. SaveReportToFile(string trxReportPath, string savedHtmlPath)
Input: Path to a .trx test report file. Path to save the generated HTML file. Output: Saves the generated HTML to the specified location. Error Handling: Logs any exceptions encountered during file operations. Additional Notes Custom Styling: The report uses an internal CSS for visual styling, including responsive tables and color-coded test outcomes (pass, fail, skip). Expandable Sections: JavaScript enables toggling of detailed output visibility for each test result. Error Tolerance: Handles missing or invalid data gracefully, with default fallback values (e.g., Unknown for null properties).
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.