Class PlaywrightWebOptions

Namespace
ProtoTest.Web.Playwright
Assembly
ProtoTest.Web.Playwright.dll

Playwright session options. Besides code, they bind from ProtoTest:Web:Playwright.

public sealed class PlaywrightWebOptions : IProtoConfigurableOptions
Inheritance
PlaywrightWebOptions
Implements
Inherited Members
Extension Methods

Fields

BackendName

public const string BackendName = "Playwright"

Field Value

string

ConfigurationSectionName

public const string ConfigurationSectionName = "ProtoTest:Web:Playwright"

Field Value

string

Properties

ActionTimeout

How long one read or action waits for its element before the backend reports it as missing. Playwright's own default is 30 seconds, which is longer than a polling assertion's budget; this matches the Selenium option of the same name so the two backends fail at the same speed.

public TimeSpan ActionTimeout { get; set; }

Property Value

TimeSpan

Browser

public PlaywrightBrowser Browser { get; set; }

Property Value

PlaywrightBrowser

CapturePageErrors

public bool CapturePageErrors { get; set; }

Property Value

bool

CaptureRequestFailures

public bool CaptureRequestFailures { get; set; }

Property Value

bool

Channel

public string? Channel { get; set; }

Property Value

string

ConfigureContext

Escape hatch: adjusts the native context options after the settings above are applied, for the Playwright knobs ProtoTest does not model.

public Action<BrowserNewContextOptions>? ConfigureContext { get; set; }

Property Value

Action<BrowserNewContextOptions>

ConsoleCapture

public PlaywrightConsoleCapture ConsoleCapture { get; set; }

Property Value

PlaywrightConsoleCapture

CorrelateTraceGroups

public bool CorrelateTraceGroups { get; set; }

Property Value

bool

Headless

public bool Headless { get; set; }

Property Value

bool

InstallBrowsers

Downloads the selected browser through the Playwright driver before the first launch, so a clean machine or CI runner needs no separate install step. Ignored when Channel names a system browser (for example msedge or chrome).

public bool InstallBrowsers { get; set; }

Property Value

bool

Locale

The locale the context reports, for example en-US.

public string? Locale { get; set; }

Property Value

string

MaxTraceBytes

The largest native trace attached to the test, in bytes. Defaults to 32 MiB; a bigger trace is not attached and the trace records web.playwright.trace_too_large with its size, so a failing run cannot spike memory buffering the whole zip. Set to zero to read without a cap.

public long MaxTraceBytes { get; set; }

Property Value

long

SlowMo

public float? SlowMo { get; set; }

Property Value

float?

StorageStatePath

A storage-state JSON file the context starts from.

public string? StorageStatePath { get; set; }

Property Value

string

TimezoneId

The IANA timezone the context reports, for example Europe/Brussels.

public string? TimezoneId { get; set; }

Property Value

string

TraceRetention

public PlaywrightTraceRetention TraceRetention { get; set; }

Property Value

PlaywrightTraceRetention

UserAgent

A user agent override for the context.

public string? UserAgent { get; set; }

Property Value

string

ViewportHeight

The context viewport height; both dimensions must be set for a viewport to apply.

public int? ViewportHeight { get; set; }

Property Value

int?

ViewportWidth

The context viewport width; both dimensions must be set for a viewport to apply.

public int? ViewportWidth { get; set; }

Property Value

int?