diff --git a/docs/src/api/class-frame.md b/docs/src/api/class-frame.md index 994e92628f..8b9dc92d32 100644 --- a/docs/src/api/class-frame.md +++ b/docs/src/api/class-frame.md @@ -1345,6 +1345,9 @@ Returns whether the element is [visible](../actionability.md#visible). [`option: ### option: Frame.locator.-inline- = %%-locator-options-list-v1.14-%% * since: v1.14 +### option: Frame.locator.hasNot = %%-locator-option-has-not-%% +* since: v1.33 + ## method: Frame.name * since: v1.8 - returns: <[string]> diff --git a/docs/src/api/class-framelocator.md b/docs/src/api/class-framelocator.md index 48829a775d..fb5afd6891 100644 --- a/docs/src/api/class-framelocator.md +++ b/docs/src/api/class-framelocator.md @@ -202,6 +202,9 @@ Returns locator to the last matching frame. ### option: FrameLocator.locator.-inline- = %%-locator-options-list-v1.14-%% * since: v1.17 +### option: FrameLocator.locator.hasNot = %%-locator-option-has-not-%% +* since: v1.33 + ## method: FrameLocator.nth * since: v1.17 - returns: <[FrameLocator]> diff --git a/docs/src/api/class-locator.md b/docs/src/api/class-locator.md index 44cc6af3f6..03c72a2fd9 100644 --- a/docs/src/api/class-locator.md +++ b/docs/src/api/class-locator.md @@ -988,6 +988,8 @@ await rowLocator ### option: Locator.filter.-inline- = %%-locator-options-list-v1.14-%% * since: v1.22 +### option: Locator.filter.hasNot = %%-locator-option-has-not-%% +* since: v1.33 ## method: Locator.first * since: v1.14 @@ -1503,6 +1505,9 @@ var banana = await page.GetByRole(AriaRole.Listitem).Last(1); ### option: Locator.locator.-inline- = %%-locator-options-list-v1.14-%% * since: v1.14 +### option: Locator.locator.hasNot = %%-locator-option-has-not-%% +* since: v1.33 + ## method: Locator.not * since: v1.33 diff --git a/docs/src/api/class-page.md b/docs/src/api/class-page.md index 2068614f75..ad19ccc1ae 100644 --- a/docs/src/api/class-page.md +++ b/docs/src/api/class-page.md @@ -2684,6 +2684,9 @@ Returns whether the element is [visible](../actionability.md#visible). [`option: ### option: Page.locator.-inline- = %%-locator-options-list-v1.14-%% * since: v1.14 +### option: Page.locator.hasNot = %%-locator-option-has-not-%% +* since: v1.33 + ## method: Page.mainFrame * since: v1.8 - returns: <[Frame]> diff --git a/docs/src/api/params.md b/docs/src/api/params.md index 2534012219..e4c11d13d2 100644 --- a/docs/src/api/params.md +++ b/docs/src/api/params.md @@ -1029,6 +1029,14 @@ For example, `article` that has `text=Playwright` matches `
Playwri Note that outer and inner locators must belong to the same frame. Inner locator must not contain [FrameLocator]s. +## locator-option-has-not +- `hasNot` <[Locator]> + +Matches elements that do not contain an element that matches an inner locator. Inner locator is queried against the outer one. +For example, `article` that does not have `div` matches `
Playwright
`. + +Note that outer and inner locators must belong to the same frame. Inner locator must not contain [FrameLocator]s. + ## locator-options-list-v1.14 - %%-locator-option-has-text-%% - %%-locator-option-has-%% diff --git a/docs/src/locators.md b/docs/src/locators.md index 4327a7fc00..c349a48341 100644 --- a/docs/src/locators.md +++ b/docs/src/locators.md @@ -885,7 +885,7 @@ await page ### Filter by child/descendant -Locators support an option to only select elements that have a descendant matching another locator. You can therefore filter by any other locator such as a [`method: Locator.getByRole`], [`method: Locator.getByTestId`], [`method: Locator.getByText`] etc. +Locators support an option to only select elements that have or have not a descendant matching another locator. You can therefore filter by any other locator such as a [`method: Locator.getByRole`], [`method: Locator.getByTestId`], [`method: Locator.getByText`] etc. ```html card