docs: deprecate Page.accessibility (#16385)

This commit is contained in:
Yury Semikhatsky 2022-08-09 12:26:43 -07:00 committed by GitHub
parent e725b5f8a9
commit d048822c58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 0 deletions

View file

@ -2,6 +2,8 @@
* since: v1.8 * since: v1.8
* langs: csharp, js, python * 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 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 assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or
[switches](https://en.wikipedia.org/wiki/Switch_access). [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. - `orientation` <[string]> Whether the node is oriented horizontally or vertically, if applicable.
- `children` <[Array]<[Object]>> Child nodes, if any, 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 Captures the current state of the accessibility tree. The returned object represents the root accessible node of the
page. page.

View file

@ -560,6 +560,8 @@ page.
* langs: csharp, js, python * langs: csharp, js, python
- type: <[Accessibility]> - 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 ## async method: Page.addInitScript
* since: v1.8 * since: v1.8

View file

@ -1723,6 +1723,12 @@ export interface Page {
*/ */
prependListener(event: 'worker', listener: (worker: Worker) => void): this; 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; 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 * 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 * assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or
* [switches](https://en.wikipedia.org/wiki/Switch_access). * [switches](https://en.wikipedia.org/wiki/Switch_access).
@ -11105,6 +11115,10 @@ class TimeoutError extends Error {}
*/ */
export interface Accessibility { 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 * Captures the current state of the accessibility tree. The returned object represents the root accessible node of the
* page. * page.
* *
@ -11137,6 +11151,7 @@ export interface Accessibility {
* } * }
* ``` * ```
* *
* @deprecated
* @param options * @param options
*/ */
snapshot(options?: AccessibilitySnapshotOptions): Promise<null|AccessibilityNode>; snapshot(options?: AccessibilitySnapshotOptions): Promise<null|AccessibilityNode>;