Readonly Internal_The underlying Playwright Locator instance.
ReadonlyallReturns an array of locators pointing to the matched elements.
ReadonlyallGets all inner texts.
ReadonlyallGets all text contents.
ReadonlyandCreates a locator that matches both this locator and the argument locator.
ReadonlyariaReturns the accessibility tree snapshot.
ReadonlyblurRemoves keyboard focus from the current element.
ReadonlyboundingReturns the bounding box of the element.
ReadonlycheckChecks the element.
ReadonlyclearClear the input field.
ReadonlyclickClicks the element.
ReadonlycontentReturns a FrameLocator object pointing to the same iframe as this locator.
ReadonlycountCounts the number of matched elements.
ReadonlydblclickDouble-clicks the element.
ReadonlydescribeDescribes the locator.
ReadonlydescriptionReturns the description of the locator.
ReadonlydispatchDispatches an event.
ReadonlydragDrags the locator to another target locator.
ReadonlyelementResolves given locator to the first matching DOM element.
ReadonlyelementResolves given locator to all matching DOM elements.
ReadonlyevaluateEvaluates a function on the matched element.
import { PlaywrightBrowser } from "effect-playwright";
import { PlaywrightEnvironment } from "effect-playwright/experimental";
import { chromium } from "@playwright/test";
import { Effect } from "effect";
const program = Effect.gen(function* () {
const browser = yield* PlaywrightBrowser;
const page = yield* browser.newPage();
const locator = yield* page.locator("button");
const buttonContent = yield* locator.evaluate((button) => button.textContent());
}).pipe(PlaywrightEnvironment.provideBrowser, Effect.provide(PlaywrightEnvironment.layer(chromium)));
ReadonlyevaluateEvaluates a function on all matched elements.
ReadonlyevaluateEvaluates a function on the matched element and returns the result as a handle.
ReadonlyfillFills the input field.
ReadonlyfilterNarrows existing locator according to the options.
ReadonlyfirstReturns a locator that points to the first matched element.
ReadonlyfocusFocuses the element.
ReadonlyframeCreates a frame locator that will enter the iframe and allow selecting elements in that iframe.
ReadonlygetGets an attribute value.
ReadonlygetAllows locating elements by their alt text.
ReadonlygetAllows locating elements by their label text.
ReadonlygetAllows locating elements by their placeholder text.
ReadonlygetAllows locating elements by their ARIA role, ARIA attributes and accessible name.
ReadonlygetAllows locating elements by their test id.
ReadonlygetAllows locating elements that contain given text.
ReadonlygetAllows locating elements by their title attribute.
ReadonlyhighlightHighlights the corresponding element(s) on the screen.
ReadonlyhoverHovers over the element.
ReadonlyinnerGets the inner HTML.
ReadonlyinnerGets the inner text.
ReadonlyinputGets the input value.
ReadonlyisReturns whether the element is checked.
ReadonlyisReturns whether the element is disabled.
ReadonlyisReturns whether the element is editable.
ReadonlyisReturns whether the element is enabled.
ReadonlyisReturns whether the element is hidden.
ReadonlyisReturns whether the element is visible.
ReadonlylastReturns a locator that points to the last matched element.
ReadonlylocatorReturns a locator that points to a matched element.
ReadonlynthReturns a locator that points to the nth matched element.
ReadonlyorCreates a locator that matches either this locator or the argument locator.
ReadonlypageA page this locator belongs to.
ReadonlypressFocuses the element, and then uses keyboard.down and keyboard.up.
ReadonlypressFocuses the element, and then sends a keydown, keypress/input, and keyup event for each character in the text.
ReadonlyscreenshotCaptures a screenshot of the element.
ReadonlyscrollScrolls the element into view if needed.
ReadonlyselectSelects an option in a <select> element.
ReadonlyselectSelects text.
ReadonlysetChecks the element if not already checked.
ReadonlysetSets the value of the file input.
ReadonlytapTaps the element.
ReadonlytextGets the text content.
ReadonlytoReturns the string representation of the locator.
ReadonlyuncheckUnchecks the element.
ReadonlyuseA generic utility to execute any promise-based method on the underlying Playwright Locator.
Can be used to access any Locator functionality not directly exposed by this service.
A function that takes the Playwright Locator and returns a Promise.
An effect that wraps the promise and returns its result.
ReadonlywaitReturns when element specified by locator satisfies the state option.
Interface for a Playwright locator.