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
16 changes: 0 additions & 16 deletions docs/src/api/class-frame.md
Original file line number Diff line number Diff line change
Expand Up @@ -1076,8 +1076,6 @@ Attribute name to get the value for.

### option: Frame.getByAltText.exact = %%-locator-get-by-text-exact-%%

### option: Frame.getByAltText.omitHidden = %%-locator-option-omit-hidden-%%

## method: Frame.getByLabel
* since: v1.27
- returns: <[Locator]>
Expand All @@ -1088,8 +1086,6 @@ Attribute name to get the value for.

### option: Frame.getByLabel.exact = %%-locator-get-by-text-exact-%%

### option: Frame.getByLabel.omitHidden = %%-locator-option-omit-hidden-%%

## method: Frame.getByPlaceholder
* since: v1.27
- returns: <[Locator]>
Expand All @@ -1100,8 +1096,6 @@ Attribute name to get the value for.

### option: Frame.getByPlaceholder.exact = %%-locator-get-by-text-exact-%%

### option: Frame.getByPlaceholder.omitHidden = %%-locator-option-omit-hidden-%%

## method: Frame.getByRole
* since: v1.27
- returns: <[Locator]>
Expand All @@ -1118,8 +1112,6 @@ Attribute name to get the value for.

### option: Frame.getByRole.description = %%-locator-get-by-role-option-description-%%

### option: Frame.getByRole.omitHidden = %%-locator-option-omit-hidden-%%

## method: Frame.getByTestId
* since: v1.27
- returns: <[Locator]>
Expand All @@ -1129,8 +1121,6 @@ Attribute name to get the value for.
### param: Frame.getByTestId.testId = %%-locator-get-by-test-id-test-id-%%
* since: v1.27

### option: Frame.getByTestId.omitHidden = %%-locator-option-omit-hidden-%%

## method: Frame.getByText
* since: v1.27
- returns: <[Locator]>
Expand All @@ -1141,8 +1131,6 @@ Attribute name to get the value for.

### option: Frame.getByText.exact = %%-locator-get-by-text-exact-%%

### option: Frame.getByText.omitHidden = %%-locator-option-omit-hidden-%%

## method: Frame.getByTitle
* since: v1.27
- returns: <[Locator]>
Expand All @@ -1153,8 +1141,6 @@ Attribute name to get the value for.

### option: Frame.getByTitle.exact = %%-locator-get-by-text-exact-%%

### option: Frame.getByTitle.omitHidden = %%-locator-option-omit-hidden-%%

## async method: Frame.goto
* since: v1.8
* langs:
Expand Down Expand Up @@ -1462,8 +1448,6 @@ Returns whether the element is [visible](../actionability.md#visible). [`param:
### option: Frame.locator.-inline- = %%-locator-options-list-v1.14-%%
* since: v1.14

### option: Frame.locator.omitHidden = %%-locator-option-omit-hidden-%%

### option: Frame.locator.hasNot = %%-locator-option-has-not-%%
* since: v1.33

Expand Down
16 changes: 0 additions & 16 deletions docs/src/api/class-framelocator.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ in that iframe.

### option: FrameLocator.getByAltText.exact = %%-locator-get-by-text-exact-%%

### option: FrameLocator.getByAltText.omitHidden = %%-locator-option-omit-hidden-%%

## method: FrameLocator.getByLabel
* since: v1.27
- returns: <[Locator]>
Expand All @@ -172,8 +170,6 @@ in that iframe.

### option: FrameLocator.getByLabel.exact = %%-locator-get-by-text-exact-%%

### option: FrameLocator.getByLabel.omitHidden = %%-locator-option-omit-hidden-%%

## method: FrameLocator.getByPlaceholder
* since: v1.27
- returns: <[Locator]>
Expand All @@ -184,8 +180,6 @@ in that iframe.

### option: FrameLocator.getByPlaceholder.exact = %%-locator-get-by-text-exact-%%

### option: FrameLocator.getByPlaceholder.omitHidden = %%-locator-option-omit-hidden-%%

## method: FrameLocator.getByRole
* since: v1.27
- returns: <[Locator]>
Expand All @@ -202,8 +196,6 @@ in that iframe.

### option: FrameLocator.getByRole.description = %%-locator-get-by-role-option-description-%%

### option: FrameLocator.getByRole.omitHidden = %%-locator-option-omit-hidden-%%

## method: FrameLocator.getByTestId
* since: v1.27
- returns: <[Locator]>
Expand All @@ -213,8 +205,6 @@ in that iframe.
### param: FrameLocator.getByTestId.testId = %%-locator-get-by-test-id-test-id-%%
* since: v1.27

### option: FrameLocator.getByTestId.omitHidden = %%-locator-option-omit-hidden-%%

## method: FrameLocator.getByText
* since: v1.27
- returns: <[Locator]>
Expand All @@ -225,8 +215,6 @@ in that iframe.

### option: FrameLocator.getByText.exact = %%-locator-get-by-text-exact-%%

### option: FrameLocator.getByText.omitHidden = %%-locator-option-omit-hidden-%%

## method: FrameLocator.getByTitle
* since: v1.27
- returns: <[Locator]>
Expand All @@ -237,8 +225,6 @@ in that iframe.

### option: FrameLocator.getByTitle.exact = %%-locator-get-by-text-exact-%%

### option: FrameLocator.getByTitle.omitHidden = %%-locator-option-omit-hidden-%%

## method: FrameLocator.last
* deprecated: Use [`method: Locator.last`] followed by [`method: Locator.contentFrame`] instead.
* since: v1.17
Expand All @@ -258,8 +244,6 @@ Returns locator to the last matching frame.
### option: FrameLocator.locator.-inline- = %%-locator-options-list-v1.14-%%
* since: v1.17

### option: FrameLocator.locator.omitHidden = %%-locator-option-omit-hidden-%%

### option: FrameLocator.locator.hasNot = %%-locator-option-has-not-%%
* since: v1.33

Expand Down
18 changes: 0 additions & 18 deletions docs/src/api/class-locator.md
Original file line number Diff line number Diff line change
Expand Up @@ -1424,8 +1424,6 @@ await rowLocator
### option: Locator.filter.visible = %%-locator-option-visible-%%
* since: v1.51

### option: Locator.filter.omitHidden = %%-locator-option-omit-hidden-%%

## method: Locator.first
* since: v1.14
- returns: <[Locator]>
Expand Down Expand Up @@ -1516,8 +1514,6 @@ Attribute name to get the value for.

### option: Locator.getByAltText.exact = %%-locator-get-by-text-exact-%%

### option: Locator.getByAltText.omitHidden = %%-locator-option-omit-hidden-%%

## method: Locator.getByLabel
* since: v1.27
- returns: <[Locator]>
Expand All @@ -1528,8 +1524,6 @@ Attribute name to get the value for.

### option: Locator.getByLabel.exact = %%-locator-get-by-text-exact-%%

### option: Locator.getByLabel.omitHidden = %%-locator-option-omit-hidden-%%

## method: Locator.getByPlaceholder
* since: v1.27
- returns: <[Locator]>
Expand All @@ -1540,8 +1534,6 @@ Attribute name to get the value for.

### option: Locator.getByPlaceholder.exact = %%-locator-get-by-text-exact-%%

### option: Locator.getByPlaceholder.omitHidden = %%-locator-option-omit-hidden-%%

## method: Locator.getByRole
* since: v1.27
- returns: <[Locator]>
Expand All @@ -1558,8 +1550,6 @@ Attribute name to get the value for.

### option: Locator.getByRole.description = %%-locator-get-by-role-option-description-%%

### option: Locator.getByRole.omitHidden = %%-locator-option-omit-hidden-%%

## method: Locator.getByTestId
* since: v1.27
- returns: <[Locator]>
Expand All @@ -1569,8 +1559,6 @@ Attribute name to get the value for.
### param: Locator.getByTestId.testId = %%-locator-get-by-test-id-test-id-%%
* since: v1.27

### option: Locator.getByTestId.omitHidden = %%-locator-option-omit-hidden-%%

## method: Locator.getByText
* since: v1.27
- returns: <[Locator]>
Expand All @@ -1581,8 +1569,6 @@ Attribute name to get the value for.

### option: Locator.getByText.exact = %%-locator-get-by-text-exact-%%

### option: Locator.getByText.omitHidden = %%-locator-option-omit-hidden-%%

## method: Locator.getByTitle
* since: v1.27
- returns: <[Locator]>
Expand All @@ -1593,8 +1579,6 @@ Attribute name to get the value for.

### option: Locator.getByTitle.exact = %%-locator-get-by-text-exact-%%

### option: Locator.getByTitle.omitHidden = %%-locator-option-omit-hidden-%%

## async method: Locator.hideHighlight
* since: v1.60

Expand Down Expand Up @@ -2040,8 +2024,6 @@ var banana = page.GetByRole(AriaRole.Listitem).Last;
### option: Locator.locator.-inline- = %%-locator-options-list-v1.14-%%
* since: v1.14

### option: Locator.locator.omitHidden = %%-locator-option-omit-hidden-%%

### option: Locator.locator.hasNot = %%-locator-option-has-not-%%
* since: v1.33

Expand Down
18 changes: 0 additions & 18 deletions docs/src/api/class-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -2324,8 +2324,6 @@ Attribute name to get the value for.

### option: Page.getByAltText.exact = %%-locator-get-by-text-exact-%%

### option: Page.getByAltText.omitHidden = %%-locator-option-omit-hidden-%%

## method: Page.getByLabel
* since: v1.27
- returns: <[Locator]>
Expand All @@ -2336,8 +2334,6 @@ Attribute name to get the value for.

### option: Page.getByLabel.exact = %%-locator-get-by-text-exact-%%

### option: Page.getByLabel.omitHidden = %%-locator-option-omit-hidden-%%

## method: Page.getByPlaceholder
* since: v1.27
- returns: <[Locator]>
Expand All @@ -2348,8 +2344,6 @@ Attribute name to get the value for.

### option: Page.getByPlaceholder.exact = %%-locator-get-by-text-exact-%%

### option: Page.getByPlaceholder.omitHidden = %%-locator-option-omit-hidden-%%

## method: Page.getByRef
* since: v1.64
- returns: <[Locator]>
Expand Down Expand Up @@ -2393,8 +2387,6 @@ await page.GetByRef("e2").ClickAsync();

Aria ref of the element, for example `e2` or `f1e3`.

### option: Page.getByRef.omitHidden = %%-locator-option-omit-hidden-%%

## method: Page.getByRole
* since: v1.27
- returns: <[Locator]>
Expand All @@ -2411,8 +2403,6 @@ Aria ref of the element, for example `e2` or `f1e3`.

### option: Page.getByRole.description = %%-locator-get-by-role-option-description-%%

### option: Page.getByRole.omitHidden = %%-locator-option-omit-hidden-%%

## method: Page.getByTestId
* since: v1.27
- returns: <[Locator]>
Expand All @@ -2422,8 +2412,6 @@ Aria ref of the element, for example `e2` or `f1e3`.
### param: Page.getByTestId.testId = %%-locator-get-by-test-id-test-id-%%
* since: v1.27

### option: Page.getByTestId.omitHidden = %%-locator-option-omit-hidden-%%

## method: Page.getByText
* since: v1.27
- returns: <[Locator]>
Expand All @@ -2434,8 +2422,6 @@ Aria ref of the element, for example `e2` or `f1e3`.

### option: Page.getByText.exact = %%-locator-get-by-text-exact-%%

### option: Page.getByText.omitHidden = %%-locator-option-omit-hidden-%%

## method: Page.getByTitle
* since: v1.27
- returns: <[Locator]>
Expand All @@ -2446,8 +2432,6 @@ Aria ref of the element, for example `e2` or `f1e3`.

### option: Page.getByTitle.exact = %%-locator-get-by-text-exact-%%

### option: Page.getByTitle.omitHidden = %%-locator-option-omit-hidden-%%

## async method: Page.goBack
* since: v1.8
- returns: <[null]|[Response]>
Expand Down Expand Up @@ -2938,8 +2922,6 @@ Controls which errors are returned:
### option: Page.locator.-inline- = %%-locator-options-list-v1.14-%%
* since: v1.14

### option: Page.locator.omitHidden = %%-locator-option-omit-hidden-%%

### option: Page.locator.hasNot = %%-locator-option-has-not-%%
* since: v1.33

Expand Down
32 changes: 0 additions & 32 deletions docs/src/api/params.md
Original file line number Diff line number Diff line change
Expand Up @@ -935,27 +935,6 @@ on selectors that imply single target DOM element will throw when more than one
This option does not affect any Locator APIs (Locators are always strict). Defaults to `false`.
See [Locator] to learn more about the strict mode.

## context-option-locator-omit-hidden
* since: v1.65
* langs: js
- `locatorOmitHidden` <[boolean]>

Whether locators omit hidden elements by default. Defaults to `false`. If set to `true`, each
locator is resolved as if [`method: Locator.visible`] were appended: only the final matched element
is checked for [visibility](../actionability.md#visible), not its intermediate ancestors.
This affects actions, assertions, counts and element evaluation, but not selector-based methods
such as [`method: Page.querySelector`].

Pass `omitHidden: false` when creating a locator to opt out. The override is preserved by
`filter()`, `first()`, `last()`, `nth()`, `and()`, `or()` and `describe()`. Creating a descendant
locator uses the context default again, unless an override is supplied for that descendant.
Explicit visibility filters are never removed. Role locators still apply their accessibility
matching rules; use `getByRole(..., { includeHidden: true, omitHidden: false })` to include hidden
elements when this context option is enabled.

With `true`, hidden elements are treated as missing by `toBeHidden()` and `waitFor({ state: 'hidden' })`.
To check attachment of a hidden element, create the locator with `omitHidden: false`.

## context-option-service-worker-policy
- `serviceWorkers` "ServiceWorkerPolicy" <"allow"|"block">

Expand Down Expand Up @@ -1188,7 +1167,6 @@ between the same pixel in compared images, between zero (strict) and one (lax),
- %%-context-option-recordvideo-dir-%%
- %%-context-option-recordvideo-size-%%
- %%-context-option-strict-%%
- %%-context-option-locator-omit-hidden-%%
- %%-context-option-service-worker-policy-%%

## browser-option-args
Expand Down Expand Up @@ -1355,16 +1333,6 @@ Only matches visible or invisible elements. Prefer the [`method: Locator.visible
- %%-locator-option-has-text-%%
- %%-locator-option-has-%%

## locator-option-omit-hidden
* since: v1.65
* langs: js
- `omitHidden` <[boolean]>

Whether to omit hidden elements, overriding the context's `locatorOmitHidden` option, which defaults
to `false`. Setting this to `true` applies [`method: Locator.visible`] when the locator is resolved.
Setting it to `false` disables the automatic visibility filter, but does not remove explicit filters
or change role locators' accessibility matching rules.

## screenshot-option-animations
- `animations` "ScreenshotAnimations" <"disabled"|"allow">

Expand Down
15 changes: 0 additions & 15 deletions docs/src/test-api/class-testoptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -451,21 +451,6 @@ export default defineConfig({
});
```

## property: TestOptions.locatorOmitHidden = %%-context-option-locator-omit-hidden-%%
* since: v1.65

**Usage**

```js title="playwright.config.ts"
import { defineConfig } from '@playwright/test';

export default defineConfig({
use: {
locatorOmitHidden: true,
},
});
```

## property: TestOptions.navigationTimeout
* since: v1.10
- type: <[int]>
Expand Down
1 change: 0 additions & 1 deletion packages/isomorphic/locatorUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export type ByRoleOptions = {
includeHidden?: boolean;
level?: number;
name?: string | RegExp;
omitHidden?: boolean;
pressed?: boolean | 'mixed';
selected?: boolean;
};
Expand Down
Loading
Loading