ComponentPageExtensions Class
Waits for the interactivity of the Blazor components of a page of an application (see WebAppBrowser).
public static class ComponentPageExtensionsMethods
| Name | Description |
|---|---|
| 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.csRuns 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
pageTestPage- The page.
timeoutTimeSpan?- The maximum time to wait, or null for
TestPage.DefaultTimeout. cancellationTokenCancellationToken- 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.