From 0d2fa375a4a6a830389f497519f466c6e8a89304 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Fri, 5 Jun 2026 11:49:48 -0700 Subject: [PATCH] fix(docs): render method-level deprecated annotation as admonition Method-level deprecations used the unsupported space-form admonition syntax (`:::warning Deprecated`), which Docusaurus renders as plain text. Switch to the bracket-title form (`:::warning[Deprecated]`) used everywhere else. Includes a full docs roll. Fixes: https://github.com/microsoft/playwright/issues/41164 --- dotnet/docs/api/class-browsercontext.mdx | 4 +- dotnet/docs/api/class-elementhandle.mdx | 2 +- dotnet/docs/api/class-frame.mdx | 6 +- dotnet/docs/api/class-framelocator.mdx | 6 +- dotnet/docs/api/class-locator.mdx | 2 +- dotnet/docs/api/class-page.mdx | 6 +- java/docs/api/class-browsercontext.mdx | 4 +- java/docs/api/class-elementhandle.mdx | 2 +- java/docs/api/class-frame.mdx | 4 +- java/docs/api/class-framelocator.mdx | 6 +- java/docs/api/class-locator.mdx | 2 +- java/docs/api/class-page.mdx | 4 +- nodejs/docs/api/class-browsercontext.mdx | 9 ++- nodejs/docs/api/class-elementhandle.mdx | 2 +- nodejs/docs/api/class-frame.mdx | 13 +++- nodejs/docs/api/class-framelocator.mdx | 6 +- nodejs/docs/api/class-locator.mdx | 2 +- nodejs/docs/api/class-page.mdx | 22 +++++- nodejs/docs/api/class-testoptions.mdx | 42 +++++----- nodejs/docs/api/class-testproject.mdx | 98 ------------------------ nodejs/docs/api/class-websocket.mdx | 3 + nodejs/docs/api/class-worker.mdx | 3 + nodejs/docs/test-cli.mdx | 2 +- nodejs/docs/test-use-options.mdx | 52 +++++++++++++ python/docs/api/class-browsercontext.mdx | 4 +- python/docs/api/class-elementhandle.mdx | 2 +- python/docs/api/class-frame.mdx | 4 +- python/docs/api/class-framelocator.mdx | 6 +- python/docs/api/class-locator.mdx | 2 +- python/docs/api/class-page.mdx | 4 +- src/generator.js | 2 +- 31 files changed, 159 insertions(+), 167 deletions(-) diff --git a/dotnet/docs/api/class-browsercontext.mdx b/dotnet/docs/api/class-browsercontext.mdx index 4b200ace0b..2499945640 100644 --- a/dotnet/docs/api/class-browsercontext.mdx +++ b/dotnet/docs/api/class-browsercontext.mdx @@ -1386,7 +1386,7 @@ BrowserContext.WebError += async (_, webError) => {}; Added in: v1.11browserContext.event BackgroundPage -:::warning Deprecated +:::warning[Deprecated] Background pages have been removed from Chromium together with Manifest V2 extensions. @@ -1410,7 +1410,7 @@ BrowserContext.BackgroundPage += async (_, page) => {}; Added in: v1.11browserContext.BackgroundPages -:::warning Deprecated +:::warning[Deprecated] Background pages have been removed from Chromium together with Manifest V2 extensions. diff --git a/dotnet/docs/api/class-elementhandle.mdx b/dotnet/docs/api/class-elementhandle.mdx index 603765bfad..fffa2f817f 100644 --- a/dotnet/docs/api/class-elementhandle.mdx +++ b/dotnet/docs/api/class-elementhandle.mdx @@ -1428,7 +1428,7 @@ await ElementHandle.TextContentAsync(); Added before v1.9elementHandle.TypeAsync -:::warning Deprecated +:::warning[Deprecated] In most cases, you should use [Locator.FillAsync()](/api/class-locator.mdx#locator-fill) instead. You only need to press keys one by one if there is special keyboard handling on the page - in this case use [Locator.PressSequentiallyAsync()](/api/class-locator.mdx#locator-press-sequentially). diff --git a/dotnet/docs/api/class-frame.mdx b/dotnet/docs/api/class-frame.mdx index 9317f8ea9c..15c70e31f1 100644 --- a/dotnet/docs/api/class-frame.mdx +++ b/dotnet/docs/api/class-frame.mdx @@ -2075,7 +2075,7 @@ await Frame.QuerySelectorAllAsync(selector); Added before v1.9frame.RunAndWaitForNavigationAsync -:::warning Deprecated +:::warning[Deprecated] This method is inherently racy, please use [Frame.WaitForURLAsync()](/api/class-frame.mdx#frame-wait-for-url) instead. @@ -2130,7 +2130,7 @@ Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/Hist Added before v1.9frame.WaitForNavigationAsync -:::warning Deprecated +:::warning[Deprecated] This method is inherently racy, please use [Frame.WaitForURLAsync()](/api/class-frame.mdx#frame-wait-for-url) instead. @@ -2486,7 +2486,7 @@ await Frame.TextContentAsync(selector, options); Added before v1.9frame.TypeAsync -:::warning Deprecated +:::warning[Deprecated] In most cases, you should use [Locator.FillAsync()](/api/class-locator.mdx#locator-fill) instead. You only need to press keys one by one if there is special keyboard handling on the page - in this case use [Locator.PressSequentiallyAsync()](/api/class-locator.mdx#locator-press-sequentially). diff --git a/dotnet/docs/api/class-framelocator.mdx b/dotnet/docs/api/class-framelocator.mdx index 397c6cf4f7..30a08b164e 100644 --- a/dotnet/docs/api/class-framelocator.mdx +++ b/dotnet/docs/api/class-framelocator.mdx @@ -467,7 +467,7 @@ await Expect(locator).ToBeVisibleAsync(); Added in: v1.17frameLocator.First -:::warning Deprecated +:::warning[Deprecated] Use [Locator.First](/api/class-locator.mdx#locator-first) followed by [Locator.ContentFrame](/api/class-locator.mdx#locator-content-frame) instead. @@ -491,7 +491,7 @@ FrameLocator.First Added in: v1.17frameLocator.Last -:::warning Deprecated +:::warning[Deprecated] Use [Locator.Last](/api/class-locator.mdx#locator-last) followed by [Locator.ContentFrame](/api/class-locator.mdx#locator-content-frame) instead. @@ -515,7 +515,7 @@ FrameLocator.Last Added in: v1.17frameLocator.Nth -:::warning Deprecated +:::warning[Deprecated] Use [Locator.Nth()](/api/class-locator.mdx#locator-nth) followed by [Locator.ContentFrame](/api/class-locator.mdx#locator-content-frame) instead. diff --git a/dotnet/docs/api/class-locator.mdx b/dotnet/docs/api/class-locator.mdx index abb0a67d9d..e8b60fba70 100644 --- a/dotnet/docs/api/class-locator.mdx +++ b/dotnet/docs/api/class-locator.mdx @@ -2588,7 +2588,7 @@ await Locator.ElementHandlesAsync(); Added in: v1.14locator.TypeAsync -:::warning Deprecated +:::warning[Deprecated] In most cases, you should use [Locator.FillAsync()](/api/class-locator.mdx#locator-fill) instead. You only need to press keys one by one if there is special keyboard handling on the page - in this case use [Locator.PressSequentiallyAsync()](/api/class-locator.mdx#locator-press-sequentially). diff --git a/dotnet/docs/api/class-page.mdx b/dotnet/docs/api/class-page.mdx index 2415113032..1a8e3ab0c2 100644 --- a/dotnet/docs/api/class-page.mdx +++ b/dotnet/docs/api/class-page.mdx @@ -4447,7 +4447,7 @@ await Page.QuerySelectorAllAsync(selector); Added before v1.9page.RunAndWaitForNavigationAsync -:::warning Deprecated +:::warning[Deprecated] This method is inherently racy, please use [Page.WaitForURLAsync()](/api/class-page.mdx#page-wait-for-url) instead. @@ -4502,7 +4502,7 @@ Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/Hist Added before v1.9page.WaitForNavigationAsync -:::warning Deprecated +:::warning[Deprecated] This method is inherently racy, please use [Page.WaitForURLAsync()](/api/class-page.mdx#page-wait-for-url) instead. @@ -4858,7 +4858,7 @@ await Page.TextContentAsync(selector, options); Added before v1.9page.TypeAsync -:::warning Deprecated +:::warning[Deprecated] In most cases, you should use [Locator.FillAsync()](/api/class-locator.mdx#locator-fill) instead. You only need to press keys one by one if there is special keyboard handling on the page - in this case use [Locator.PressSequentiallyAsync()](/api/class-locator.mdx#locator-press-sequentially). diff --git a/java/docs/api/class-browsercontext.mdx b/java/docs/api/class-browsercontext.mdx index 6aab74f4db..5ee4b460b5 100644 --- a/java/docs/api/class-browsercontext.mdx +++ b/java/docs/api/class-browsercontext.mdx @@ -1368,7 +1368,7 @@ BrowserContext.onWebError(handler) Added in: v1.11browserContext.onBackgroundPage(handler) -:::warning Deprecated +:::warning[Deprecated] Background pages have been removed from Chromium together with Manifest V2 extensions. @@ -1392,7 +1392,7 @@ BrowserContext.onBackgroundPage(handler) Added in: v1.11browserContext.backgroundPages -:::warning Deprecated +:::warning[Deprecated] Background pages have been removed from Chromium together with Manifest V2 extensions. diff --git a/java/docs/api/class-elementhandle.mdx b/java/docs/api/class-elementhandle.mdx index cdbeca311e..f874bdcab0 100644 --- a/java/docs/api/class-elementhandle.mdx +++ b/java/docs/api/class-elementhandle.mdx @@ -1437,7 +1437,7 @@ ElementHandle.textContent(); Added before v1.9elementHandle.type -:::warning Deprecated +:::warning[Deprecated] In most cases, you should use [Locator.fill()](/api/class-locator.mdx#locator-fill) instead. You only need to press keys one by one if there is special keyboard handling on the page - in this case use [Locator.pressSequentially()](/api/class-locator.mdx#locator-press-sequentially). diff --git a/java/docs/api/class-frame.mdx b/java/docs/api/class-frame.mdx index 19e0f766ba..7a755a47fe 100644 --- a/java/docs/api/class-frame.mdx +++ b/java/docs/api/class-frame.mdx @@ -2406,7 +2406,7 @@ Frame.textContent(selector, options); Added before v1.9frame.type -:::warning Deprecated +:::warning[Deprecated] In most cases, you should use [Locator.fill()](/api/class-locator.mdx#locator-fill) instead. You only need to press keys one by one if there is special keyboard handling on the page - in this case use [Locator.pressSequentially()](/api/class-locator.mdx#locator-press-sequentially). @@ -2521,7 +2521,7 @@ Frame.uncheck(selector, options); Added before v1.9frame.waitForNavigation -:::warning Deprecated +:::warning[Deprecated] This method is inherently racy, please use [Frame.waitForURL()](/api/class-frame.mdx#frame-wait-for-url) instead. diff --git a/java/docs/api/class-framelocator.mdx b/java/docs/api/class-framelocator.mdx index 4eb57fd786..406f921089 100644 --- a/java/docs/api/class-framelocator.mdx +++ b/java/docs/api/class-framelocator.mdx @@ -466,7 +466,7 @@ assertThat(locator).isVisible(); Added in: v1.17frameLocator.first -:::warning Deprecated +:::warning[Deprecated] Use [Locator.first()](/api/class-locator.mdx#locator-first) followed by [Locator.contentFrame()](/api/class-locator.mdx#locator-content-frame) instead. @@ -490,7 +490,7 @@ FrameLocator.first(); Added in: v1.17frameLocator.last -:::warning Deprecated +:::warning[Deprecated] Use [Locator.last()](/api/class-locator.mdx#locator-last) followed by [Locator.contentFrame()](/api/class-locator.mdx#locator-content-frame) instead. @@ -514,7 +514,7 @@ FrameLocator.last(); Added in: v1.17frameLocator.nth -:::warning Deprecated +:::warning[Deprecated] Use [Locator.nth()](/api/class-locator.mdx#locator-nth) followed by [Locator.contentFrame()](/api/class-locator.mdx#locator-content-frame) instead. diff --git a/java/docs/api/class-locator.mdx b/java/docs/api/class-locator.mdx index e3d3c50285..8535716b22 100644 --- a/java/docs/api/class-locator.mdx +++ b/java/docs/api/class-locator.mdx @@ -2592,7 +2592,7 @@ Locator.elementHandles(); Added in: v1.14locator.type -:::warning Deprecated +:::warning[Deprecated] In most cases, you should use [Locator.fill()](/api/class-locator.mdx#locator-fill) instead. You only need to press keys one by one if there is special keyboard handling on the page - in this case use [Locator.pressSequentially()](/api/class-locator.mdx#locator-press-sequentially). diff --git a/java/docs/api/class-page.mdx b/java/docs/api/class-page.mdx index bb88883b51..25a3ec9bf2 100644 --- a/java/docs/api/class-page.mdx +++ b/java/docs/api/class-page.mdx @@ -4642,7 +4642,7 @@ Page.textContent(selector, options); Added before v1.9page.type -:::warning Deprecated +:::warning[Deprecated] In most cases, you should use [Locator.fill()](/api/class-locator.mdx#locator-fill) instead. You only need to press keys one by one if there is special keyboard handling on the page - in this case use [Locator.pressSequentially()](/api/class-locator.mdx#locator-press-sequentially). @@ -4757,7 +4757,7 @@ Page.uncheck(selector, options); Added before v1.9page.waitForNavigation -:::warning Deprecated +:::warning[Deprecated] This method is inherently racy, please use [Page.waitForURL()](/api/class-page.mdx#page-wait-for-url) instead. diff --git a/nodejs/docs/api/class-browsercontext.mdx b/nodejs/docs/api/class-browsercontext.mdx index 0c7c6bd009..0a742780cf 100644 --- a/nodejs/docs/api/class-browsercontext.mdx +++ b/nodejs/docs/api/class-browsercontext.mdx @@ -1052,6 +1052,9 @@ const page = await pagePromise; - `predicate` [function] *(optional)*# Receives the event data and resolves to truthy value when the waiting should resolve. + - `signal` [AbortSignal] *(optional)* Added in: v1.61# + + Allows to cancel the waiting using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the default timeout; pass `timeout: 0` to disable the timeout entirely. **Returns** - [Promise]<[Object]># @@ -1465,7 +1468,7 @@ browserContext.on('weberror', data => {}); Added in: v1.11browserContext.on('backgroundpage') -:::warning Deprecated +:::warning[Deprecated] Background pages have been removed from Chromium together with Manifest V2 extensions. @@ -1489,7 +1492,7 @@ browserContext.on('backgroundpage', data => {}); Added in: v1.11browserContext.backgroundPages -:::warning Deprecated +:::warning[Deprecated] Background pages have been removed from Chromium together with Manifest V2 extensions. @@ -1513,7 +1516,7 @@ browserContext.backgroundPages(); Added before v1.9browserContext.setHTTPCredentials -:::warning Deprecated +:::warning[Deprecated] Browsers may cache credentials after successful authentication. Create a new browser context instead. diff --git a/nodejs/docs/api/class-elementhandle.mdx b/nodejs/docs/api/class-elementhandle.mdx index 69a88f3a0d..aeb75e198b 100644 --- a/nodejs/docs/api/class-elementhandle.mdx +++ b/nodejs/docs/api/class-elementhandle.mdx @@ -1441,7 +1441,7 @@ await elementHandle.textContent(); Added before v1.9elementHandle.type -:::warning Deprecated +:::warning[Deprecated] In most cases, you should use [locator.fill()](/api/class-locator.mdx#locator-fill) instead. You only need to press keys one by one if there is special keyboard handling on the page - in this case use [locator.pressSequentially()](/api/class-locator.mdx#locator-press-sequentially). diff --git a/nodejs/docs/api/class-frame.mdx b/nodejs/docs/api/class-frame.mdx index 5dc44db861..05ad899007 100644 --- a/nodejs/docs/api/class-frame.mdx +++ b/nodejs/docs/api/class-frame.mdx @@ -1033,6 +1033,9 @@ await frame.waitForLoadState(); // Waits for 'load' state by default. * `'domcontentloaded'` - wait for the `DOMContentLoaded` event to be fired. * `'networkidle'` - **DISCOURAGED** wait until there are no network connections for at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead. - `options` [Object] *(optional)* + - `signal` [AbortSignal] *(optional)* Added in: v1.61# + + Allows to cancel the waiting using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the default timeout; pass `timeout: 0` to disable the timeout entirely. - `timeout` [number] *(optional)*# Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `navigationTimeout` option in the config, or by using the [browserContext.setDefaultNavigationTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-navigation-timeout), [browserContext.setDefaultTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-timeout), [page.setDefaultNavigationTimeout()](/api/class-page.mdx#page-set-default-navigation-timeout) or [page.setDefaultTimeout()](/api/class-page.mdx#page-set-default-timeout) methods. @@ -1060,6 +1063,9 @@ await frame.waitForURL('**/target.html'); A glob pattern, regex pattern, URL pattern, or predicate receiving [URL] to match while waiting for the navigation. Note that if the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to the string. - `options` [Object] *(optional)* + - `signal` [AbortSignal] *(optional)* Added in: v1.61# + + Allows to cancel the waiting using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the default timeout; pass `timeout: 0` to disable the timeout entirely. - `timeout` [number] *(optional)*# Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `navigationTimeout` option in the config, or by using the [browserContext.setDefaultNavigationTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-navigation-timeout), [browserContext.setDefaultTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-timeout), [page.setDefaultNavigationTimeout()](/api/class-page.mdx#page-set-default-navigation-timeout) or [page.setDefaultTimeout()](/api/class-page.mdx#page-set-default-timeout) methods. @@ -2406,7 +2412,7 @@ await frame.textContent(selector, options); Added before v1.9frame.type -:::warning Deprecated +:::warning[Deprecated] In most cases, you should use [locator.fill()](/api/class-locator.mdx#locator-fill) instead. You only need to press keys one by one if there is special keyboard handling on the page - in this case use [locator.pressSequentially()](/api/class-locator.mdx#locator-press-sequentially). @@ -2521,7 +2527,7 @@ await frame.uncheck(selector, options); Added before v1.9frame.waitForNavigation -:::warning Deprecated +:::warning[Deprecated] This method is inherently racy, please use [frame.waitForURL()](/api/class-frame.mdx#frame-wait-for-url) instead. @@ -2547,6 +2553,9 @@ Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/Hist **Arguments** - `options` [Object] *(optional)* + - `signal` [AbortSignal] *(optional)* Added in: v1.61# + + Allows to cancel the waiting using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the default timeout; pass `timeout: 0` to disable the timeout entirely. - `timeout` [number] *(optional)*# Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `navigationTimeout` option in the config, or by using the [browserContext.setDefaultNavigationTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-navigation-timeout), [browserContext.setDefaultTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-timeout), [page.setDefaultNavigationTimeout()](/api/class-page.mdx#page-set-default-navigation-timeout) or [page.setDefaultTimeout()](/api/class-page.mdx#page-set-default-timeout) methods. diff --git a/nodejs/docs/api/class-framelocator.mdx b/nodejs/docs/api/class-framelocator.mdx index 3e84fde176..765ca05c57 100644 --- a/nodejs/docs/api/class-framelocator.mdx +++ b/nodejs/docs/api/class-framelocator.mdx @@ -471,7 +471,7 @@ await expect(locator).toBeVisible(); Added in: v1.17frameLocator.first -:::warning Deprecated +:::warning[Deprecated] Use [locator.first()](/api/class-locator.mdx#locator-first) followed by [locator.contentFrame()](/api/class-locator.mdx#locator-content-frame) instead. @@ -495,7 +495,7 @@ frameLocator.first(); Added in: v1.17frameLocator.last -:::warning Deprecated +:::warning[Deprecated] Use [locator.last()](/api/class-locator.mdx#locator-last) followed by [locator.contentFrame()](/api/class-locator.mdx#locator-content-frame) instead. @@ -519,7 +519,7 @@ frameLocator.last(); Added in: v1.17frameLocator.nth -:::warning Deprecated +:::warning[Deprecated] Use [locator.nth()](/api/class-locator.mdx#locator-nth) followed by [locator.contentFrame()](/api/class-locator.mdx#locator-content-frame) instead. diff --git a/nodejs/docs/api/class-locator.mdx b/nodejs/docs/api/class-locator.mdx index 6f850bc5cc..b4f1282343 100644 --- a/nodejs/docs/api/class-locator.mdx +++ b/nodejs/docs/api/class-locator.mdx @@ -2641,7 +2641,7 @@ await locator.elementHandles(); Added in: v1.14locator.type -:::warning Deprecated +:::warning[Deprecated] In most cases, you should use [locator.fill()](/api/class-locator.mdx#locator-fill) instead. You only need to press keys one by one if there is special keyboard handling on the page - in this case use [locator.pressSequentially()](/api/class-locator.mdx#locator-press-sequentially). diff --git a/nodejs/docs/api/class-page.mdx b/nodejs/docs/api/class-page.mdx index 046f77c6f3..dcc52ffbcf 100644 --- a/nodejs/docs/api/class-page.mdx +++ b/nodejs/docs/api/class-page.mdx @@ -2289,6 +2289,9 @@ const download = await downloadPromise; - `predicate` [function] *(optional)*# Receives the event data and resolves to truthy value when the waiting should resolve. + - `signal` [AbortSignal] *(optional)* Added in: v1.61# + + Allows to cancel the waiting using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the default timeout; pass `timeout: 0` to disable the timeout entirely. **Returns** - [Promise]<[Object]># @@ -2381,6 +2384,9 @@ console.log(await popup.title()); // Popup is ready to use. * `'domcontentloaded'` - wait for the `DOMContentLoaded` event to be fired. * `'networkidle'` - **DISCOURAGED** wait until there are no network connections for at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead. - `options` [Object] *(optional)* + - `signal` [AbortSignal] *(optional)* Added in: v1.61# + + Allows to cancel the waiting using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the default timeout; pass `timeout: 0` to disable the timeout entirely. - `timeout` [number] *(optional)*# Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `navigationTimeout` option in the config, or by using the [browserContext.setDefaultNavigationTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-navigation-timeout), [browserContext.setDefaultTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-timeout), [page.setDefaultNavigationTimeout()](/api/class-page.mdx#page-set-default-navigation-timeout) or [page.setDefaultTimeout()](/api/class-page.mdx#page-set-default-timeout) methods. @@ -2417,6 +2423,9 @@ const request = await requestPromise; Request URL string, regex or predicate receiving [Request] object. - `options` [Object] *(optional)* + - `signal` [AbortSignal] *(optional)* Added in: v1.61# + + Allows to cancel the waiting using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the default timeout; pass `timeout: 0` to disable the timeout entirely. - `timeout` [number] *(optional)*# Maximum wait time in milliseconds, defaults to 30 seconds, pass `0` to disable the timeout. The default value can be changed by using the [page.setDefaultTimeout()](/api/class-page.mdx#page-set-default-timeout) method. @@ -2454,6 +2463,9 @@ const response = await responsePromise; Request URL string, regex or predicate receiving [Response] object. When a [baseURL](/api/class-browser.mdx#browser-new-context-option-base-url) via the context options was provided and the passed URL is a path, it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. - `options` [Object] *(optional)* + - `signal` [AbortSignal] *(optional)* Added in: v1.61# + + Allows to cancel the waiting using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the default timeout; pass `timeout: 0` to disable the timeout entirely. - `timeout` [number] *(optional)*# Maximum wait time in milliseconds, defaults to 30 seconds, pass `0` to disable the timeout. The default value can be changed by using the [browserContext.setDefaultTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-timeout) or [page.setDefaultTimeout()](/api/class-page.mdx#page-set-default-timeout) methods. @@ -2481,6 +2493,9 @@ await page.waitForURL('**/target.html'); A glob pattern, regex pattern, URL pattern, or predicate receiving [URL] to match while waiting for the navigation. Note that if the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to the string. - `options` [Object] *(optional)* + - `signal` [AbortSignal] *(optional)* Added in: v1.61# + + Allows to cancel the waiting using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the default timeout; pass `timeout: 0` to disable the timeout entirely. - `timeout` [number] *(optional)*# Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `navigationTimeout` option in the config, or by using the [browserContext.setDefaultNavigationTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-navigation-timeout), [browserContext.setDefaultTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-timeout), [page.setDefaultNavigationTimeout()](/api/class-page.mdx#page-set-default-navigation-timeout) or [page.setDefaultTimeout()](/api/class-page.mdx#page-set-default-timeout) methods. @@ -4439,7 +4454,7 @@ await page.textContent(selector, options); Added before v1.9page.type -:::warning Deprecated +:::warning[Deprecated] In most cases, you should use [locator.fill()](/api/class-locator.mdx#locator-fill) instead. You only need to press keys one by one if there is special keyboard handling on the page - in this case use [locator.pressSequentially()](/api/class-locator.mdx#locator-press-sequentially). @@ -4554,7 +4569,7 @@ await page.uncheck(selector, options); Added before v1.9page.waitForNavigation -:::warning Deprecated +:::warning[Deprecated] This method is inherently racy, please use [page.waitForURL()](/api/class-page.mdx#page-wait-for-url) instead. @@ -4580,6 +4595,9 @@ Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/Hist **Arguments** - `options` [Object] *(optional)* + - `signal` [AbortSignal] *(optional)* Added in: v1.61# + + Allows to cancel the waiting using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the default timeout; pass `timeout: 0` to disable the timeout entirely. - `timeout` [number] *(optional)*# Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `navigationTimeout` option in the config, or by using the [browserContext.setDefaultNavigationTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-navigation-timeout), [browserContext.setDefaultTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-timeout), [page.setDefaultNavigationTimeout()](/api/class-page.mdx#page-set-default-navigation-timeout) or [page.setDefaultTimeout()](/api/class-page.mdx#page-set-default-timeout) methods. diff --git a/nodejs/docs/api/class-testoptions.mdx b/nodejs/docs/api/class-testoptions.mdx index 244eed72b4..35059c6aea 100644 --- a/nodejs/docs/api/class-testoptions.mdx +++ b/nodejs/docs/api/class-testoptions.mdx @@ -952,15 +952,16 @@ export default defineConfig({ Added in: v1.10testOptions.trace -Whether to record trace for each test. Defaults to `'off'`. +Whether to record trace for each test. Defaults to `'off'`. The initial run of a test is the "first run"; subsequent runs caused by [retries](../test-retries.mdx) are "retries". * `'off'`: Do not record trace. -* `'on'`: Record trace for each test. -* `'on-first-retry'`: Record trace only when retrying a test for the first time. -* `'on-all-retries'`: Record trace only when retrying a test. -* `'retain-on-failure'`: Record trace for each test. When test run passes, remove the recorded trace. -* `'retain-on-first-failure'`: Record trace for the first run of each test, but not for retries. When test run passes, remove the recorded trace. -* `'retain-on-failure-and-retries'`: Record trace for each test run. Retains all traces when an attempt fails. -* `'retain-all-failures'`: Record trace for each test run. Retains the trace only for attempts that failed, regardless of the final test outcome. +* `'on'`: Record and keep a trace for every run. +* `'on-first-retry'`: Record and keep a trace only for the first retry of a test. +* `'on-all-retries'`: Record and keep a trace for every retry. +* `'retain-on-failure'`: Record a trace for every run, but keep it only for runs that failed. A failed run's trace is kept even when a later retry passes. +* `'retain-on-first-failure'`: Record a trace only for the first run of a test (not for retries), and keep it only if that run failed. +* `'retain-on-failure-and-retries'`: Record a trace for every run, and keep it for any run that failed or that is a retry. + +See [trace modes](../test-use-options.mdx#trace-modes) for a side-by-side comparison of what each mode records and keeps. For more control, pass an object that specifies `mode` and trace features to enable. @@ -979,8 +980,8 @@ export default defineConfig({ Learn more about [recording trace](../test-use-options.mdx#recording-options). **Type** -- [Object] | "off" | "on" | "retain-on-failure" | "on-first-retry" | "retain-on-first-failure" | "retain-on-failure-and-retries" | "retain-all-failures" - - `mode` "off" | "on" | "retain-on-failure" | "on-first-retry" | "on-all-retries" | "retain-on-first-failure" | "retain-on-failure-and-retries" | "retain-all-failures" +- [Object] | "off" | "on" | "retain-on-failure" | "on-first-retry" | "retain-on-first-failure" | "retain-on-failure-and-retries" + - `mode` "off" | "on" | "retain-on-failure" | "on-first-retry" | "on-all-retries" | "retain-on-first-failure" | "retain-on-failure-and-retries" Trace recording mode. - `attachments` [boolean] *(optional)* @@ -1025,15 +1026,16 @@ export default defineConfig({ Added in: v1.10testOptions.video -Whether to record video for each test. Defaults to `'off'`. +Whether to record video for each test. Defaults to `'off'`. The initial run of a test is the "first run"; subsequent runs caused by [retries](../test-retries.mdx) are "retries". * `'off'`: Do not record video. -* `'on'`: Record video for each test. -* `'on-first-retry'`: Record video only when retrying a test for the first time. -* `'on-all-retries'`: Record video only when retrying a test. -* `'retain-on-failure'`: Record video for each test. When test run passes, remove the recorded video. -* `'retain-on-first-failure'`: Record video for the first run of each test, but not for retries. When test run passes, remove the recorded video. -* `'retain-on-failure-and-retries'`: Record video for each test run. Retains all videos when an attempt fails. -* `'retain-all-failures'`: Record video for each test run. Retains the video only for attempts that failed, regardless of the final test outcome. +* `'on'`: Record and keep a video for every run. +* `'on-first-retry'`: Record and keep a video only for the first retry of a test. +* `'on-all-retries'`: Record and keep a video for every retry. +* `'retain-on-failure'`: Record a video for every run, but keep it only for runs that failed. A failed run's video is kept even when a later retry passes. +* `'retain-on-first-failure'`: Record a video only for the first run of a test (not for retries), and keep it only if that run failed. +* `'retain-on-failure-and-retries'`: Record a video for every run, and keep it for any run that failed or that is a retry. + +See [video modes](../test-use-options.mdx#video-modes) for a side-by-side comparison of what each mode records and keeps. To control video size, pass an object with `mode` and `size` properties. If video size is not specified, it will be equal to [testOptions.viewport](/api/class-testoptions.mdx#test-options-viewport) scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will be scaled down if necessary to fit the specified size. @@ -1054,8 +1056,8 @@ export default defineConfig({ Learn more about [recording video](../test-use-options.mdx#recording-options). **Type** -- [Object] | "off" | "on" | "retain-on-failure" | "on-first-retry" | "on-all-retries" | "retain-on-first-failure" | "retain-on-failure-and-retries" | "retain-all-failures" - - `mode` "off" | "on" | "retain-on-failure" | "on-first-retry" | "on-all-retries" | "retain-on-first-failure" | "retain-on-failure-and-retries" | "retain-all-failures" +- [Object] | "off" | "on" | "retain-on-failure" | "on-first-retry" | "on-all-retries" | "retain-on-first-failure" | "retain-on-failure-and-retries" + - `mode` "off" | "on" | "retain-on-failure" | "on-first-retry" | "on-all-retries" | "retain-on-first-failure" | "retain-on-failure-and-retries" Video recording mode. - `size` [Object] *(optional)* diff --git a/nodejs/docs/api/class-testproject.mdx b/nodejs/docs/api/class-testproject.mdx index 2336c80e6e..387cbfbaa8 100644 --- a/nodejs/docs/api/class-testproject.mdx +++ b/nodejs/docs/api/class-testproject.mdx @@ -737,104 +737,6 @@ testProject.use --- -### webServer {/* #test-project-web-server */} - -Added in: v1.61testProject.webServer - -Launch a development web server (or multiple) before running tests in this project. See [testConfig.webServer](/api/class-testconfig.mdx#test-config-web-server) for the shape of each entry. - -A per-project `webServer` is only launched when the project is selected (either directly via `--project` or indirectly through dependencies). This is useful when only a subset of your projects need a local backend, while others run against a deployed environment. - -Per-project web servers are launched in addition to any top-level [testConfig.webServer](/api/class-testconfig.mdx#test-config-web-server). - -**Usage** - -```js title="playwright.config.ts" -import { defineConfig } from '@playwright/test'; - -export default defineConfig({ - projects: [ - { - name: 'functional', - grepInvert: /@smoke/, - use: { baseURL: 'http://localhost:3000' }, - webServer: [ - { - command: 'npm run start', - url: 'http://localhost:3000', - reuseExistingServer: !process.env.CI, - }, - { - command: 'npm run mock-server', - port: 3001, - reuseExistingServer: !process.env.CI, - }, - ], - }, - { - name: 'smoke', - grep: /@smoke/, - use: { baseURL: 'https://production.app.com' }, - }, - ], -}); -``` - -**Type** -- [Object] | [Array]<[Object]> - - `command` [string] - - Shell command to start. For example `npm run start`.. - - `cwd` [string] *(optional)* - - Current working directory of the spawned process, defaults to the directory of the configuration file. - - `env` [Object]<[string], [string]> *(optional)* - - Environment variables to set for the command, `process.env` by default. - - `gracefulShutdown` [Object] *(optional)* - - `signal` "SIGINT" | "SIGTERM" - - - - `timeout` [number] - - - How to shut down the process. If unspecified, the process group is forcefully `SIGKILL`ed. If set to `{ signal: 'SIGTERM', timeout: 500 }`, the process group is sent a `SIGTERM` signal, followed by `SIGKILL` if it doesn't exit within 500ms. You can also use `SIGINT` as the signal instead. A `0` timeout means no `SIGKILL` will be sent. Windows doesn't support `SIGTERM` and `SIGINT` signals, so this option is ignored on Windows. Note that shutting down a Docker container requires `SIGTERM`. - - `ignoreHTTPSErrors` [boolean] *(optional)* - - Whether to ignore HTTPS errors when fetching the `url`. Defaults to `false`. - - `name` [string] *(optional)* - - Specifies a custom name for the web server. This name will be prefixed to log messages. Defaults to `[WebServer]`. - - `port` [number] *(optional)* - - The port that your http server is expected to appear on. It does wait until it accepts connections. Either `port` or `url` should be specified. - - `reuseExistingServer` [boolean] *(optional)* - - If true, it will re-use an existing server on the `port` or `url` when available. If no server is running on that `port` or `url`, it will run the command to start a new server. If `false`, it will throw if an existing process is listening on the `port` or `url`. This should be commonly set to `!process.env.CI` to allow the local dev server when running tests locally. - - `stderr` "pipe" | "ignore" *(optional)* - - Whether to pipe the stderr of the command to the process stderr or ignore it. Defaults to `"pipe"`. - - `stdout` "pipe" | "ignore" *(optional)* - - If `"pipe"`, it will pipe the stdout of the command to the process stdout. If `"ignore"`, it will ignore the stdout of the command. Default to `"ignore"`. - - `wait` [Object] *(optional)* - - `stdout` [RegExp] *(optional)* - - Regular expression to wait for in the `stdout` of the command output. Named capture groups are stored in the environment, for example `/Listening on port (?\d+)/` will store the port number in `process.env['MY_SERVER_PORT']`. - - `stderr` [RegExp] *(optional)* - - Regular expression to wait for in the `stderr` of the command output. Named capture groups are stored in the environment, for example `/Listening on port (?\d+)/` will store the port number in `process.env['MY_SERVER_PORT']`. - - Consider command started only when given output has been produced. - - `timeout` [number] *(optional)* - - How long to wait for the process to start up and be available in milliseconds. Defaults to 60000. - - `url` [string] *(optional)* - - The url on your http server that is expected to return a 2xx, 3xx, 400, 401, 402, or 403 status code when the server is ready to accept connections. Redirects (3xx status codes) are being followed and the new location is checked. Either `port` or `url` should be specified. - ---- - ### workers {/* #test-project-workers */} Added in: v1.52testProject.workers diff --git a/nodejs/docs/api/class-websocket.mdx b/nodejs/docs/api/class-websocket.mdx index 2095977d15..eeabbcc0bf 100644 --- a/nodejs/docs/api/class-websocket.mdx +++ b/nodejs/docs/api/class-websocket.mdx @@ -80,6 +80,9 @@ await webSocket.waitForEvent(event, optionsOrPredicate, options); - `predicate` [function] *(optional)*# Receives the event data and resolves to truthy value when the waiting should resolve. + - `signal` [AbortSignal] *(optional)* Added in: v1.61# + + Allows to cancel the waiting using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the default timeout; pass `timeout: 0` to disable the timeout entirely. **Returns** - [Promise]<[Object]># diff --git a/nodejs/docs/api/class-worker.mdx b/nodejs/docs/api/class-worker.mdx index 6c23c0b7c6..f8da961aa1 100644 --- a/nodejs/docs/api/class-worker.mdx +++ b/nodejs/docs/api/class-worker.mdx @@ -132,6 +132,9 @@ const consoleMessage = await consolePromise; - `predicate` [function] *(optional)*# Receives the event data and resolves to truthy value when the waiting should resolve. + - `signal` [AbortSignal] *(optional)* Added in: v1.61# + + Allows to cancel the waiting using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the default timeout; pass `timeout: 0` to disable the timeout entirely. **Returns** - [Promise]<[Object]># diff --git a/nodejs/docs/test-cli.mdx b/nodejs/docs/test-cli.mdx index 037d7e5014..3b2782f227 100644 --- a/nodejs/docs/test-cli.mdx +++ b/nodejs/docs/test-cli.mdx @@ -110,7 +110,7 @@ npx playwright test --ui | `--test-list ` | Path to a file containing a list of tests to run. See [test list](#test-list) for details. | | `--test-list-invert ` | Path to a file containing a list of tests to skip. See [test list](#test-list) for details. | | `--timeout ` | Specify test timeout threshold in milliseconds, zero for unlimited (default: 30 seconds). | -| `--trace ` | Force tracing mode, can be `on`, `off`, `on-first-retry`, `on-all-retries`, `retain-on-failure`, `retain-on-first-failure`, `retain-on-failure-and-retries`, `retain-all-failures`. | +| `--trace ` | Force tracing mode, can be `on`, `off`, `on-first-retry`, `on-all-retries`, `retain-on-failure`, `retain-on-first-failure`, `retain-on-failure-and-retries`. | | `--tsconfig ` | Path to a single tsconfig applicable to all imported files (default: look up tsconfig for each imported file separately). | | `--ui` | Run tests in interactive UI mode. | | `--ui-host ` | Host to serve UI on; specifying this option opens UI in a browser tab. | diff --git a/nodejs/docs/test-use-options.mdx b/nodejs/docs/test-use-options.mdx index 0336f5504d..0344a83296 100644 --- a/nodejs/docs/test-use-options.mdx +++ b/nodejs/docs/test-use-options.mdx @@ -153,6 +153,58 @@ export default defineConfig({ | [testOptions.trace](/api/class-testoptions.mdx#test-options-trace) | Playwright can produce test traces while running the tests. Later on, you can view the trace and get detailed information about Playwright execution by opening [Trace Viewer](./trace-viewer.mdx). Options include: `'off'`, `'on'`, `'retain-on-failure'` and `'on-first-retry'` | | [testOptions.video](/api/class-testoptions.mdx#test-options-video) | Playwright can record [videos](./videos.mdx) for your tests. Options include: `'off'`, `'on'`, `'retain-on-failure'` and `'on-first-retry'` | +#### Trace modes + +The `trace` option supports several modes that differ in **which runs are recorded** and **which recordings are kept** after the test finishes. The initial run of a test is the "first run"; subsequent runs caused by [retries](./test-retries.mdx) are "retries". + +| Mode | Records a trace on | Keeps the trace when | +| :- | :- | :- | +| `'off'` | never | — | +| `'on'` | every run | always | +| `'retain-on-failure'` | every run | that run failed | +| `'retain-on-first-failure'` | first run only | the first run failed | +| `'retain-on-failure-and-retries'` | every run | that run failed, or it is a retry | +| `'on-first-retry'` | first retry only | always | +| `'on-all-retries'` | every retry | always | + +The following table shows which traces are kept in a few common scenarios, assuming `retries: 2` is configured: + +| Mode | Passes on first run | Fails, then passes on retry | Fails on every run | +| :- | :- | :- | :- | +| `'off'` | — | — | — | +| `'on'` | first run | first run + retry | all three runs | +| `'retain-on-failure'` | — | first run | all three runs | +| `'retain-on-first-failure'` | — | first run | first run | +| `'retain-on-failure-and-retries'` | — | first run + retry | all three runs | +| `'on-first-retry'` | — | first retry | first retry | +| `'on-all-retries'` | — | first retry | both retries | + +#### Video modes + +The `video` option supports the same set of modes as `trace`, and they record and keep recordings using the same rules. + +| Mode | Records a video on | Keeps the video when | +| :- | :- | :- | +| `'off'` | never | — | +| `'on'` | every run | always | +| `'retain-on-failure'` | every run | that run failed | +| `'retain-on-first-failure'` | first run only | the first run failed | +| `'retain-on-failure-and-retries'` | every run | that run failed, or it is a retry | +| `'on-first-retry'` | first retry only | always | +| `'on-all-retries'` | every retry | always | + +The following table shows which videos are kept in a few common scenarios, assuming `retries: 2` is configured: + +| Mode | Passes on first run | Fails, then passes on retry | Fails on every run | +| :- | :- | :- | :- | +| `'off'` | — | — | — | +| `'on'` | first run | first run + retry | all three runs | +| `'retain-on-failure'` | — | first run | all three runs | +| `'retain-on-first-failure'` | — | first run | first run | +| `'retain-on-failure-and-retries'` | — | first run + retry | all three runs | +| `'on-first-retry'` | — | first retry | first retry | +| `'on-all-retries'` | — | first retry | both retries | + ### Other Options ```js title="playwright.config.ts" diff --git a/python/docs/api/class-browsercontext.mdx b/python/docs/api/class-browsercontext.mdx index acc4c4b7cf..c4c8679d94 100644 --- a/python/docs/api/class-browsercontext.mdx +++ b/python/docs/api/class-browsercontext.mdx @@ -1937,7 +1937,7 @@ browser_context.on("weberror", handler) Added in: v1.11browserContext.on("backgroundpage") -:::warning Deprecated +:::warning[Deprecated] Background pages have been removed from Chromium together with Manifest V2 extensions. @@ -1961,7 +1961,7 @@ browser_context.on("backgroundpage", handler) Added in: v1.11browserContext.background_pages -:::warning Deprecated +:::warning[Deprecated] Background pages have been removed from Chromium together with Manifest V2 extensions. diff --git a/python/docs/api/class-elementhandle.mdx b/python/docs/api/class-elementhandle.mdx index 563690784f..d27bdf3572 100644 --- a/python/docs/api/class-elementhandle.mdx +++ b/python/docs/api/class-elementhandle.mdx @@ -1616,7 +1616,7 @@ element_handle.text_content() Added before v1.9elementHandle.type -:::warning Deprecated +:::warning[Deprecated] In most cases, you should use [locator.fill()](/api/class-locator.mdx#locator-fill) instead. You only need to press keys one by one if there is special keyboard handling on the page - in this case use [locator.press_sequentially()](/api/class-locator.mdx#locator-press-sequentially). diff --git a/python/docs/api/class-frame.mdx b/python/docs/api/class-frame.mdx index efab73ede4..d876c11ecc 100644 --- a/python/docs/api/class-frame.mdx +++ b/python/docs/api/class-frame.mdx @@ -1972,7 +1972,7 @@ divs_counts = await frame.eval_on_selector_all("div", "(divs, min) => divs.lengt Added before v1.9frame.expect_navigation -:::warning Deprecated +:::warning[Deprecated] This method is inherently racy, please use [frame.wait_for_url()](/api/class-frame.mdx#frame-wait-for-url) instead. @@ -2998,7 +2998,7 @@ frame.text_content(selector, **kwargs) Added before v1.9frame.type -:::warning Deprecated +:::warning[Deprecated] In most cases, you should use [locator.fill()](/api/class-locator.mdx#locator-fill) instead. You only need to press keys one by one if there is special keyboard handling on the page - in this case use [locator.press_sequentially()](/api/class-locator.mdx#locator-press-sequentially). diff --git a/python/docs/api/class-framelocator.mdx b/python/docs/api/class-framelocator.mdx index 91f4b43850..3f8e9e400e 100644 --- a/python/docs/api/class-framelocator.mdx +++ b/python/docs/api/class-framelocator.mdx @@ -679,7 +679,7 @@ await expect(locator).to_be_visible() Added in: v1.17frameLocator.first -:::warning Deprecated +:::warning[Deprecated] Use [locator.first](/api/class-locator.mdx#locator-first) followed by [locator.content_frame](/api/class-locator.mdx#locator-content-frame) instead. @@ -703,7 +703,7 @@ frame_locator.first Added in: v1.17frameLocator.last -:::warning Deprecated +:::warning[Deprecated] Use [locator.last](/api/class-locator.mdx#locator-last) followed by [locator.content_frame](/api/class-locator.mdx#locator-content-frame) instead. @@ -727,7 +727,7 @@ frame_locator.last Added in: v1.17frameLocator.nth -:::warning Deprecated +:::warning[Deprecated] Use [locator.nth()](/api/class-locator.mdx#locator-nth) followed by [locator.content_frame](/api/class-locator.mdx#locator-content-frame) instead. diff --git a/python/docs/api/class-locator.mdx b/python/docs/api/class-locator.mdx index 8ae199cc44..1363fe69f5 100644 --- a/python/docs/api/class-locator.mdx +++ b/python/docs/api/class-locator.mdx @@ -3617,7 +3617,7 @@ locator.element_handles() Added in: v1.14locator.type -:::warning Deprecated +:::warning[Deprecated] In most cases, you should use [locator.fill()](/api/class-locator.mdx#locator-fill) instead. You only need to press keys one by one if there is special keyboard handling on the page - in this case use [locator.press_sequentially()](/api/class-locator.mdx#locator-press-sequentially). diff --git a/python/docs/api/class-page.mdx b/python/docs/api/class-page.mdx index baa79855bf..7436478859 100644 --- a/python/docs/api/class-page.mdx +++ b/python/docs/api/class-page.mdx @@ -4736,7 +4736,7 @@ div_counts = await page.eval_on_selector_all("div", "(divs, min) => divs.length Added before v1.9page.expect_navigation -:::warning Deprecated +:::warning[Deprecated] This method is inherently racy, please use [page.wait_for_url()](/api/class-page.mdx#page-wait-for-url) instead. @@ -5823,7 +5823,7 @@ page.text_content(selector, **kwargs) Added before v1.9page.type -:::warning Deprecated +:::warning[Deprecated] In most cases, you should use [locator.fill()](/api/class-locator.mdx#locator-fill) instead. You only need to press keys one by one if there is special keyboard handling on the page - in this case use [locator.press_sequentially()](/api/class-locator.mdx#locator-press-sequentially). diff --git a/src/generator.js b/src/generator.js index ea585ac9c1..4b0ef370a4 100644 --- a/src/generator.js +++ b/src/generator.js @@ -278,7 +278,7 @@ ${this.documentation.renderLinksInText(clazz.deprecated)} if (member.deprecated) { sections.deprecation.push({ type: 'text', - text: `:::warning Deprecated + text: `:::warning[Deprecated] ${this.documentation.renderLinksInText(member.deprecated)}