WebEngine
Namespace: E2E.Engine
public sealed class WebEngine : IEngine, IAsyncDisposableBrowser engine for the web target. It drives Chromium through Playwright,
reads a semantic tree (role, name, text, test id, state), and performs the
same node actions the document engine does. Install browsers once with
playwright.ps1 install chromium from this project’s build output.
Inheritance: object
Implements: IEngine, IAsyncDisposable
Constructors
Section titled “Constructors”WebEngine(WebEngineOptions)
Section titled “WebEngine(WebEngineOptions)”public WebEngine(WebEngineOptions options)Parameters
| Name | Type | Description |
|---|---|---|
options |
WebEngineOptions |
WebEngine(bool?)
Section titled “WebEngine(bool?)”public WebEngine(bool? headless = null)Parameters
| Name | Type | Description |
|---|---|---|
headless |
bool? |
Fields
Section titled “Fields”EngineVersion
Section titled “EngineVersion”public const string EngineVersion = "1.1.0"Value: string
Properties
Section titled “Properties”Capabilities
Section titled “Capabilities”public EngineCapabilities Capabilities { get; }Value: EngineCapabilities
Platform
Section titled “Platform”public string Platform { get; }Value: string
Version
Section titled “Version”public string Version { get; }Value: string
Methods
Section titled “Methods”DisposeAsync()
Section titled “DisposeAsync()”public ValueTask DisposeAsync()Worker shutdown: releases the replacement lease the worker acquired for itself, within the cleanup timeout. What prepare leased is the runner’s to release.
Returns: ValueTask
FinishAsync(EngineFinishInfo, CancellationToken)
Section titled “FinishAsync(EngineFinishInfo, CancellationToken)”public Task FinishAsync(EngineFinishInfo info, CancellationToken cancellationToken)Releases the browsers CancellationToken) leased, once per run and target, then has the provider sweep up the
leases a worker that died left open. Call it after every worker ended, on every exit path, with a cleanup budget in
<code class=“paramref”>cancellationToken</code>.
Parameters
| Name | Type | Description |
|---|---|---|
info |
EngineFinishInfo | |
cancellationToken |
CancellationToken |
Returns: Task
Init(EngineInitInfo)
Section titled “Init(EngineInitInfo)”public void Init(EngineInitInfo info)Starts the worker of one slot: records the run it serves and, in Worker scope, the
lease its slot was handed. Every CancellationToken) after it rides that lease, or a replacement once its browser
dropped. It can be called again on a disposed engine.
Parameters
| Name | Type | Description |
|---|---|---|
info |
EngineInitInfo |
PrepareAsync(EnginePrepareInfo, CancellationToken)
Section titled “PrepareAsync(EnginePrepareInfo, CancellationToken)”public Task<EnginePrepareResult> PrepareAsync(EnginePrepareInfo info, CancellationToken cancellationToken)Leases one browser per worker slot the run will use from the provider, once per run and target, before any worker starts. The result’s environment is what the workers read in Init(EngineInitInfo). An engine with no provider has nothing to prepare.
Parameters
| Name | Type | Description |
|---|---|---|
info |
EnginePrepareInfo | |
cancellationToken |
CancellationToken |
Returns: Task<EnginePrepareResult>
StartAsync(EngineStartOptions, CancellationToken)
Section titled “StartAsync(EngineStartOptions, CancellationToken)”public Task<IEngineSession> StartAsync(EngineStartOptions options, CancellationToken cancellationToken)Parameters
| Name | Type | Description |
|---|---|---|
options |
EngineStartOptions | |
cancellationToken |
CancellationToken |
Returns: Task<IEngineSession>