ProtoTest.Web
1.0.1
dotnet add package ProtoTest.Web --version 1.0.1
NuGet\Install-Package ProtoTest.Web -Version 1.0.1
<PackageReference Include="ProtoTest.Web" Version="1.0.1" />
<PackageVersion Include="ProtoTest.Web" Version="1.0.1" />
<PackageReference Include="ProtoTest.Web" />
paket add ProtoTest.Web --version 1.0.1
#r "nuget: ProtoTest.Web, 1.0.1"
#:package ProtoTest.Web@1.0.1
#addin nuget:?package=ProtoTest.Web&version=1.0.1
#tool nuget:?package=ProtoTest.Web&version=1.0.1
ProtoTest.Web
The backend-neutral web-testing model: semantic locators, page objects, component scoping, flows, named waits, login and page coverage.
dotnet add package ProtoTest.Web
Register a backend — ProtoTest.Web.Playwright or ProtoTest.Web.Selenium — which supplies AddWeb; this package brings the model that both drive.
Quick start
public sealed class ProjectsPage : WebPage
{
public WebElement Search => Element(By.TestId("search"));
public ProjectTable Projects => Component<ProjectTable>(By.TestId("projects"));
}
public sealed class ProjectTable : WebTable<ProjectRow>;
public sealed class ProjectRow : WebTableRow;
var page = Proto.Context.Web().Page<ProjectsPage>();
await page.OpenAsync("/projects");
await page.Search.FillAsync("atlas");
var row = page.Projects.RowMatching(By.HasText("atlas"));
await row.Cell("Project").Should.HaveTextAsync("atlas");
What it adds
- Sessions —
Proto.Context.Web(name?, application?)creates a per-test session lazily;[WebSession(name, Open = …, Application = …)]and[LoginAs<TStrategy>(persona, Session = …)]cover setup and login. - Model —
WebPage/WebComponentwithElement,Component<T>()andComponents<T>();WebTable<TRow>andWebTableRowfor tables; every operation carries its scope path. - Actions and assertions —
ClickAsync,FillAsync,CheckAsync,SelectOptionAsync,PressAsync, reads, andelement.Should/ShouldNot(BeVisibleAsync,BeEnabledAsync,HaveTextAsync,ContainTextAsync,HaveValueAsync, …). - Downloads —
session.DownloadAsync(trigger, …)and theWebPageshortcut capture the file a trigger downloads as aWebDownload(file name, guessed media type, bytes, size) and register it as a test attachment namedweb-{session}-download-{n}-{file}. Playwright only: Selenium fails withWebBackendCapabilityExceptionbefore the trigger runs, because the WebDriver protocol has no download API. - Flows, middleware and waits —
Flow<T>()/InteractAsync,AddWebMiddleware<T>(),AddWebWait<TCondition>(timing, …)andWaitUntilAsync. - Coverage — a successful navigation records
web.page.visited, a passing assertionweb.page.verified, and inventory recordsweb.page.available;WebCoverageCollectorreports one item per page. - Tracing —
web.navigate,web.click,web.fill(redacted value),web.press,web.download,assert.weband friends, withweb.backend.executechild entries.
Configuration
Session sections under ProtoTest:Web:Sessions:{name}; backend options also bind over the same section.
| Key | Type | Default |
|---|---|---|
Application |
string |
session name |
BaseUrl |
absolute URI string | ProtoTest:Applications:{application}:BaseUrl |
Open |
string (absolute or relative) |
[WebSession].Open |
DiscoverRoutes |
bool |
false |
Coverage inventory lives under ProtoTest:Web:Pages with ProtoTest:Web:Pages:Source (auto/next/nuxt/remix/vue/react) and Framework; in-process ASP.NET Core pages come from their own inventory.
One backend per host: resolving zero or more than one IWebBackendFactory throws, and AddWebBackend keeps the first registration. HasText must be composed with And on both backends.
Learn more
| Product | Versions 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 is compatible. 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. |
-
net10.0
- ProtoTest.Core (>= 1.0.1)
-
net8.0
- ProtoTest.Core (>= 1.0.1)
-
net9.0
- ProtoTest.Core (>= 1.0.1)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on ProtoTest.Web:
| Package | Downloads |
|---|---|
|
ProtoTest.Web.Playwright
Playwright execution backend for ProtoTest.Web. |
|
|
ProtoTest.Web.Selenium
Selenium execution backend for ProtoTest.Web. |
GitHub repositories
This package is not used by any popular GitHub repositories.