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 `