mirror of
https://github.com/goauthentik/authentik
synced 2026-04-25 17:15:26 +02:00
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:
@@ -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()}`);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user