WebAppBrowserOptions Class

Configures a WebAppBrowser and its pages.

public sealed class WebAppBrowserOptions

Constructors

NameDescription
WebAppBrowserOptions()

WebAppBrowserOptions()

WebAppBrowserOptions.cs
public WebAppBrowserOptions()

No documentation is available.

Properties

NameDescription
ConfigureBrowsingContextGets a function that changes the options of the browsing contexts of the pages, or null (see TestPageSettings.ConfigureBrowsingContext). It is called for each page: return the same BrowsingContextOptions.Clipboard (for instance a FakeClipboard) for the pages to share it.
DefaultTimeoutGets the maximum time the waits of the pages wait for. The default is 10 seconds.
EnableJavaScriptGets whether the pages run their scripts. The default is true.
IsLongLivedRequestGets a function that returns whether a request is long-lived: such a request does not prevent a page from being idle. The default is WebAppBrowserOptions.IsDefaultLongLivedRequest.
TestIdAttributeGets the name of the attribute that LocatorScope.GetByTestId matches. The default is data-testid.
TimeProviderGets the clock of the timers of the pages, or null for the system clock.
ViewportGets the size of the viewport of the pages, in CSS pixels. The default is 1280x720.

ConfigureBrowsingContext

WebAppBrowserOptions.cs

Gets a function that changes the options of the browsing contexts of the pages, or null (see TestPageSettings.ConfigureBrowsingContext). It is called for each page: return the same BrowsingContextOptions.Clipboard (for instance a FakeClipboard) for the pages to share it.

public Func<BrowsingContextOptions, BrowsingContextOptions>? ConfigureBrowsingContext { get; init; }

Gets the maximum time the waits of the pages wait for. The default is 10 seconds.

public TimeSpan DefaultTimeout { get; init; }

Property value

TimeSpan

EnableJavaScript

WebAppBrowserOptions.cs

Gets whether the pages run their scripts. The default is true.

public bool EnableJavaScript { get; init; }

Property value

bool

IsLongLivedRequest

WebAppBrowserOptions.cs

Gets a function that returns whether a request is long-lived: such a request does not prevent a page from being idle. The default is WebAppBrowserOptions.IsDefaultLongLivedRequest.

public Func<DocumentRequest, bool>? IsLongLivedRequest { get; init; }

Gets the name of the attribute that LocatorScope.GetByTestId matches. The default is data-testid.

public string TestIdAttribute { get; init; }

Property value

string

Gets the clock of the timers of the pages, or null for the system clock.

public TimeProvider? TimeProvider { get; init; }

Property value

TimeProvider?

Gets the size of the viewport of the pages, in CSS pixels. The default is 1280x720.

public ViewportOptions Viewport { get; init; }

Property value

ViewportOptions

Methods

NameDescription
IsDefaultLongLivedRequest(DocumentRequest)Returns whether a request is long-lived by default: the server-sent events (the requests that accept text/event-stream) and the long polling of SignalR (a GET request with the id and _ query parameters, which Blazor Server uses when WebSockets are not available).

IsDefaultLongLivedRequest(DocumentRequest)

WebAppBrowserOptions.cs

Returns whether a request is long-lived by default: the server-sent events (the requests that accept text/event-stream) and the long polling of SignalR (a GET request with the id and _ query parameters, which Blazor Server uses when WebSockets are not available).

public static bool IsDefaultLongLivedRequest(DocumentRequest request)

Parameters

request DocumentRequest
The request.

Returns

bool True when the request is long-lived.