web/e2e: accept options in NavigatorFixture.waitForPathname (#21507)

Forward an optional second argument through to Playwright's
`waitForURL`, so tests can set per-call timeouts and other options
without abandoning the fixture helper.
This commit is contained in:
Teffen Ellis
2026-04-10 17:15:03 +02:00
committed by GitHub
parent 4a417ba904
commit bb20350a2a

View File

@@ -31,12 +31,15 @@ export class NavigatorFixture extends PageFixture {
*
* @param to The pathname or URL to wait for.
*/
public waitForPathname = async (to: string | URL): Promise<void> => {
public waitForPathname = async (
to: string | URL,
options?: Parameters<Page["waitForURL"]>[1],
): Promise<void> => {
const expectedPathname = typeof to === "string" ? to : to.pathname;
this.logger.info(`Waiting for URL to change to ${expectedPathname}`);
await this.page.waitForURL(`**${expectedPathname}**`);
await this.page.waitForURL(`**${expectedPathname}**`, options);
this.logger.info(`URL changed to ${this.page.url()}`);
};