From d3c71cc2073d9344f757136c5cb1db98fa47a542 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Fri, 17 Sep 2021 01:34:49 -0700 Subject: [PATCH] docs: clarify waitForURL(string) behavior (#8952) --- docs/src/api/params.md | 4 +++- types/types.d.ts | 14 ++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/src/api/params.md b/docs/src/api/params.md index 3a1021f9cd..0a7dfbf708 100644 --- a/docs/src/api/params.md +++ b/docs/src/api/params.md @@ -549,7 +549,9 @@ is considered matching if all specified properties match. ## wait-for-navigation-url - `url` <[string]|[RegExp]|[function]\([URL]\):[boolean]> -A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. +A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if +the parameter is a string without wilcard characters, the method will wait for navigation to URL that is exactly +equal to the string. ## wait-for-event-event * langs: js, python, java diff --git a/types/types.d.ts b/types/types.d.ts index 67a4ae6b60..2ec4db13c0 100644 --- a/types/types.d.ts +++ b/types/types.d.ts @@ -3627,7 +3627,9 @@ export interface Page { timeout?: number; /** - * A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. + * A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the + * parameter is a string without wilcard characters, the method will wait for navigation to URL that is exactly equal to + * the string. */ url?: string|RegExp|((url: URL) => boolean); @@ -3738,7 +3740,8 @@ export interface Page { * * Shortcut for main frame's * [frame.waitForURL(url[, options])](https://playwright.dev/docs/api/class-frame#frame-wait-for-url). - * @param url A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. + * @param url A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the parameter is a string without wilcard characters, the method will wait for navigation to URL that is exactly equal to + * the string. * @param options */ waitForURL(url: string|RegExp|((url: URL) => boolean), options?: { @@ -5745,7 +5748,9 @@ export interface Frame { timeout?: number; /** - * A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. + * A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the + * parameter is a string without wilcard characters, the method will wait for navigation to URL that is exactly equal to + * the string. */ url?: string|RegExp|((url: URL) => boolean); @@ -5775,7 +5780,8 @@ export interface Frame { * await frame.waitForURL('**\/target.html'); * ``` * - * @param url A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. + * @param url A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the parameter is a string without wilcard characters, the method will wait for navigation to URL that is exactly equal to + * the string. * @param options */ waitForURL(url: string|RegExp|((url: URL) => boolean), options?: {