Interface LibraLocatorOptions

locator options

interface LibraLocatorOptions {
    hasNot?: Locator<string>;
    hasNotText?: string | RegExp;
    hasText?: string | RegExp;
}

Properties

hasNot?: Locator<string>

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 <article><span>Playwright</span></article>.

Note that outer and inner locators must belong to the same frame. Inner locator must not contain FrameLocators.

hasNotText?: string | RegExp

Matches elements that do not contain specified text somewhere inside, possibly in a child or a descendant element. When passed a [string], matching is case-insensitive and searches for a substring.

hasText?: string | RegExp

Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When passed a [string], matching is case-insensitive and searches for a substring. For example, "Playwright" matches <article><div>Playwright</div></article>.