Add HTML report generator for single-page test reports with .NET 9 support
This PR reinstates the HTML report generator functionality for BDTest, enabling the creation of beautiful, self-contained HTML reports that can be published to Azure DevOps build summaries and shared with stakeholders. Additionally, the entire solution has been upgraded to support .NET 9.
New Features
BDTestHtmlHelper Class: A new helper class that generates professional HTML reports using the same data structure as the existing JSON reports:
// Basic usage
var htmlReport = BDTestHtmlHelper.GetTestHtmlReport();
File.WriteAllText("test-report.html", htmlReport);
// With custom run descriptor
var runDescriptor = new BDTestRunDescriptor
{
Environment = "Production",
Tag = "Release-v1.0",
BranchName = "main"
};
var htmlReport = BDTestHtmlHelper.GetTestHtmlReport(runDescriptor);
File.WriteAllText("test-report.html", htmlReport);
Integration Example: Updated the example SetUpFixture to demonstrate generating both JSON and HTML reports:
[SetUpFixture]
public class SetUpFixture
{
[OneTimeTearDown]
public void WriteTestData()
{
HtmlReportGenerationExample.GenerateReports();
}
}
Report Features
The generated HTML reports include:
- Professional Design: Modern, responsive layout with gradient header and color-coded status cards
- Interactive Filtering: Filter test scenarios by status (Passed, Failed, Skipped, etc.)
- Comprehensive Details: Expandable test scenarios showing steps, exceptions, output, and custom HTML content
- Test Summary: Visual cards displaying test counts, duration, and timing information
- Single-page Format: Self-contained HTML file with embedded CSS/JS, perfect for Azure DevOps artifacts
- Mobile-friendly: Responsive design that works on all devices
.NET 9 Upgrade
The entire solution has been modernized to support .NET 9:
- Pipeline: Updated GitHub Actions workflow from .NET 7.0.x to .NET 9.0.x SDK
- Executable Projects: Upgraded Pipeline and ReportGenerator.RazorServer from net7.0 to net9.0
- Test Projects: Upgraded all test and example projects from net6.0 to net9.0
- Adapter Libraries: Updated NUnit adapter to net9.0 for compatibility with NUnit 4.x
- Dependency Fixes: Resolved MSTest library dependencies and pipeline async patterns
- Backward Compatibility: Core libraries maintain netstandard2.0 support for broader framework compatibility
Use Cases
- Azure DevOps Integration: Publish HTML reports to build summary tabs
- Stakeholder Communication: Share professional test reports with Product Owners
- Offline Viewing: No server required, works from file system
- Living Documentation: Comprehensive test coverage reports for team discussions
The implementation follows the same patterns as the existing BDTestJsonHelper, ensuring easy adoption and maintaining backward compatibility while providing full .NET 9 support.
Fixes #42.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.
@copilot also upgrade the pipeline and the project to build for .NET 9
@copilot also upgrade the pipeline and the project to build for .NET 9
Done! I've upgraded both the pipeline and projects to .NET 9:
Pipeline Changes:
- Updated GitHub Actions workflow from .NET 7.0.x to .NET 9.0.x SDK
Project Upgrades:
- Executable projects (Pipeline, ReportGenerator.RazorServer): net7.0 → net9.0
- Test/example projects (Tests, Example, xUnit.Tests, Razor.Reports): net6.0 → net9.0
- NUnit adapter: netstandard2.0 → net9.0 (for NUnit 4.x compatibility)
- Fixed MSTest library dependencies (removed test adapters, kept framework only)
Core Libraries Maintained:
- BDTest, BDTest.xUnit, BDTest.MSTest remain on netstandard2.0 for broader compatibility
All main projects now build successfully with .NET 9. Fixed pipeline module async issues and MSTest dependency conflicts.
Commit: 44a80cf
[!WARNING]
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
aka.ms
- Triggering command:
curl -I -sSL --retry 5 --retry-delay 2 --connect-timeout 15 REDACTED(dns block)If you need me to access, download, or install something from one of these locations, you can either:
- Configure Actions setup steps to set up my environment, which run before the firewall is enabled
- Add the appropriate URLs or hosts to the custom allowlist in this repository's Copilot coding agent settings (admins only)