ComponentPageExtensions Class

Waits for the interactivity of the Blazor components of a page of an application (see WebAppBrowser).

public static class ComponentPageExtensions

Methods

NameDescription
WaitForInteractivityAsync(TestPage, TimeSpan?, CancellationToken)Runs the event loop of a page until its interactive components are attached: blazor.web.js replaces the markers of the prerendered components (<!--bl-root--> since .NET 11, <!--Blazor:{...}--> before) once their circuit (Interactive Server) or their runtime has started and rendered them. Before that, the events of the prerendered elements reach no component.

WaitForInteractivityAsync(TestPage, TimeSpan?, CancellationToken)

ComponentPageExtensions.cs

Runs the event loop of a page until its interactive components are attached: blazor.web.js replaces the markers of the prerendered components (<!--bl-root--> since .NET 11, <!--Blazor:{...}--> before) once their circuit (Interactive Server) or their runtime has started and rendered them. Before that, the events of the prerendered elements reach no component.

public static Task WaitForInteractivityAsync(this TestPage page, TimeSpan? timeout = null, CancellationToken cancellationToken = default)

Parameters

page TestPage
The page.
timeout TimeSpan?
The maximum time to wait, or null for TestPage.DefaultTimeout.
cancellationToken CancellationToken
A token to cancel the wait.

Returns

Task A task completed once the components are interactive.

Exceptions

TimeoutException
The components are not interactive after timeout.