From f5823786fd7d0a79346fd0d0407d9ac75b2722c3 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Mon, 25 Mar 2024 19:22:15 +0100 Subject: [PATCH] docs: migrate to newer :::warning syntax (#30089) - Migrate from `:::warning` to `:::danger[Warning]`. - Migrate from `:::caution` to `:::warning`. - `:::warning` and `:::caution` were the color same before. - `:::caution` is deprecated and gets removed in v4 of Docusaurus - Also migrate to the [newer title syntax](https://github.com/facebook/docusaurus/blob/3877c1254f29a64b9f2301775d9ecc2ae5e2a740/packages/docusaurus-utils/src/markdownUtils.ts#L86-L91) --------- Signed-off-by: Max Schmitt Co-authored-by: Dmitry Gozman --- docs/src/accessibility-testing-js.md | 2 +- docs/src/api/class-elementhandle.md | 2 +- docs/src/api/class-locator.md | 26 +++++++++++------------ docs/src/api/class-page.md | 2 +- docs/src/api/params.md | 5 ++--- docs/src/handles.md | 2 +- docs/src/locators.md | 16 +++++++------- packages/playwright-core/types/types.d.ts | 21 ++++++++---------- 8 files changed, 36 insertions(+), 40 deletions(-) diff --git a/docs/src/accessibility-testing-js.md b/docs/src/accessibility-testing-js.md index d367662545..96fe1f1865 100644 --- a/docs/src/accessibility-testing-js.md +++ b/docs/src/accessibility-testing-js.md @@ -14,7 +14,7 @@ A few examples of problems this can catch include: The following examples rely on the [`@axe-core/playwright`](https://npmjs.org/@axe-core/playwright) package which adds support for running the [axe accessibility testing engine](https://www.deque.com/axe/) as part of your Playwright tests. -:::note Disclaimer +:::note[Disclaimer] Automated accessibility tests can detect some common accessibility problems such as missing or invalid properties. But many accessibility problems can only be discovered through manual testing. We recommend using a combination of automated testing, manual accessibility assessments, and inclusive user testing. For manual assessments, we recommend [Accessibility Insights for Web](https://accessibilityinsights.io/docs/web/overview/?referrer=playwright-accessibility-testing-js), a free and open source dev tool that walks you through assessing a website for [WCAG 2.1 AA](https://www.w3.org/WAI/WCAG21/quickref/?currentsidebar=%23col_customize&levels=aaa) coverage. diff --git a/docs/src/api/class-elementhandle.md b/docs/src/api/class-elementhandle.md index 6d727f675a..3f27509a0d 100644 --- a/docs/src/api/class-elementhandle.md +++ b/docs/src/api/class-elementhandle.md @@ -4,7 +4,7 @@ ElementHandle represents an in-page DOM element. ElementHandles can be created with the [`method: Page.querySelector`] method. -:::caution Discouraged +:::warning[Discouraged] The use of ElementHandle is discouraged, use [Locator] objects and web-first assertions instead. ::: diff --git a/docs/src/api/class-locator.md b/docs/src/api/class-locator.md index 50ef738c9a..9ccfa6c2b1 100644 --- a/docs/src/api/class-locator.md +++ b/docs/src/api/class-locator.md @@ -53,7 +53,7 @@ foreach (var li in await page.GetByRole("listitem").AllAsync()) Returns an array of `node.innerText` values for all matching nodes. -:::caution Asserting text +:::warning[Asserting text] If you need to assert text on the page, prefer [`method: LocatorAssertions.toHaveText`] with [`option: useInnerText`] option to avoid flakiness. See [assertions guide](../test-assertions.md) for more details. ::: @@ -85,7 +85,7 @@ var texts = await page.GetByRole(AriaRole.Link).AllInnerTextsAsync(); Returns an array of `node.textContent` values for all matching nodes. -:::caution Asserting text +:::warning[Asserting text] If you need to assert text on the page, prefer [`method: LocatorAssertions.toHaveText`] to avoid flakiness. See [assertions guide](../test-assertions.md) for more details. ::: @@ -443,7 +443,7 @@ await page.Locator("canvas").ClickAsync(new() { Returns the number of elements matching the locator. -:::caution Asserting count +:::warning[Asserting count] If you need to assert the number of elements on the page, prefer [`method: LocatorAssertions.toHaveCount`] to avoid flakiness. See [assertions guide](../test-assertions.md) for more details. ::: @@ -1121,7 +1121,7 @@ await locator.ClickAsync(); Returns the matching element's attribute value. -:::caution Asserting attributes +:::warning[Asserting attributes] If you need to assert an element's attribute, prefer [`method: LocatorAssertions.toHaveAttribute`] to avoid flakiness. See [assertions guide](../test-assertions.md) for more details. ::: @@ -1293,7 +1293,7 @@ Returns the [`element.innerHTML`](https://developer.mozilla.org/en-US/docs/Web/A Returns the [`element.innerText`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/innerText). -:::caution Asserting text +:::warning[Asserting text] If you need to assert text on the page, prefer [`method: LocatorAssertions.toHaveText`] with [`option: useInnerText`] option to avoid flakiness. See [assertions guide](../test-assertions.md) for more details. ::: @@ -1309,7 +1309,7 @@ If you need to assert text on the page, prefer [`method: LocatorAssertions.toHav Returns the value for the matching `` or `