Skip to content

Interface: ScreenLocator

@termwright/driver


@termwright/driver / ScreenLocator

Defined in: driver/src/api.ts:686

@termwright/driver — PTY + VT sessions, locators, actions and waits.

The normative public API lives in api.ts; this module is the only entry point and re-exports the types from there together with their runtime implementations.

import { launchTerminal } from '@termwright/driver';
const terminal = await launchTerminal({ command: ['node', 'app.js'] });
await terminal.waitForText('Ready');
await terminal.getByRole('button', { name: 'Approve' }).activate();
await terminal.close();
  • LocatorBase<"screen">

readonly description: string

Defined in: driver/src/api.ts:583

Human-readable form of the query, as it appears in error messages.

LocatorBase.description


readonly domain: "screen"

Defined in: driver/src/api.ts:581

LocatorBase.domain

actionability(action, opts?): Promise<ActionabilityExplanation>

Defined in: driver/src/api.ts:696

"click" | "double-click" | "hover"

PointerOptions

Promise<ActionabilityExplanation>


and(other): ScreenLocator

Defined in: driver/src/api.ts:587

ScreenLocator

ScreenLocator

LocatorBase.and


cellSnapshot(opts?): Promise<LocatorCellSnapshot>

Defined in: driver/src/api.ts:614

Atomic cells inside this locator’s qualified rectangle.

LocatorCellSnapshotOptions

Promise<LocatorCellSnapshot>

LocatorBase.cellSnapshot


checkpoint(): ObservationStamp

Defined in: driver/src/api.ts:594

Current committed observation used to arm race-free custom waits.

ObservationStamp

LocatorBase.checkpoint


click(opts?): Promise<ActionReceipt>

Defined in: driver/src/api.ts:601

PointerOptions

Promise<ActionReceipt>

LocatorBase.click


count(): Promise<number>

Defined in: driver/src/api.ts:592

Promise<number>

LocatorBase.count


doubleClick(opts?): Promise<ActionReceipt>

Defined in: driver/src/api.ts:602

PointerOptions

Promise<ActionReceipt>

LocatorBase.doubleClick


dragTo(target, opts?): Promise<ActionReceipt>

Defined in: driver/src/api.ts:604

ScreenLocator

LocatorDragOptions

Promise<ActionReceipt>

LocatorBase.dragTo


evaluateCondition(condition, opts?): Promise<ConditionResult>

Defined in: driver/src/api.ts:695

ScreenCondition

WaitOptions

Promise<ConditionResult>


filter(options): ScreenLocator

Defined in: driver/src/api.ts:689

ScreenLocatorFilterOptions

ScreenLocator


first(): ScreenLocator

Defined in: driver/src/api.ts:584

ScreenLocator

LocatorBase.first


geometry(): Promise<LocatorGeometry>

Defined in: driver/src/api.ts:608

Atomic, evidence-qualified geometry. Never invents a rectangle.

Promise<LocatorGeometry>

LocatorBase.geometry


getByScreenText(text, opts?): ScreenLocator

Defined in: driver/src/api.ts:688

string | RegExp

ScreenTextLocatorOptions

ScreenLocator


hitTest(opts?): Promise<PointerHitTest>

Defined in: driver/src/api.ts:612

Whether pointer input at the chosen cell reaches this exact target.

{ columnOffset: number; rowOffset: number; }

number

number

Promise<PointerHitTest>

LocatorBase.hitTest


hover(opts?): Promise<ActionReceipt>

Defined in: driver/src/api.ts:603

PointerOptions

Promise<ActionReceipt>

LocatorBase.hover


last(): ScreenLocator

Defined in: driver/src/api.ts:585

ScreenLocator

LocatorBase.last


nth(index): ScreenLocator

Defined in: driver/src/api.ts:586

number

ScreenLocator

LocatorBase.nth


or(other): ScreenLocator

Defined in: driver/src/api.ts:588

ScreenLocator

ScreenLocator

LocatorBase.or


resolve(opts?): Promise<ResolvedTarget<"screen">>

Defined in: driver/src/api.ts:591

WaitOptions

Promise<ResolvedTarget<"screen">>

LocatorBase.resolve


textContent(): Promise<string>

Defined in: driver/src/api.ts:615

Promise<string>

LocatorBase.textContent


visibility(): Promise<LocatorVisibility>

Defined in: driver/src/api.ts:610

Attached/displayed/viewport facts without collapsing unknown to false.

Promise<LocatorVisibility>

LocatorBase.visibility


waitFor(opts?): Promise<void>

Defined in: driver/src/api.ts:690

object & WaitOptions

Promise<void>


waitForCheckpointChange(options): Promise<ObservationStamp>

Defined in: driver/src/api.ts:596

Waits for a newer committed observation without a check/subscribe gap.

object & WaitOptions

Promise<ObservationStamp>

LocatorBase.waitForCheckpointChange


wheel(opts): Promise<ActionReceipt>

Defined in: driver/src/api.ts:605

LocatorWheelOptions

Promise<ActionReceipt>

LocatorBase.wheel


within(parent): ScreenLocator

Defined in: driver/src/api.ts:687

ScreenLocator

ScreenLocator