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
4 changes: 3 additions & 1 deletion docs/src/api/class-locator.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@ When specified, limits the depth of the snapshot.
* since: v1.60
- `boxes` <[boolean]>

When `true`, appends each element's bounding box as `[box=x,y,width,height]` to the snapshot. Defaults to `false`.
When `true`, appends each element's bounding box as `[box=x,y,width,height]` to the snapshot. Coordinates are
relative to the viewport, in CSS pixels, as returned by [`Element.getBoundingClientRect()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).
Defaults to `false`.

## async method: Locator.blur
* since: v1.28
Expand Down
4 changes: 3 additions & 1 deletion docs/src/api/class-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -4257,7 +4257,9 @@ When specified, limits the depth of the snapshot.
* since: v1.60
- `boxes` <[boolean]>

When `true`, appends each element's bounding box as `[box=x,y,width,height]` to the snapshot. Defaults to `false`.
When `true`, appends each element's bounding box as `[box=x,y,width,height]` to the snapshot. Coordinates are
relative to the viewport, in CSS pixels, as returned by [`Element.getBoundingClientRect()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).
Defaults to `false`.

## async method: Page.tap
* since: v1.8
Expand Down
10 changes: 8 additions & 2 deletions packages/playwright-client/types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2052,7 +2052,10 @@ export interface Page {
*/
ariaSnapshot(options?: {
/**
* When `true`, appends each element's bounding box as `[box=x,y,width,height]` to the snapshot. Defaults to `false`.
* When `true`, appends each element's bounding box as `[box=x,y,width,height]` to the snapshot. Coordinates are
* relative to the viewport, in CSS pixels, as returned by
* [`Element.getBoundingClientRect()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).
* Defaults to `false`.
*/
boxes?: boolean;

Expand Down Expand Up @@ -13050,7 +13053,10 @@ export interface Locator {
*/
ariaSnapshot(options?: {
/**
* When `true`, appends each element's bounding box as `[box=x,y,width,height]` to the snapshot. Defaults to `false`.
* When `true`, appends each element's bounding box as `[box=x,y,width,height]` to the snapshot. Coordinates are
* relative to the viewport, in CSS pixels, as returned by
* [`Element.getBoundingClientRect()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).
* Defaults to `false`.
*/
boxes?: boolean;

Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/src/tools/backend/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const snapshot = defineTabTool({
target: z.string().optional().describe(elementTargetDescription),
filename: z.string().optional().describe('Save snapshot to markdown file instead of returning it in the response.'),
depth: z.number().optional().describe('Limit the depth of the snapshot tree'),
boxes: z.boolean().optional().describe('Include each element\'s bounding box as [box=x,y,width,height] in the snapshot'),
boxes: z.boolean().optional().describe('Include each element\'s bounding box as [box=x,y,width,height] in the snapshot. Coordinates are viewport-relative, in CSS pixels (Element.getBoundingClientRect)'),
}),
type: 'readOnly',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/src/tools/cli-daemon/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ const snapshot = declareCommand({
options: z.object({
filename: z.string().optional().describe('Save snapshot to markdown file instead of returning it in the response.'),
depth: numberArg.optional().describe('Limit snapshot depth, unlimited by default.'),
boxes: z.boolean().optional().describe('Include each element\'s bounding box as [box=x,y,width,height] in the snapshot.'),
boxes: z.boolean().optional().describe('Include each element\'s bounding box as [box=x,y,width,height] in the snapshot. Coordinates are viewport-relative, in CSS pixels (Element.getBoundingClientRect).'),
}),
toolName: 'browser_snapshot',
toolParams: ({ filename, target, depth, boxes }) => ({ filename, target, depth, boxes }),
Expand Down
10 changes: 8 additions & 2 deletions packages/playwright-core/types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2052,7 +2052,10 @@ export interface Page {
*/
ariaSnapshot(options?: {
/**
* When `true`, appends each element's bounding box as `[box=x,y,width,height]` to the snapshot. Defaults to `false`.
* When `true`, appends each element's bounding box as `[box=x,y,width,height]` to the snapshot. Coordinates are
* relative to the viewport, in CSS pixels, as returned by
* [`Element.getBoundingClientRect()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).
* Defaults to `false`.
*/
boxes?: boolean;

Expand Down Expand Up @@ -13050,7 +13053,10 @@ export interface Locator {
*/
ariaSnapshot(options?: {
/**
* When `true`, appends each element's bounding box as `[box=x,y,width,height]` to the snapshot. Defaults to `false`.
* When `true`, appends each element's bounding box as `[box=x,y,width,height]` to the snapshot. Coordinates are
* relative to the viewport, in CSS pixels, as returned by
* [`Element.getBoundingClientRect()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).
* Defaults to `false`.
*/
boxes?: boolean;

Expand Down
Loading