WebAppBrowserOptions Class
Configures a WebAppBrowser and its pages.
public sealed class WebAppBrowserOptionsConstructors
| Name | Description |
|---|---|
| WebAppBrowserOptions() |
WebAppBrowserOptions()
WebAppBrowserOptions.cspublic WebAppBrowserOptions()No documentation is available.
Properties
| Name | Description |
|---|---|
| ConfigureBrowsingContext | 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. |
| DefaultTimeout | Gets the maximum time the waits of the pages wait for. The default is 10 seconds. |
| EnableJavaScript | Gets whether the pages run their scripts. The default is true. |
| IsLongLivedRequest | 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. |
| TestIdAttribute | Gets the name of the attribute that LocatorScope.GetByTestId matches. The default is data-testid. |
| TimeProvider | Gets the clock of the timers of the pages, or null for the system clock. |
| Viewport | Gets the size of the viewport of the pages, in CSS pixels. The default is 1280x720. |
ConfigureBrowsingContext
WebAppBrowserOptions.csGets 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; }Property value
DefaultTimeout
WebAppBrowserOptions.csEnableJavaScript
WebAppBrowserOptions.csIsLongLivedRequest
WebAppBrowserOptions.csGets 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; }Property value
TestIdAttribute
WebAppBrowserOptions.csGets the name of the attribute that LocatorScope.GetByTestId matches. The default is data-testid.
public string TestIdAttribute { get; init; }Property value
TimeProvider
WebAppBrowserOptions.csGets the clock of the timers of the pages, or null for the system clock.
public TimeProvider? TimeProvider { get; init; }Property value
Viewport
WebAppBrowserOptions.csGets the size of the viewport of the pages, in CSS pixels. The default is 1280x720.
public ViewportOptions Viewport { get; init; }Property value
Methods
| Name | Description |
|---|---|
| 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.csReturns 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)