From f9a32e0927b9e01e197376333cd871cdfa66684a Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Wed, 23 Nov 2022 12:32:14 -0800 Subject: [PATCH] chore: follow up to deprecation changes (#19025) --- docs/src/api/class-frame.md | 67 +- docs/src/api/class-page.md | 70 +- packages/playwright-core/types/types.d.ts | 769 +++++++++++------- packages/playwright-test/types/test.d.ts | 66 +- .../playwright-test/types/testReporter.d.ts | 7 +- utils/doclint/documentation.js | 2 +- utils/generate_types/index.js | 12 +- utils/markdown.js | 2 +- 8 files changed, 597 insertions(+), 398 deletions(-) diff --git a/docs/src/api/class-frame.md b/docs/src/api/class-frame.md index 8b257fa587..cbd4d1c2de 100644 --- a/docs/src/api/class-frame.md +++ b/docs/src/api/class-frame.md @@ -188,7 +188,7 @@ Raw CSS content to be injected into frame. ## async method: Frame.check * since: v1.8 -* discouraged: Use locator-based [`method: Locator.check`] instead. +* discouraged: Use locator-based [`method: Locator.check`] instead. Read more about [locators](../locators.md). This method checks an element matching [`param: selector`] by performing the following steps: 1. Find an element matching [`param: selector`]. If there is none, wait until a matching element is attached to @@ -232,7 +232,7 @@ When all steps combined have not finished during the specified [`option: timeout ## async method: Frame.click * since: v1.8 -* discouraged: Use locator-based [`method: Locator.click`] instead. +* discouraged: Use locator-based [`method: Locator.click`] instead. Read more about [locators](../locators.md). This method clicks an element matching [`param: selector`] by performing the following steps: 1. Find an element matching [`param: selector`]. If there is none, wait until a matching element is attached to @@ -287,7 +287,7 @@ Gets the full HTML contents of the frame, including the doctype. ## async method: Frame.dblclick * since: v1.8 -* discouraged: Use locator-based [`method: Locator.dblclick`] instead. +* discouraged: Use locator-based [`method: Locator.dblclick`] instead. Read more about [locators](../locators.md). * langs: - alias-csharp: DblClickAsync @@ -340,7 +340,7 @@ When all steps combined have not finished during the specified [`option: timeout ## async method: Frame.dispatchEvent * since: v1.8 -* discouraged: Use locator-based [`method: Locator.dispatchEvent`] instead. +* discouraged: Use locator-based [`method: Locator.dispatchEvent`] instead. Read more about [locators](../locators.md). The snippet below dispatches the `click` event on the element. Regardless of the visibility state of the element, `click` is dispatched. This is equivalent to calling @@ -469,7 +469,8 @@ Optional event-specific initialization properties. ## async method: Frame.evalOnSelector * since: v1.9 -* discouraged: Use locator-based [`method: Locator.evaluate`] instead. +* discouraged: This method does not wait for the element to pass the actionability + checks and therefore can lead to the flaky tests. Use [`method: Locator.evaluate`], other [Locator] helper methods or web-first assertions instead. * langs: - alias-python: eval_on_selector - alias-js: $eval @@ -477,11 +478,6 @@ Optional event-specific initialization properties. Returns the return value of [`param: expression`]. -:::caution -This method does not wait for the element to pass actionability checks and therefore can lead to -the flaky tests. Use [`method: Locator.evaluate`], other [Locator] helper methods or web-first assertions instead. -::: - The method finds an element matching the specified selector within the frame and passes it as a first argument to [`param: expression`]. See [Working with selectors](../selectors.md) for more details. If no elements match the selector, the method throws an error. @@ -538,7 +534,8 @@ Optional argument to pass to [`param: expression`]. ## async method: Frame.evalOnSelectorAll * since: v1.9 -* discouraged: Use locator-based [`method: Locator.evaluateAll`] instead. +* discouraged: In most cases, [`method: Locator.evaluateAll`], + other [Locator] helper methods and web-first assertions do a better job. * langs: - alias-python: eval_on_selector_all - alias-js: $$eval @@ -546,10 +543,6 @@ Optional argument to pass to [`param: expression`]. Returns the return value of [`param: expression`]. -:::note -In most cases, [`method: Locator.evaluateAll`], other [Locator] helper methods and web-first assertions do a better job. -::: - The method finds all elements matching the specified selector within the frame and passes an array of matched elements as a first argument to [`param: expression`]. See [Working with selectors](../selectors.md) for more details. @@ -811,7 +804,7 @@ Optional argument to pass to [`param: expression`]. ## async method: Frame.fill * since: v1.8 -* discouraged: Use locator-based [`method: Locator.fill`] instead. +* discouraged: Use locator-based [`method: Locator.fill`] instead. Read more about [locators](../locators.md). This method waits for an element matching [`param: selector`], waits for [actionability](../actionability.md) checks, focuses the element, fills it and triggers an `input` event after filling. Note that you can pass an empty string to clear the input field. @@ -842,7 +835,7 @@ Value to fill for the ``, `