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
<PackageReference Include="Soenneker.Playwrights.Tests.Unit" Version="11.0.432" />
<PackageVersion Include="Soenneker.Playwrights.Tests.Unit" Version="11.0.432" />
<PackageReference Include="Soenneker.Playwrights.Tests.Unit" />
paket add Soenneker.Playwrights.Tests.Unit --version 11.0.432
#r "nuget: Soenneker.Playwrights.Tests.Unit, 11.0.432"
#:package Soenneker.Playwrights.Tests.Unit@11.0.432
#addin nuget:?package=Soenneker.Playwrights.Tests.Unit&version=11.0.432
#tool nuget:?package=Soenneker.Playwrights.Tests.Unit&version=11.0.432
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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Soenneker.Playwrights.TestHosts (>= 11.0.352)
- Soenneker.Tests.HostedUnit (>= 11.0.376)
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 |
Updated Multiple NuGet packages