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
15 changes: 0 additions & 15 deletions docs/src/api/class-locator.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,21 +150,6 @@ var button = page.GetByRole(AriaRole.Button).And(page.GetByTitle("Subscribe"));

Additional locator to match.

## async method: Locator.ariaRef
* since: v1.60
* langs: js
- returns: <[null]|[string]>

Returns the aria ref (for example `e1`, `e2`) assigned to this element by the most recent aria snapshot, or `null`
if no ref has been assigned yet. Call [`method: Locator.ariaSnapshot`] or [`method: Page.ariaSnapshot`] before this
method to ensure a ref is available.

### option: Locator.ariaRef.timeout = %%-input-timeout-%%
* since: v1.60

### option: Locator.ariaRef.timeout = %%-input-timeout-js-%%
* since: v1.60

## async method: Locator.ariaSnapshot
* since: v1.49
- returns: <[string]>
Expand Down
1 change: 0 additions & 1 deletion packages/isomorphic/protocolMetainfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ export const methodMetainfo = new Map<string, MethodMetainfo>([
['Frame.evalOnSelectorAll', { title: 'Evaluate', snapshot: true, pause: true, }],
['Frame.addScriptTag', { title: 'Add script tag', snapshot: true, pause: true, }],
['Frame.addStyleTag', { title: 'Add style tag', snapshot: true, pause: true, }],
['Frame.ariaRef', { internal: true, }],
['Frame.ariaSnapshot', { title: 'Aria snapshot', group: 'getter', }],
['Frame.blur', { title: 'Blur', slowMo: true, snapshot: true, pause: true, }],
['Frame.check', { title: 'Check', slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true, }],
Expand Down
18 changes: 0 additions & 18 deletions packages/playwright-client/types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12984,24 +12984,6 @@ export interface Locator {
*/
and(locator: Locator): Locator;

/**
* Returns the aria ref (for example `e1`, `e2`) assigned to this element by the most recent aria snapshot, or `null`
* if no ref has been assigned yet. Call
* [locator.ariaSnapshot([options])](https://playwright.dev/docs/api/class-locator#locator-aria-snapshot) or
* [page.ariaSnapshot([options])](https://playwright.dev/docs/api/class-page#page-aria-snapshot) before this method to
* ensure a ref is available.
* @param options
*/
ariaRef(options?: {
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
}): Promise<null|string>;

/**
* Captures the aria snapshot of the given element. Read more about [aria snapshots](https://playwright.dev/docs/aria-snapshots) and
* [expect(locator).toMatchAriaSnapshot(expected[, options])](https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-match-aria-snapshot)
Expand Down
5 changes: 0 additions & 5 deletions packages/playwright-core/src/client/locator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,6 @@ export class Locator implements api.Locator {
return await this._withElement((h, timeout) => h.screenshot({ ...options, mask, timeout }), { title: 'Screenshot', timeout: options.timeout });
}

async ariaRef(options: TimeoutOptions = {}): Promise<string | null> {
const { ref } = await this._frame._channel.ariaRef({ selector: this._selector, timeout: this._frame._timeout(options) });
return ref ?? null;
}

async ariaSnapshot(options: TimeoutOptions & { mode?: 'ai' | 'default', depth?: number, boxes?: boolean } = {}): Promise<string> {
const result = await this._frame._channel.ariaSnapshot({ timeout: this._frame._timeout(options), mode: options.mode, selector: this._selector, depth: options.depth, boxes: options.boxes });
return result.snapshot;
Expand Down
7 changes: 0 additions & 7 deletions packages/playwright-core/src/protocol/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1655,13 +1655,6 @@ scheme.FrameAddStyleTagParams = tObject({
scheme.FrameAddStyleTagResult = tObject({
element: tChannel(['ElementHandle']),
});
scheme.FrameAriaRefParams = tObject({
selector: tString,
timeout: tFloat,
});
scheme.FrameAriaRefResult = tObject({
ref: tOptional(tString),
});
scheme.FrameAriaSnapshotParams = tObject({
mode: tOptional(tEnum(['ai', 'default'])),
track: tOptional(tString),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,6 @@ export class FrameDispatcher extends Dispatcher<Frame, channels.FrameChannel, Br
return { element: ElementHandleDispatcher.from(this, await this._frame.addStyleTag(progress, params)) };
}

async ariaRef(params: channels.FrameAriaRefParams, progress: Progress): Promise<channels.FrameAriaRefResult> {
return await this._frame.ariaRef(progress, params.selector);
}

async ariaSnapshot(params: channels.FrameAriaSnapshotParams, progress: Progress): Promise<channels.FrameAriaSnapshotResult> {
return await this._frame.ariaSnapshot(progress, params);
}
Expand Down
9 changes: 0 additions & 9 deletions packages/playwright-core/src/server/frames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1762,15 +1762,6 @@ export class Frame extends SdkObject<FrameEventMap> {
}, { source, arg });
}

async ariaRef(progress: Progress, selector: string): Promise<{ ref?: string }> {
const ref = await this._retryWithProgressIfNotConnected(progress, selector, { strict: true, performActionPreChecks: true }, async (progress, handle) => {
return await progress.race(handle.evaluateInUtility(([injected, element]) => {
return (element as any)._ariaRef?.ref as string | undefined;
}, {}));
});
return { ref };
}

async ariaSnapshot(progress: Progress, options: { mode?: 'ai' | 'default', track?: string, doNotRenderActive?: boolean, selector?: string, depth?: number, boxes?: boolean } = {}): Promise<{ snapshot: string }> {
if (options.selector && options.track)
throw new Error('Cannot specify both selector and track options');
Expand Down
18 changes: 0 additions & 18 deletions packages/playwright-core/types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12984,24 +12984,6 @@ export interface Locator {
*/
and(locator: Locator): Locator;

/**
* Returns the aria ref (for example `e1`, `e2`) assigned to this element by the most recent aria snapshot, or `null`
* if no ref has been assigned yet. Call
* [locator.ariaSnapshot([options])](https://playwright.dev/docs/api/class-locator#locator-aria-snapshot) or
* [page.ariaSnapshot([options])](https://playwright.dev/docs/api/class-page#page-aria-snapshot) before this method to
* ensure a ref is available.
* @param options
*/
ariaRef(options?: {
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
}): Promise<null|string>;

/**
* Captures the aria snapshot of the given element. Read more about [aria snapshots](https://playwright.dev/docs/aria-snapshots) and
* [expect(locator).toMatchAriaSnapshot(expected[, options])](https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-match-aria-snapshot)
Expand Down
11 changes: 0 additions & 11 deletions packages/protocol/src/channels.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2810,7 +2810,6 @@ export interface FrameChannel extends FrameEventTarget, Channel {
evalOnSelectorAll(params: FrameEvalOnSelectorAllParams, progress?: Progress): Promise<FrameEvalOnSelectorAllResult>;
addScriptTag(params: FrameAddScriptTagParams, progress?: Progress): Promise<FrameAddScriptTagResult>;
addStyleTag(params: FrameAddStyleTagParams, progress?: Progress): Promise<FrameAddStyleTagResult>;
ariaRef(params: FrameAriaRefParams, progress?: Progress): Promise<FrameAriaRefResult>;
ariaSnapshot(params: FrameAriaSnapshotParams, progress?: Progress): Promise<FrameAriaSnapshotResult>;
blur(params: FrameBlurParams, progress?: Progress): Promise<FrameBlurResult>;
check(params: FrameCheckParams, progress?: Progress): Promise<FrameCheckResult>;
Expand Down Expand Up @@ -2919,16 +2918,6 @@ export type FrameAddStyleTagOptions = {
export type FrameAddStyleTagResult = {
element: ElementHandleChannel,
};
export type FrameAriaRefParams = {
selector: string,
timeout: number,
};
export type FrameAriaRefOptions = {

};
export type FrameAriaRefResult = {
ref?: string,
};
export type FrameAriaSnapshotParams = {
mode?: 'ai' | 'default',
track?: string,
Expand Down
8 changes: 0 additions & 8 deletions packages/protocol/src/protocol.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2311,14 +2311,6 @@ Frame:
snapshot: true
pause: true

ariaRef:
internal: true
parameters:
selector: string
timeout: float
returns:
ref: string?

ariaSnapshot:
title: Aria snapshot
group: getter
Expand Down
Loading