Install
dotnet add package Nullean.Snapshots.Html --version 0.12.2
| Product | Versions |
|---|---|
| .NET |
README
Nullean.Snapshots.Html

HTML snapshots and inline HTML assertions for Nullean.Snapshots: pretty-printed with AngleSharp and compared as a DOM, so whitespace and attribute order never fail a test.
Install
dotnet add package Nullean.Snapshots.Html
Quick start
using AwesomeAssertions;
using Nullean.Snapshots.Html;
public class PageTests
{
[Test]
public void Renders()
{
var options = new HtmlSnapshotOptions()
.Select("main#content")
.Remove("script")
.RemoveAttributes("hx-*", "nonce");
Page.Render().Should().MatchHtmlSnapshot(options); // .verified.html, compared as a DOM
}
[Test]
public void Greets() =>
Page.Render().Should().ContainHtml("<p class=\"lead\">Welcome</p>");
}
MatchHtmlSnapshotstores.verified.html;MatchInlineHtmlSnapshotkeeps the expected markup in the test.BeHtml,ContainHtmlandNotContainHtmlcompare with markup written in the test.HtmlSnapshotOptionsnarrows what is printed: select, remove elements, remove attributes, then transforms, in that order. It parses markup only, with no scripts or browser.
Learn more
- Documentation: https://snapshots.nullean.net
- HTML snapshots: https://snapshots.nullean.net/formats/html/
- Source and issues: https://github.com/nullean/snapshots
Changes from Previous Version
v0.12.1v0.12.2
Added Frameworks
net11.0
Added Dependencies
Nullean.Snapshots.AwesomeAssertions(net11.0)
Nullean.Snapshots(net11.0)
AngleSharp(net11.0)
AngleSharp.Diffing(net11.0)
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
Compatibility metadata lists 2 target frameworks; confirm the exact target used by your application.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.