Soenneker.Playwrights.Tests.Unit 11.0.432

Prefix Reserved
dotnet add package Soenneker.Playwrights.Tests.Unit --version 11.0.432
                    
NuGet\Install-Package Soenneker.Playwrights.Tests.Unit -Version 11.0.432
                    
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="Soenneker.Playwrights.Tests.Unit" Version="11.0.432" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Playwrights.Tests.Unit" Version="11.0.432" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Playwrights.Tests.Unit" />
                    
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 Soenneker.Playwrights.Tests.Unit --version 11.0.432
                    
#r "nuget: Soenneker.Playwrights.Tests.Unit, 11.0.432"
                    
#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 Soenneker.Playwrights.Tests.Unit@11.0.432
                    
#: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=Soenneker.Playwrights.Tests.Unit&version=11.0.432
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Playwrights.Tests.Unit&version=11.0.432
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Playwrights.Tests.Unit

A hosted browser-test base class that exposes the application BaseUrl and creates ownership-aware Playwright sessions from a shared PlaywrightTestHost.

Installation

dotnet add package Soenneker.Playwrights.Tests.Unit

Usage

First define a PlaywrightHostedTestHost for the application as described by Soenneker.Playwrights.TestHosts. Then use that host as the test class data source:

using Microsoft.Playwright;
using Soenneker.Playwrights.Session;
using Soenneker.Playwrights.Tests.Unit;

[ClassDataSource<AppPlaywrightHost>(Shared = SharedType.PerTestSession)]
public sealed class AccountPageTests : PlaywrightUnitTest
{
    public AccountPageTests(AppPlaywrightHost host) : base(host)
    {
    }

    [Test]
    public async ValueTask Account_page_loads()
    {
        await using BrowserSession session = await CreateSession();

        await session.Page.GotoAsync($"{BaseUrl}account");
        await Assertions.Expect(session.Page.GetByRole(
                            AriaRole.Heading,
                            new PageGetByRoleOptions { Name = "Account" }))
                        .ToBeVisibleAsync();
    }
}

CreateSession() uses the host's context/page reuse defaults. Override them for one test when needed:

await using BrowserSession session = await CreateSession(
    new PlaywrightSessionOptions
    {
        ReuseBrowserContextAcrossSessions = true,
        ReusePageAcrossSessions = false
    },
    cancellationToken);

Dispose each returned session. Shared pages and contexts remain owned by the host; isolated ones are released with the session.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
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
11.0.432 47 11/13/2026
11.0.431 48 11/13/2026
11.0.430 82 11/12/2026
11.0.429 78 11/12/2026
11.0.428 78 11/11/2026
11.0.427 80 11/11/2026
11.0.426 80 11/11/2026
11.0.425 79 11/11/2026
11.0.423 81 11/11/2026
11.0.422 79 11/11/2026
11.0.421 87 11/11/2026
11.0.419 90 11/8/2026
11.0.418 87 11/7/2026
11.0.417 94 11/4/2026
11.0.416 91 11/4/2026
11.0.415 94 11/4/2026
11.0.414 98 11/3/2026
11.0.413 88 11/3/2026
11.0.412 87 11/3/2026
11.0.411 87 11/3/2026
Loading failed

Updated Multiple NuGet packages