effect-playwright
    Preparing search index...

    Interface PlaywrightLocatorService

    Interface for a Playwright locator.

    interface PlaywrightLocatorService {
        _raw: Locator;
        all: () => Effect<readonly PlaywrightLocatorService[], PlaywrightError>;
        allInnerTexts: () => Effect<readonly string[], PlaywrightError>;
        allTextContents: () => Effect<readonly string[], PlaywrightError>;
        and: (
            locator: PlaywrightLocatorService | Locator,
        ) => PlaywrightLocatorService;
        ariaSnapshot: (
            options?: { timeout?: number },
        ) => Effect<string, PlaywrightError>;
        blur: (options?: { timeout?: number }) => Effect<void, PlaywrightError>;
        boundingBox: (
            options?: { timeout?: number },
        ) => Effect<
            Option<{ height: number; width: number; x: number; y: number }>,
            PlaywrightError,
        >;
        check: (
            options?: {
                force?: boolean;
                noWaitAfter?: boolean;
                position?: { x: number; y: number };
                timeout?: number;
                trial?: boolean;
            },
        ) => Effect<void, PlaywrightError>;
        clear: (
            options?: { force?: boolean; noWaitAfter?: boolean; timeout?: number },
        ) => Effect<void, PlaywrightError>;
        click: (
            options?: {
                button?: "left" | "right" | "middle";
                clickCount?: number;
                delay?: number;
                force?: boolean;
                modifiers?: ("Alt" | "Control" | "ControlOrMeta" | "Meta" | "Shift")[];
                noWaitAfter?: boolean;
                position?: { x: number; y: number };
                steps?: number;
                timeout?: number;
                trial?: boolean;
            },
        ) => Effect<void, PlaywrightError>;
        contentFrame: () => PlaywrightFrameLocatorService;
        count: Effect<number, PlaywrightError>;
        dblclick: (
            options?: {
                button?: "left" | "right" | "middle";
                delay?: number;
                force?: boolean;
                modifiers?: ("Alt" | "Control" | "ControlOrMeta" | "Meta" | "Shift")[];
                noWaitAfter?: boolean;
                position?: { x: number; y: number };
                steps?: number;
                timeout?: number;
                trial?: boolean;
            },
        ) => Effect<void, PlaywrightError>;
        describe: (description: string) => PlaywrightLocatorService;
        description: () => Option<string>;
        dispatchEvent: (
            type: string,
            eventInit?: EvaluationArgument,
            options?: { timeout?: number },
        ) => Effect<void, PlaywrightError>;
        dragTo: (
            target: PlaywrightLocatorService | Locator,
            options?: {
                force?: boolean;
                noWaitAfter?: boolean;
                sourcePosition?: { x: number; y: number };
                steps?: number;
                targetPosition?: { x: number; y: number };
                timeout?: number;
                trial?: boolean;
            },
        ) => Effect<void, PlaywrightError>;
        elementHandle: (
            options?: { timeout?: number },
        ) => Effect<
            Option<ElementHandle<SVGElement | HTMLElement>>,
            PlaywrightError,
        >;
        elementHandles: () => Effect<
            readonly ElementHandle<SVGElement | HTMLElement>[],
            PlaywrightError,
        >;
        evaluate: <
            R,
            Arg = void,
            E extends SVGElement | HTMLElement = SVGElement | HTMLElement,
        >(
            pageFunction: (element: E, arg: Unboxed<Arg>) => R | Promise<R>,
            arg?: Arg,
            options?: { timeout?: number },
        ) => Effect<R, PlaywrightError>;
        evaluateAll: <
            R,
            Arg = void,
            E extends SVGElement | HTMLElement = SVGElement | HTMLElement,
        >(
            pageFunction: (elements: E[], arg: Unboxed<Arg>) => R | Promise<R>,
            arg?: Arg,
        ) => Effect<R, PlaywrightError>;
        evaluateHandle: <
            R,
            Arg = void,
            E extends SVGElement | HTMLElement = SVGElement | HTMLElement,
        >(
            pageFunction: (element: E, arg: Unboxed<Arg>) => R | Promise<R>,
            arg?: Arg,
        ) => Effect<JSHandle<R>, PlaywrightError>;
        fill: (
            value: string,
            options?: { force?: boolean; noWaitAfter?: boolean; timeout?: number },
        ) => Effect<void, PlaywrightError>;
        filter: (
            options?: {
                has?: Locator;
                hasNot?: Locator;
                hasNotText?: string | RegExp;
                hasText?: string | RegExp;
                visible?: boolean;
            },
        ) => PlaywrightLocatorService;
        first: () => PlaywrightLocatorService;
        focus: (options?: { timeout?: number }) => Effect<void, PlaywrightError>;
        frameLocator: (selector: string) => PlaywrightFrameLocatorService;
        getAttribute: (
            name: string,
            options?: { timeout?: number },
        ) => Effect<string | null, PlaywrightError>;
        getByAltText: (
            text: string | RegExp,
            options?: { exact?: boolean },
        ) => PlaywrightLocatorService;
        getByLabel: (
            text: string | RegExp,
            options?: { exact?: boolean },
        ) => PlaywrightLocatorService;
        getByPlaceholder: (
            text: string | RegExp,
            options?: { exact?: boolean },
        ) => PlaywrightLocatorService;
        getByRole: (
            role:
                | "alert"
                | "alertdialog"
                | "application"
                | "article"
                | "banner"
                | "blockquote"
                | "button"
                | "caption"
                | "cell"
                | "checkbox"
                | "code"
                | "columnheader"
                | "combobox"
                | "complementary"
                | "contentinfo"
                | "definition"
                | "deletion"
                | "dialog"
                | "directory"
                | "document"
                | "emphasis"
                | "feed"
                | "figure"
                | "form"
                | "generic"
                | "grid"
                | "gridcell"
                | "group"
                | "heading"
                | "img"
                | "insertion"
                | "link"
                | "list"
                | "listbox"
                | "listitem"
                | "log"
                | "main"
                | "marquee"
                | "math"
                | "meter"
                | "menu"
                | "menubar"
                | "menuitem"
                | "menuitemcheckbox"
                | "menuitemradio"
                | "navigation"
                | "none"
                | "note"
                | "option"
                | "paragraph"
                | "presentation"
                | "progressbar"
                | "radio"
                | "radiogroup"
                | "region"
                | "row"
                | "rowgroup"
                | "rowheader"
                | "scrollbar"
                | "search"
                | "searchbox"
                | "separator"
                | "slider"
                | "spinbutton"
                | "status"
                | "strong"
                | "subscript"
                | "superscript"
                | "switch"
                | "tab"
                | "table"
                | "tablist"
                | "tabpanel"
                | "term"
                | "textbox"
                | "time"
                | "timer"
                | "toolbar"
                | "tooltip"
                | "tree"
                | "treegrid"
                | "treeitem",
            options?: {
                checked?: boolean;
                disabled?: boolean;
                exact?: boolean;
                expanded?: boolean;
                includeHidden?: boolean;
                level?: number;
                name?: string | RegExp;
                pressed?: boolean;
                selected?: boolean;
            },
        ) => PlaywrightLocatorService;
        getByTestId: (testId: string | RegExp) => PlaywrightLocatorService;
        getByText: (
            text: string | RegExp,
            options?: { exact?: boolean },
        ) => PlaywrightLocatorService;
        getByTitle: (
            text: string | RegExp,
            options?: { exact?: boolean },
        ) => PlaywrightLocatorService;
        highlight: () => Effect<void, PlaywrightError>;
        hover: (
            options?: {
                force?: boolean;
                modifiers?: ("Alt" | "Control" | "ControlOrMeta" | "Meta" | "Shift")[];
                noWaitAfter?: boolean;
                position?: { x: number; y: number };
                timeout?: number;
                trial?: boolean;
            },
        ) => Effect<void, PlaywrightError>;
        innerHTML: (
            options?: { timeout?: number },
        ) => Effect<string, PlaywrightError>;
        innerText: (
            options?: { timeout?: number },
        ) => Effect<string, PlaywrightError>;
        inputValue: (
            options?: { timeout?: number },
        ) => Effect<string, PlaywrightError>;
        isChecked: (
            options?: { timeout?: number },
        ) => Effect<boolean, PlaywrightError>;
        isDisabled: (
            options?: { timeout?: number },
        ) => Effect<boolean, PlaywrightError>;
        isEditable: (
            options?: { timeout?: number },
        ) => Effect<boolean, PlaywrightError>;
        isEnabled: (
            options?: { timeout?: number },
        ) => Effect<boolean, PlaywrightError>;
        isHidden: (
            options?: { timeout?: number },
        ) => Effect<boolean, PlaywrightError>;
        isVisible: (
            options?: { timeout?: number },
        ) => Effect<boolean, PlaywrightError>;
        last: () => PlaywrightLocatorService;
        locator: (
            selectorOrLocator: string | PlaywrightLocatorService | Locator,
            options?: {
                has?: Locator;
                hasNot?: Locator;
                hasNotText?: string | RegExp;
                hasText?: string | RegExp;
            },
        ) => PlaywrightLocatorService;
        nth: (index: number) => PlaywrightLocatorService;
        or: (
            locator: PlaywrightLocatorService | Locator,
        ) => PlaywrightLocatorService;
        page: () => PlaywrightPageService;
        press: (
            key: string,
            options?: { delay?: number; noWaitAfter?: boolean; timeout?: number },
        ) => Effect<void, PlaywrightError>;
        pressSequentially: (
            text: string,
            options?: { delay?: number; noWaitAfter?: boolean; timeout?: number },
        ) => Effect<void, PlaywrightError>;
        screenshot: (
            options?: LocatorScreenshotOptions,
        ) => Effect<Buffer<ArrayBufferLike>, PlaywrightError>;
        scrollIntoViewIfNeeded: (
            options?: { timeout?: number },
        ) => Effect<void, PlaywrightError>;
        selectOption: (
            values:
                | string
                | ElementHandle<Node>
                | readonly string[]
                | { index?: number; label?: string; value?: string }
                | readonly ElementHandle<Node>[]
                | readonly { index?: number; label?: string; value?: string }[]
                | null,
            options?: { force?: boolean; noWaitAfter?: boolean; timeout?: number },
        ) => Effect<readonly string[], PlaywrightError>;
        selectText: (
            options?: { force?: boolean; timeout?: number },
        ) => Effect<void, PlaywrightError>;
        setChecked: (
            checked: boolean,
            options?: {
                force?: boolean;
                noWaitAfter?: boolean;
                position?: { x: number; y: number };
                timeout?: number;
                trial?: boolean;
            },
        ) => Effect<void, PlaywrightError>;
        setInputFiles: (
            files:
                | string
                | readonly string[]
                | { buffer: Buffer; mimeType: string; name: string }
                | readonly { buffer: Buffer; mimeType: string; name: string }[],
            options?: { noWaitAfter?: boolean; timeout?: number },
        ) => Effect<void, PlaywrightError>;
        tap: (
            options?: {
                force?: boolean;
                modifiers?: ("Alt" | "Control" | "ControlOrMeta" | "Meta" | "Shift")[];
                noWaitAfter?: boolean;
                position?: { x: number; y: number };
                timeout?: number;
                trial?: boolean;
            },
        ) => Effect<void, PlaywrightError>;
        textContent: (
            options?: { timeout?: number },
        ) => Effect<string | null, PlaywrightError>;
        toString: () => string;
        uncheck: (
            options?: {
                force?: boolean;
                noWaitAfter?: boolean;
                position?: { x: number; y: number };
                timeout?: number;
                trial?: boolean;
            },
        ) => Effect<void, PlaywrightError>;
        use: <T>(f: (locator: Locator) => Promise<T>) => Effect<T, PlaywrightError>;
        waitFor: (
            options?: {
                state?: "attached" | "detached" | "visible" | "hidden";
                timeout?: number;
            },
        ) => Effect<void, PlaywrightError>;
    }
    Index

    Properties

    _raw: Locator

    The underlying Playwright Locator instance.

    Returns an array of locators pointing to the matched elements.

    Locator.all

    0.4.1

    allInnerTexts: () => Effect<readonly string[], PlaywrightError>

    Gets all inner texts.

    Locator.allInnerTexts

    0.1.0

    allTextContents: () => Effect<readonly string[], PlaywrightError>

    Gets all text contents.

    Locator.allTextContents

    0.1.0

    Creates a locator that matches both this locator and the argument locator.

    Locator.and

    0.4.1

    ariaSnapshot: (
        options?: { timeout?: number },
    ) => Effect<string, PlaywrightError>

    Returns the accessibility tree snapshot.

    Locator.ariaSnapshot

    0.1.0

    blur: (options?: { timeout?: number }) => Effect<void, PlaywrightError>

    Removes keyboard focus from the current element.

    Locator.blur

    0.4.2

    boundingBox: (
        options?: { timeout?: number },
    ) => Effect<
        Option<{ height: number; width: number; x: number; y: number }>,
        PlaywrightError,
    >

    Returns the bounding box of the element.

    Locator.boundingBox

    0.1.0

    check: (
        options?: {
            force?: boolean;
            noWaitAfter?: boolean;
            position?: { x: number; y: number };
            timeout?: number;
            trial?: boolean;
        },
    ) => Effect<void, PlaywrightError>

    Checks the element.

    Locator.check

    0.1.0

    clear: (
        options?: { force?: boolean; noWaitAfter?: boolean; timeout?: number },
    ) => Effect<void, PlaywrightError>

    Clear the input field.

    Locator.clear

    0.4.2

    click: (
        options?: {
            button?: "left" | "right" | "middle";
            clickCount?: number;
            delay?: number;
            force?: boolean;
            modifiers?: ("Alt" | "Control" | "ControlOrMeta" | "Meta" | "Shift")[];
            noWaitAfter?: boolean;
            position?: { x: number; y: number };
            steps?: number;
            timeout?: number;
            trial?: boolean;
        },
    ) => Effect<void, PlaywrightError>

    Clicks the element.

    0.1.0

    contentFrame: () => PlaywrightFrameLocatorService

    Returns a FrameLocator object pointing to the same iframe as this locator.

    Locator.contentFrame

    0.4.1

    count: Effect<number, PlaywrightError>

    Counts the number of matched elements.

    0.1.0

    dblclick: (
        options?: {
            button?: "left" | "right" | "middle";
            delay?: number;
            force?: boolean;
            modifiers?: ("Alt" | "Control" | "ControlOrMeta" | "Meta" | "Shift")[];
            noWaitAfter?: boolean;
            position?: { x: number; y: number };
            steps?: number;
            timeout?: number;
            trial?: boolean;
        },
    ) => Effect<void, PlaywrightError>

    Double-clicks the element.

    Locator.dblclick

    0.4.2

    describe: (description: string) => PlaywrightLocatorService

    Describes the locator.

    Locator.describe

    0.1.0

    description: () => Option<string>

    Returns the description of the locator.

    Locator.description

    0.1.0

    dispatchEvent: (
        type: string,
        eventInit?: EvaluationArgument,
        options?: { timeout?: number },
    ) => Effect<void, PlaywrightError>

    Dispatches an event.

    Locator.dispatchEvent

    0.4.2

    dragTo: (
        target: PlaywrightLocatorService | Locator,
        options?: {
            force?: boolean;
            noWaitAfter?: boolean;
            sourcePosition?: { x: number; y: number };
            steps?: number;
            targetPosition?: { x: number; y: number };
            timeout?: number;
            trial?: boolean;
        },
    ) => Effect<void, PlaywrightError>

    Drags the locator to another target locator.

    Locator.dragTo

    0.4.2

    elementHandle: (
        options?: { timeout?: number },
    ) => Effect<
        Option<ElementHandle<SVGElement | HTMLElement>>,
        PlaywrightError,
    >

    Resolves given locator to the first matching DOM element.

    Locator.elementHandle

    0.3.0

    elementHandles: () => Effect<
        readonly ElementHandle<SVGElement | HTMLElement>[],
        PlaywrightError,
    >

    Resolves given locator to all matching DOM elements.

    Locator.elementHandles

    0.3.0

    evaluate: <
        R,
        Arg = void,
        E extends SVGElement | HTMLElement = SVGElement | HTMLElement,
    >(
        pageFunction: (element: E, arg: Unboxed<Arg>) => R | Promise<R>,
        arg?: Arg,
        options?: { timeout?: number },
    ) => Effect<R, PlaywrightError>

    Evaluates 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)));

    0.1.0

    evaluateAll: <
        R,
        Arg = void,
        E extends SVGElement | HTMLElement = SVGElement | HTMLElement,
    >(
        pageFunction: (elements: E[], arg: Unboxed<Arg>) => R | Promise<R>,
        arg?: Arg,
    ) => Effect<R, PlaywrightError>

    Evaluates a function on all matched elements.

    Locator.evaluateAll

    0.3.0

    evaluateHandle: <
        R,
        Arg = void,
        E extends SVGElement | HTMLElement = SVGElement | HTMLElement,
    >(
        pageFunction: (element: E, arg: Unboxed<Arg>) => R | Promise<R>,
        arg?: Arg,
    ) => Effect<JSHandle<R>, PlaywrightError>

    Evaluates a function on the matched element and returns the result as a handle.

    Locator.evaluateHandle

    0.3.0

    fill: (
        value: string,
        options?: { force?: boolean; noWaitAfter?: boolean; timeout?: number },
    ) => Effect<void, PlaywrightError>

    Fills the input field.

    0.1.0

    filter: (
        options?: {
            has?: Locator;
            hasNot?: Locator;
            hasNotText?: string | RegExp;
            hasText?: string | RegExp;
            visible?: boolean;
        },
    ) => PlaywrightLocatorService

    Narrows existing locator according to the options.

    Locator.filter

    0.4.1

    Returns a locator that points to the first matched element.

    0.1.0

    focus: (options?: { timeout?: number }) => Effect<void, PlaywrightError>

    Focuses the element.

    Locator.focus

    0.4.2

    frameLocator: (selector: string) => PlaywrightFrameLocatorService

    Creates a frame locator that will enter the iframe and allow selecting elements in that iframe.

    Locator.frameLocator

    0.4.1

    getAttribute: (
        name: string,
        options?: { timeout?: number },
    ) => Effect<string | null, PlaywrightError>

    Gets an attribute value.

    0.1.0

    getByAltText: (
        text: string | RegExp,
        options?: { exact?: boolean },
    ) => PlaywrightLocatorService

    Allows locating elements by their alt text.

    Locator.getByAltText

    0.1.0

    getByLabel: (
        text: string | RegExp,
        options?: { exact?: boolean },
    ) => PlaywrightLocatorService

    Allows locating elements by their label text.

    Locator.getByLabel

    0.1.0

    getByPlaceholder: (
        text: string | RegExp,
        options?: { exact?: boolean },
    ) => PlaywrightLocatorService

    Allows locating elements by their placeholder text.

    Locator.getByPlaceholder

    0.1.0

    getByRole: (
        role:
            | "alert"
            | "alertdialog"
            | "application"
            | "article"
            | "banner"
            | "blockquote"
            | "button"
            | "caption"
            | "cell"
            | "checkbox"
            | "code"
            | "columnheader"
            | "combobox"
            | "complementary"
            | "contentinfo"
            | "definition"
            | "deletion"
            | "dialog"
            | "directory"
            | "document"
            | "emphasis"
            | "feed"
            | "figure"
            | "form"
            | "generic"
            | "grid"
            | "gridcell"
            | "group"
            | "heading"
            | "img"
            | "insertion"
            | "link"
            | "list"
            | "listbox"
            | "listitem"
            | "log"
            | "main"
            | "marquee"
            | "math"
            | "meter"
            | "menu"
            | "menubar"
            | "menuitem"
            | "menuitemcheckbox"
            | "menuitemradio"
            | "navigation"
            | "none"
            | "note"
            | "option"
            | "paragraph"
            | "presentation"
            | "progressbar"
            | "radio"
            | "radiogroup"
            | "region"
            | "row"
            | "rowgroup"
            | "rowheader"
            | "scrollbar"
            | "search"
            | "searchbox"
            | "separator"
            | "slider"
            | "spinbutton"
            | "status"
            | "strong"
            | "subscript"
            | "superscript"
            | "switch"
            | "tab"
            | "table"
            | "tablist"
            | "tabpanel"
            | "term"
            | "textbox"
            | "time"
            | "timer"
            | "toolbar"
            | "tooltip"
            | "tree"
            | "treegrid"
            | "treeitem",
        options?: {
            checked?: boolean;
            disabled?: boolean;
            exact?: boolean;
            expanded?: boolean;
            includeHidden?: boolean;
            level?: number;
            name?: string | RegExp;
            pressed?: boolean;
            selected?: boolean;
        },
    ) => PlaywrightLocatorService

    Allows locating elements by their ARIA role, ARIA attributes and accessible name.

    Locator.getByRole

    0.1.0

    getByTestId: (testId: string | RegExp) => PlaywrightLocatorService

    Allows locating elements by their test id.

    Locator.getByTestId

    0.1.0

    getByText: (
        text: string | RegExp,
        options?: { exact?: boolean },
    ) => PlaywrightLocatorService

    Allows locating elements that contain given text.

    Locator.getByText

    0.1.0

    getByTitle: (
        text: string | RegExp,
        options?: { exact?: boolean },
    ) => PlaywrightLocatorService

    Allows locating elements by their title attribute.

    Locator.getByTitle

    0.1.0

    highlight: () => Effect<void, PlaywrightError>

    Highlights the corresponding element(s) on the screen.

    Locator.highlight

    0.4.1

    hover: (
        options?: {
            force?: boolean;
            modifiers?: ("Alt" | "Control" | "ControlOrMeta" | "Meta" | "Shift")[];
            noWaitAfter?: boolean;
            position?: { x: number; y: number };
            timeout?: number;
            trial?: boolean;
        },
    ) => Effect<void, PlaywrightError>

    Hovers over the element.

    Locator.hover

    0.4.2

    innerHTML: (options?: { timeout?: number }) => Effect<string, PlaywrightError>

    Gets the inner HTML.

    0.1.0

    innerText: (options?: { timeout?: number }) => Effect<string, PlaywrightError>

    Gets the inner text.

    0.1.0

    inputValue: (options?: { timeout?: number }) => Effect<string, PlaywrightError>

    Gets the input value.

    0.1.0

    isChecked: (options?: { timeout?: number }) => Effect<boolean, PlaywrightError>

    Returns whether the element is checked.

    Locator.isChecked

    0.4.1

    isDisabled: (options?: { timeout?: number }) => Effect<boolean, PlaywrightError>

    Returns whether the element is disabled.

    Locator.isDisabled

    0.4.1

    isEditable: (options?: { timeout?: number }) => Effect<boolean, PlaywrightError>

    Returns whether the element is editable.

    Locator.isEditable

    0.4.1

    isEnabled: (options?: { timeout?: number }) => Effect<boolean, PlaywrightError>

    Returns whether the element is enabled.

    Locator.isEnabled

    0.4.1

    isHidden: (options?: { timeout?: number }) => Effect<boolean, PlaywrightError>

    Returns whether the element is hidden.

    Locator.isHidden

    0.4.1

    isVisible: (options?: { timeout?: number }) => Effect<boolean, PlaywrightError>

    Returns whether the element is visible.

    Locator.isVisible

    0.4.1

    Returns a locator that points to the last matched element.

    0.1.0

    locator: (
        selectorOrLocator: string | PlaywrightLocatorService | Locator,
        options?: {
            has?: Locator;
            hasNot?: Locator;
            hasNotText?: string | RegExp;
            hasText?: string | RegExp;
        },
    ) => PlaywrightLocatorService

    Returns a locator that points to a matched element.

    Locator.locator

    0.1.0

    nth: (index: number) => PlaywrightLocatorService

    Returns a locator that points to the nth matched element.

    0.1.0

    Creates a locator that matches either this locator or the argument locator.

    Locator.or

    0.4.1

    A page this locator belongs to.

    Locator.page

    0.4.1

    press: (
        key: string,
        options?: { delay?: number; noWaitAfter?: boolean; timeout?: number },
    ) => Effect<void, PlaywrightError>

    Focuses the element, and then uses keyboard.down and keyboard.up.

    Locator.press

    0.4.2

    pressSequentially: (
        text: string,
        options?: { delay?: number; noWaitAfter?: boolean; timeout?: number },
    ) => Effect<void, PlaywrightError>

    Focuses the element, and then sends a keydown, keypress/input, and keyup event for each character in the text.

    Locator.pressSequentially

    0.4.2

    screenshot: (
        options?: LocatorScreenshotOptions,
    ) => Effect<Buffer<ArrayBufferLike>, PlaywrightError>

    Captures a screenshot of the element.

    Locator.screenshot

    0.4.1

    scrollIntoViewIfNeeded: (
        options?: { timeout?: number },
    ) => Effect<void, PlaywrightError>

    Scrolls the element into view if needed.

    Locator.scrollIntoViewIfNeeded

    0.4.2

    selectOption: (
        values:
            | string
            | ElementHandle<Node>
            | readonly string[]
            | { index?: number; label?: string; value?: string }
            | readonly ElementHandle<Node>[]
            | readonly { index?: number; label?: string; value?: string }[]
            | null,
        options?: { force?: boolean; noWaitAfter?: boolean; timeout?: number },
    ) => Effect<readonly string[], PlaywrightError>

    Selects an option in a <select> element.

    Locator.selectOption

    0.4.2

    selectText: (
        options?: { force?: boolean; timeout?: number },
    ) => Effect<void, PlaywrightError>

    Selects text.

    Locator.selectText

    0.4.2

    setChecked: (
        checked: boolean,
        options?: {
            force?: boolean;
            noWaitAfter?: boolean;
            position?: { x: number; y: number };
            timeout?: number;
            trial?: boolean;
        },
    ) => Effect<void, PlaywrightError>

    Checks the element if not already checked.

    Locator.setChecked

    0.4.2

    setInputFiles: (
        files:
            | string
            | readonly string[]
            | { buffer: Buffer; mimeType: string; name: string }
            | readonly { buffer: Buffer; mimeType: string; name: string }[],
        options?: { noWaitAfter?: boolean; timeout?: number },
    ) => Effect<void, PlaywrightError>

    Sets the value of the file input.

    Locator.setInputFiles

    0.4.2

    tap: (
        options?: {
            force?: boolean;
            modifiers?: ("Alt" | "Control" | "ControlOrMeta" | "Meta" | "Shift")[];
            noWaitAfter?: boolean;
            position?: { x: number; y: number };
            timeout?: number;
            trial?: boolean;
        },
    ) => Effect<void, PlaywrightError>

    Taps the element.

    Locator.tap

    0.4.2

    textContent: (
        options?: { timeout?: number },
    ) => Effect<string | null, PlaywrightError>

    Gets the text content.

    0.1.0

    toString: () => string

    Returns the string representation of the locator.

    Locator.toString

    0.4.1

    uncheck: (
        options?: {
            force?: boolean;
            noWaitAfter?: boolean;
            position?: { x: number; y: number };
            timeout?: number;
            trial?: boolean;
        },
    ) => Effect<void, PlaywrightError>

    Unchecks the element.

    Locator.uncheck

    0.4.2

    use: <T>(f: (locator: Locator) => Promise<T>) => Effect<T, PlaywrightError>

    A 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.

    Type Declaration

      • <T>(f: (locator: Locator) => Promise<T>): Effect<T, PlaywrightError>
      • Type Parameters

        • T

        Parameters

        • f: (locator: Locator) => Promise<T>

          A function that takes the Playwright Locator and returns a Promise.

        Returns Effect<T, PlaywrightError>

        An effect that wraps the promise and returns its result.

    const isVisible = yield* locator.use((l) => l.isVisible());
    

    0.1.0

    waitFor: (
        options?: {
            state?: "attached" | "detached" | "visible" | "hidden";
            timeout?: number;
        },
    ) => Effect<void, PlaywrightError>

    Returns when element specified by locator satisfies the state option.

    Locator.waitFor

    0.1.0