Lyo.Web.Automation.Playwright
1.0.2
dotnet add package Lyo.Web.Automation.Playwright --version 1.0.2
NuGet\Install-Package Lyo.Web.Automation.Playwright -Version 1.0.2
<PackageReference Include="Lyo.Web.Automation.Playwright" Version="1.0.2" />
<PackageVersion Include="Lyo.Web.Automation.Playwright" Version="1.0.2" />
<PackageReference Include="Lyo.Web.Automation.Playwright" />
paket add Lyo.Web.Automation.Playwright --version 1.0.2
#r "nuget: Lyo.Web.Automation.Playwright, 1.0.2"
#:package Lyo.Web.Automation.Playwright@1.0.2
#addin nuget:?package=Lyo.Web.Automation.Playwright&version=1.0.2
#tool nuget:?package=Lyo.Web.Automation.Playwright&version=1.0.2
Lyo.Web.Automation.Playwright
Playwright implementation of the engine-agnostic Lyo.Web.Automation abstractions: launches Chromium / Firefox / WebKit, manages session-scoped browser contexts, and exposes the same tab/frame/dialog/keyboard/locator surface as Lyo.Web.Automation.Selenium so JSON automation plans and scripted runners behave identically across both engines.
Examples
Quick start
services.AddPlaywrightBrowserServiceFromConfiguration(builder.Configuration);
// per operation:
var service = sp.GetRequiredService<IPlaywrightBrowserService>();
using var session = service.CreateSession();
await session.StartBrowserAsync();
await session.Browser.NavigateAsync("https://example.com");
Surface — Browser (Browser/)
PlaywrightBrowser— concreteIWebAutomationBrowser(StartBrowserAsyncboots Playwright, optionally a persistent context, and a default page); composesPlaywrightBrowserTabs,PlaywrightDialogs,PlaywrightKeyboard,PlaywrightFrameNavigator,PlaywrightFrameSelectors,PlaywrightCookieJar,PlaywrightHeaderStore.PlaywrightBrowserTabInfo/PlaywrightTabManager— engine-native tab info and management.BrowserUrlRedaction— query/fragment redaction used in logs whenMaskSensitiveUrlsInLogsis set.PlaywrightWebAutomationElement—IWebAutomationElementadapter on top of PlaywrightILocator(ClickAsync,SendKeysAsyncwithFill/PressSequentially,SendKeysRawAsync, attribute reads, etc.).PlaywrightLocatorFactory(PlaywrightLocatorFactory.cs) — convertsLyo.Web.Automationelement specs to Playwright locators.
Surface — Service (Service/)
IPlaywrightBrowserService— singleton factory:CreateSession(PlaywrightSessionOptions?),ActiveSessionCount,Dispose.IPlaywrightBrowserSession— scoped session.PlaywrightExecutionContext/PlaywrightExecutionContextFactory— wiring used by the automation runners.PlaywrightMetricTags— metric-tag constants.
Surface — Configuration (Configuration/)
PlaywrightBrowserOptions holds application-wide defaults; PlaywrightSessionOptions is the per-session subclass passed to
CreateSession. Configuration section: "PlaywrightBrowserOptions".
| Property | Default | Notes |
|---|---|---|
BrowserKind |
Chromium |
PlaywrightBrowserKind: Chromium, Firefox, Webkit. |
Headless |
false |
Headless launch where supported. |
Channel |
null |
Optional Playwright channel (chrome, msedge, …). |
LaunchArguments |
--disable-infobars, --disable-extensions, --disable-gpu, --disable-dev-shm-usage, --no-sandbox |
Each entry must start with -; Playwright treats bare tokens as initial URLs. |
UserAgents |
one Linux Chrome UA | Round-robined for stealth. |
ViewportWidth/Height |
1280 × 1024 |
Initial viewport in CSS pixels. |
NavigationTimeoutMs |
30 000 |
Default navigation timeout (ms). |
LocatorDefaultTimeoutMs |
30 000 |
Default timeout for locator actions and PollForElementAsync family. |
PollingMaxAttempts / PollingDelayBetweenAttempts |
5 / 500 ms |
Outer-loop control for poll retries. |
EnableMetrics |
true |
Emit IMetrics instrumentation when an IMetrics is registered. |
SlowMoMilliseconds |
0 |
Slow-motion delay between Playwright operations. |
IgnoreHttpsErrors |
false |
Ignores HTTPS errors in the browser context. |
CloseOwnedResourcesOnDispose |
true |
Whether StartBrowserAsync ownership is closed on dispose. |
MaskSensitiveUrlsInLogs |
false |
Strip query/fragment in log lines. |
ServiceRootDirectory |
{tmp}/lyo-playwright |
Each session creates session-{id}/ with browser-profile/, artifacts/, downloads/. |
BrowserUserDataDirectory / DownloadDirectory / ArtifactsDirectory |
derived under session dir | Override individually if needed. |
Clone() |
— | Deep copy used to derive session-specific options. |
DI registration (Service/PlaywrightServiceExtensions.cs)
| Method | Registers |
|---|---|
AddPlaywrightBrowser(Action<PlaywrightBrowserOptions>?) |
Singleton options + scoped PlaywrightBrowser for direct injection. |
AddPlaywrightBrowser(PlaywrightBrowserOptions) |
Same, with explicit options instance. |
AddPlaywrightBrowserService(Action<PlaywrightBrowserOptions>?) |
Above + singleton IPlaywrightBrowserService (use this for session-based usage via CreateSession). |
AddPlaywrightBrowserService(PlaywrightBrowserOptions) |
Same, explicit options. |
AddPlaywrightBrowserServiceFromConfiguration(IConfiguration, configSectionName?) |
Binds options from configuration (default section "PlaywrightBrowserOptions"). |
Dependencies
Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).
Lyo.IO.Temp— (direct, lyo)Lyo.Web.Automation— (direct, lyo)Microsoft.Bcl.AsyncInterfaces10.0.5— (direct, microsoft, netstandard2.0)Microsoft.Extensions.Configuration.Binder10.0.5— (direct, microsoft)Microsoft.Extensions.DependencyInjection.Abstractions10.0.5— (direct, microsoft)Microsoft.Extensions.Logging.Abstractions10.0.5— (direct, microsoft)Microsoft.Playwright1.59.0— (direct, microsoft)System.Text.Json10.0.5— (direct, microsoft, netstandard2.0)Lyo.Common— (transitive, lyo)Lyo.Exceptions— (transitive, lyo)Lyo.Formatter— (transitive, lyo)Lyo.Metrics— (transitive, lyo)Microsoft.Extensions.Hosting.Abstractions10.0.5— (transitive, microsoft)Microsoft.Extensions.Options.ConfigurationExtensions10.0.5— (transitive, microsoft)SmartFormat.NET3.6.1— (transitive, third-party)System.Memory4.6.3— (transitive, microsoft, netstandard2.0)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Lyo.IO.Temp (>= 1.0.2)
- Lyo.Web.Automation (>= 1.0.2)
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.5)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.5)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
- Microsoft.Playwright (>= 1.59.0)
- System.Text.Json (>= 10.0.5)
-
net10.0
- Lyo.IO.Temp (>= 1.0.2)
- Lyo.Web.Automation (>= 1.0.2)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.5)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
- Microsoft.Playwright (>= 1.59.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.