From 2cbafd7adf4390b4f1c04fc9334f419f955096b3 Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Wed, 1 Mar 2023 12:40:50 -0800 Subject: [PATCH] chore: mark waitForNavigation as deprecated consistently (#21309) --- docs/src/api/class-frame.md | 2 ++ docs/src/api/class-page.md | 1 + packages/playwright-core/types/types.d.ts | 2 ++ 3 files changed, 5 insertions(+) diff --git a/docs/src/api/class-frame.md b/docs/src/api/class-frame.md index ef9ed9a8cb..806a274a64 100644 --- a/docs/src/api/class-frame.md +++ b/docs/src/api/class-frame.md @@ -1937,6 +1937,7 @@ await frame.WaitForLoadStateAsync(); // Defaults to LoadState.Load ## async method: Frame.waitForNavigation * since: v1.8 +* deprecated: This method is inherently racy, please use [`method: Frame.waitForURL`] instead. * langs: * alias-python: expect_navigation * alias-csharp: RunAndWaitForNavigation @@ -1995,6 +1996,7 @@ a navigation. ## async method: Frame.waitForNavigation * since: v1.8 +* deprecated: This method is inherently racy, please use [`method: Frame.waitForURL`] instead. * langs: python - returns: <[EventContextManager]<[Response]>> diff --git a/docs/src/api/class-page.md b/docs/src/api/class-page.md index fce271e693..b3ed6544fa 100644 --- a/docs/src/api/class-page.md +++ b/docs/src/api/class-page.md @@ -4249,6 +4249,7 @@ a navigation. ## async method: Page.waitForNavigation * since: v1.8 +* deprecated: This method is inherently racy, please use [`method: Page.waitForURL`] instead. * langs: python - returns: <[EventContextManager]<[Response]>> diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.ts index d1d5846dad..7cd013cdf7 100644 --- a/packages/playwright-core/types/types.d.ts +++ b/packages/playwright-core/types/types.d.ts @@ -7163,6 +7163,8 @@ export interface Frame { * * **NOTE** Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API) to change the URL * is considered a navigation. + * @deprecated This method is inherently racy, please use + * [frame.waitForURL(url[, options])](https://playwright.dev/docs/api/class-frame#frame-wait-for-url) instead. * @param options */ waitForNavigation(options?: {