Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 0 additions & 170 deletions docs/src/api/class-accessibility.md

This file was deleted.

7 changes: 0 additions & 7 deletions docs/src/api/class-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -557,13 +557,6 @@ Emitted when [WebSocket] request is sent.
Emitted when a dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is spawned by the
page.

## property: Page.accessibility
* since: v1.8
* langs: csharp, js, python
* deprecated: This property is discouraged. 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.
- type: <[Accessibility]>

## async method: Page.addInitScript
* since: v1.8

Expand Down
110 changes: 0 additions & 110 deletions packages/playwright-client/types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5167,13 +5167,6 @@ export interface Page {
*/
workers(): Array<Worker>;

/**
* @deprecated This property is discouraged. 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.
*/
accessibility: Accessibility;

/**
* Playwright has ability to mock clock and passage of time.
*/
Expand Down Expand Up @@ -15772,97 +15765,6 @@ class TimeoutError extends Error {

}

/**
* 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).
*
* Accessibility is a very platform-specific thing. On different platforms, there are different screen readers that
* might have wildly different output.
*
* Rendering engines of Chromium, Firefox and WebKit have a concept of "accessibility tree", which is then translated
* into different platform-specific APIs. Accessibility namespace gives access to this Accessibility Tree.
*
* Most of the accessibility tree gets filtered out when converting from internal browser AX Tree to Platform-specific
* AX-Tree or by assistive technologies themselves. By default, Playwright tries to approximate this filtering,
* exposing only the "interesting" nodes of the tree.
*/
export interface Accessibility {
/**
* Captures the current state of the accessibility tree. The returned object represents the root accessible node of
* the page.
*
* **NOTE** The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen
* readers. Playwright will discard them as well for an easier to process tree, unless
* [`interestingOnly`](https://playwright.dev/docs/api/class-accessibility#accessibility-snapshot-option-interesting-only)
* is set to `false`.
*
* **Usage**
*
* An example of dumping the entire accessibility tree:
*
* ```js
* const snapshot = await page.accessibility.snapshot();
* console.log(snapshot);
* ```
*
* An example of logging the focused node's name:
*
* ```js
* const snapshot = await page.accessibility.snapshot();
* const node = findFocusedNode(snapshot);
* console.log(node && node.name);
*
* function findFocusedNode(node) {
* if (node.focused)
* return node;
* for (const child of node.children || []) {
* const foundNode = findFocusedNode(child);
* if (foundNode)
* return foundNode;
* }
* return null;
* }
* ```
*
* @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.
* @param options
*/
snapshot(options?: AccessibilitySnapshotOptions): Promise<null|AccessibilityNode>;

}

type AccessibilityNode = {
role: string;
name: string;
value?: string|number;
description?: string;
keyshortcuts?: string;
roledescription?: string;
valuetext?: string;
disabled?: boolean;
expanded?: boolean;
focused?: boolean;
modal?: boolean;
multiline?: boolean;
multiselectable?: boolean;
readonly?: boolean;
required?: boolean;
selected?: boolean;
checked?: boolean|"mixed";
pressed?: boolean|"mixed";
level?: number;
valuemin?: number;
valuemax?: number;
autocomplete?: string;
haspopup?: string;
invalid?: string;
orientation?: string;
children?: AccessibilityNode[];
}

export const devices: Devices;

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

}

interface AccessibilitySnapshotOptions {
/**
* Prune uninteresting nodes from the tree. Defaults to `true`.
*/
interestingOnly?: boolean;

/**
* The root DOM element for the snapshot. Defaults to the whole page.
*/
root?: ElementHandle;
}

export interface LaunchOptions {
/**
* **NOTE** Use custom browser args at your own risk, as some of them may break Playwright functionality.
Expand Down
54 changes: 0 additions & 54 deletions packages/playwright-core/src/client/accessibility.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/playwright-core/src/client/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

export { Accessibility } from './accessibility';
export { Android, AndroidDevice, AndroidInput, AndroidSocket, AndroidWebView } from './android';
export { Browser } from './browser';
export { BrowserContext } from './browserContext';
Expand Down
Loading
Loading