Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

docs: deprecate Page.accessibility (#16385)

Yury Semikhatskyd048822c58a9
diff --git a/docs/src/api/class-accessibility.md b/docs/src/api/class-accessibility.md
index 6fe8d9ec84..7230f05588 100644
--- a/docs/src/api/class-accessibility.md
+++ b/docs/src/api/class-accessibility.md
@@ -2,6 +2,8 @@
* since: v1.8
* langs: csharp, js, python
+**DEPRECATED** This class is deprecated. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for integration with Axe.
+
The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is used by
assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or
[switches](https://en.wikipedia.org/wiki/Switch_access).
@@ -46,6 +48,8 @@ assistive technologies themselves. By default, Playwright tries to approximate t
- `orientation` <[string]> Whether the node is oriented horizontally or vertically, if applicable.
- `children` <[Array]<[Object]>> Child nodes, if any, if applicable.
+**DEPRECATED** This method is deprecated. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for integration with Axe.
+
Captures the current state of the accessibility tree. The returned object represents the root accessible node of the
page.
diff --git a/docs/src/api/class-page.md b/docs/src/api/class-page.md
index 91b9e0d912..747df53999 100644
--- a/docs/src/api/class-page.md
+++ b/docs/src/api/class-page.md
@@ -560,6 +560,8 @@ page.
* langs: csharp, js, python
- type: <[Accessibility]>
+**DEPRECATED** This property is deprecated. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for integration with Axe.
+
## async method: Page.addInitScript
* since: v1.8
diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.ts
index 6c4fe958b0..c85c16b037 100644
--- a/packages/playwright-core/types/types.d.ts
+++ b/packages/playwright-core/types/types.d.ts
@@ -1723,6 +1723,12 @@ export interface Page {
*/
prependListener(event: 'worker', listener: (worker: Worker) => void): this;
+ /**
+ * **DEPRECATED** This property is deprecated. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you
+ * need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for
+ * integration with Axe.
+ * @deprecated
+ */
accessibility: Accessibility;
/**
@@ -11089,6 +11095,10 @@ class TimeoutError extends Error {}
}
/**
+ * **DEPRECATED** This class is deprecated. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you
+ * need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for
+ * integration with Axe.
+ *
* The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is used by
* assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or
* [switches](https://en.wikipedia.org/wiki/Switch_access).
@@ -11105,6 +11115,10 @@ class TimeoutError extends Error {}
*/
export interface Accessibility {
/**
+ * **DEPRECATED** This method is deprecated. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you
+ * need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for
+ * integration with Axe.
+ *
* Captures the current state of the accessibility tree. The returned object represents the root accessible node of the
* page.
*
@@ -11137,6 +11151,7 @@ export interface Accessibility {
* }
* ```
*
+ * @deprecated
* @param options
*/
snapshot(options?: AccessibilitySnapshotOptions): Promise<null|AccessibilityNode>;