Skip to content

Function: waitForNavigation()

ts
function waitForNavigation(ctx: Context, options?: Partial<WaitForNavigationOptions>): Promise<HTTPResponse | null>;

Defined in: src/wait/waiters/waitForNavigation.ts:25

Wait for the page to navigate.

Parameters

ParameterTypeDescription
ctxContextContext object.
options?Partial<WaitForNavigationOptions>Timeout and waitUntil settings.

Returns

Promise<HTTPResponse | null>

The server response from the navigation.

Example

ts
// Click a link and wait for the new page to load
await ctx.page.click('#go-to-checkout');
await waitForNavigation(ctx);

Matterway Assistant SDK Documentation