TestFramework.UI.Browser 0.2.0

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package TestFramework.UI.Browser --version 0.2.0
                    
NuGet\Install-Package TestFramework.UI.Browser -Version 0.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TestFramework.UI.Browser" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TestFramework.UI.Browser" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="TestFramework.UI.Browser" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TestFramework.UI.Browser --version 0.2.0
                    
#r "nuget: TestFramework.UI.Browser, 0.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TestFramework.UI.Browser@0.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TestFramework.UI.Browser&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=TestFramework.UI.Browser&version=0.2.0
                    
Install as a Cake Tool

TestFramework.UI.Browser

Drive a local browser from inside a TestFramework timeline.

private static readonly Timeline _timeline = Timeline.Create()
    .Trigger(BrowserExt.Session("shop")
        .Navigate("/products")
        .Click("Anvil")
        .Click("Add to cart"))
        .Name("add-to-cart")
    .WaitForEvent(BrowserExt.Events.TextAppears("shop", "1 item in cart"))
        .WithTimeOut(TimeSpan.FromSeconds(15))
    .Build();

Elements are addressed the way a person describes them

Click("Add to cart") looks for something clickable called that - by accessible name, then label, then placeholder, then test id, then visible text. A control that was restyled, relocated, or renamed from Save to Save changes is still found, because none of those is how the test identified it.

Matching runs in two sweeps: everything exact first, then everything loose. An exact match on any channel therefore beats a loose match on every channel, and a test never silently prefers a guess over a certainty.

Loose matches are recorded, never hidden

Every non-exact match lands in the session picture with the channel that matched and how many elements it found, and run.UiWeakestMatch("shop") asserts on it. Tolerance stays useful while a test is being written, and a build can still refuse to go green on tests that only pass because the framework guessed well.

When a name genuinely matches several elements, the step fails and lists the candidates together with the dial that resolves it - .InSection(...), .Nth(...), .First() - rather than picking one.

Precision when you want it

.Click(Target.Button("Delete").InSection("Saved cards"))  // kind and region pinned
.Click(Target.TestId("submit-order"))                     // test id
.Click(Target.Css("#legacy-submit"))                      // exact selector, when nothing else fits

Structure is a typed field, not a string

private static readonly WebElementStructure OrderList = WebElementStructure
    .OneElement("app-order-list")
        .WithAttribute("name", "orders")
        .Containing(x => x
            .ManyElements("app-order-row").WithText(Cell.Matches(@"A-\d+")));

Custom elements are first class, children match as a subset in any order by default, and a mismatch prints the actual structure as source you can paste back into the test.

Configuration decides the browser, tests do not

Viewport, device, channel and headlessness live in configuration, so the same timeline runs against a 1080p desktop and an iPhone by pointing at a different identifier - no test change.

When not to use it

For suites that only test a browser, Playwright's own tooling (UI mode, trace viewer, codegen) is the better tool. This package exists for timelines where the browser is one door among several, and the run continues into stubs, databases and files.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated

Browser evidence is now recorded as the run's own widgets, attributed to the step and the attempt that produced them. The pack's own failure folder is gone, so anything that read that folder should read the run's output instead. A paused run can also be asked to photograph every session it has open. Requires TestFramework.Core 0.5.0 and TestFramework.Config 0.3.0.