Skip to content

Commit f05df51

Browse files
committed
chore: delete page.accessibilitiy
1 parent daae9b5 commit f05df51

File tree

23 files changed

+1
-1938
lines changed

23 files changed

+1
-1938
lines changed

docs/src/api/class-accessibility.md

Lines changed: 0 additions & 170 deletions
This file was deleted.

docs/src/api/class-page.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -557,13 +557,6 @@ Emitted when [WebSocket] request is sent.
557557
Emitted when a dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is spawned by the
558558
page.
559559

560-
## property: Page.accessibility
561-
* since: v1.8
562-
* langs: csharp, js, python
563-
* deprecated: This property is discouraged. Please use other libraries such as
564-
[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.
565-
- type: <[Accessibility]>
566-
567560
## async method: Page.addInitScript
568561
* since: v1.8
569562

packages/playwright-client/types/types.d.ts

Lines changed: 0 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -5167,13 +5167,6 @@ export interface Page {
51675167
*/
51685168
workers(): Array<Worker>;
51695169

5170-
/**
5171-
* @deprecated This property is discouraged. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you need to
5172-
* test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for integration
5173-
* with Axe.
5174-
*/
5175-
accessibility: Accessibility;
5176-
51775170
/**
51785171
* Playwright has ability to mock clock and passage of time.
51795172
*/
@@ -15772,97 +15765,6 @@ class TimeoutError extends Error {
1577215765

1577315766
}
1577415767

15775-
/**
15776-
* The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is
15777-
* used by assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or
15778-
* [switches](https://en.wikipedia.org/wiki/Switch_access).
15779-
*
15780-
* Accessibility is a very platform-specific thing. On different platforms, there are different screen readers that
15781-
* might have wildly different output.
15782-
*
15783-
* Rendering engines of Chromium, Firefox and WebKit have a concept of "accessibility tree", which is then translated
15784-
* into different platform-specific APIs. Accessibility namespace gives access to this Accessibility Tree.
15785-
*
15786-
* Most of the accessibility tree gets filtered out when converting from internal browser AX Tree to Platform-specific
15787-
* AX-Tree or by assistive technologies themselves. By default, Playwright tries to approximate this filtering,
15788-
* exposing only the "interesting" nodes of the tree.
15789-
*/
15790-
export interface Accessibility {
15791-
/**
15792-
* Captures the current state of the accessibility tree. The returned object represents the root accessible node of
15793-
* the page.
15794-
*
15795-
* **NOTE** The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen
15796-
* readers. Playwright will discard them as well for an easier to process tree, unless
15797-
* [`interestingOnly`](https://playwright.dev/docs/api/class-accessibility#accessibility-snapshot-option-interesting-only)
15798-
* is set to `false`.
15799-
*
15800-
* **Usage**
15801-
*
15802-
* An example of dumping the entire accessibility tree:
15803-
*
15804-
* ```js
15805-
* const snapshot = await page.accessibility.snapshot();
15806-
* console.log(snapshot);
15807-
* ```
15808-
*
15809-
* An example of logging the focused node's name:
15810-
*
15811-
* ```js
15812-
* const snapshot = await page.accessibility.snapshot();
15813-
* const node = findFocusedNode(snapshot);
15814-
* console.log(node && node.name);
15815-
*
15816-
* function findFocusedNode(node) {
15817-
* if (node.focused)
15818-
* return node;
15819-
* for (const child of node.children || []) {
15820-
* const foundNode = findFocusedNode(child);
15821-
* if (foundNode)
15822-
* return foundNode;
15823-
* }
15824-
* return null;
15825-
* }
15826-
* ```
15827-
*
15828-
* @deprecated This method is deprecated. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you need to test
15829-
* page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for integration with
15830-
* Axe.
15831-
* @param options
15832-
*/
15833-
snapshot(options?: AccessibilitySnapshotOptions): Promise<null|AccessibilityNode>;
15834-
15835-
}
15836-
15837-
type AccessibilityNode = {
15838-
role: string;
15839-
name: string;
15840-
value?: string|number;
15841-
description?: string;
15842-
keyshortcuts?: string;
15843-
roledescription?: string;
15844-
valuetext?: string;
15845-
disabled?: boolean;
15846-
expanded?: boolean;
15847-
focused?: boolean;
15848-
modal?: boolean;
15849-
multiline?: boolean;
15850-
multiselectable?: boolean;
15851-
readonly?: boolean;
15852-
required?: boolean;
15853-
selected?: boolean;
15854-
checked?: boolean|"mixed";
15855-
pressed?: boolean|"mixed";
15856-
level?: number;
15857-
valuemin?: number;
15858-
valuemax?: number;
15859-
autocomplete?: string;
15860-
haspopup?: string;
15861-
invalid?: string;
15862-
orientation?: string;
15863-
children?: AccessibilityNode[];
15864-
}
15865-
1586615768
export const devices: Devices;
1586715769

1586815770
//@ts-ignore this will be any if electron is not installed
@@ -21768,18 +21670,6 @@ export interface WebSocket {
2176821670

2176921671
}
2177021672

21771-
interface AccessibilitySnapshotOptions {
21772-
/**
21773-
* Prune uninteresting nodes from the tree. Defaults to `true`.
21774-
*/
21775-
interestingOnly?: boolean;
21776-
21777-
/**
21778-
* The root DOM element for the snapshot. Defaults to the whole page.
21779-
*/
21780-
root?: ElementHandle;
21781-
}
21782-
2178321673
export interface LaunchOptions {
2178421674
/**
2178521675
* **NOTE** Use custom browser args at your own risk, as some of them may break Playwright functionality.

packages/playwright-core/src/client/accessibility.ts

Lines changed: 0 additions & 54 deletions
This file was deleted.

packages/playwright-core/src/client/api.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
export { Accessibility } from './accessibility';
1817
export { Android, AndroidDevice, AndroidInput, AndroidSocket, AndroidWebView } from './android';
1918
export { Browser } from './browser';
2019
export { BrowserContext } from './browserContext';

0 commit comments

Comments
 (0)