Interface: SemanticLocator
@termwright/driver / SemanticLocator
Interface: SemanticLocator
Section titled “Interface: SemanticLocator”Defined in: driver/src/api.ts:619
@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.
Example
Section titled “Example”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();Extends
Section titled “Extends”LocatorBase<"semantic">
Properties
Section titled “Properties”description
Section titled “description”
readonlydescription:string
Defined in: driver/src/api.ts:583
Human-readable form of the query, as it appears in error messages.
Inherited from
Section titled “Inherited from”domain
Section titled “domain”
readonlydomain:"semantic"
Defined in: driver/src/api.ts:581
Inherited from
Section titled “Inherited from”LocatorBase.domain
Methods
Section titled “Methods”actionability()
Section titled “actionability()”actionability(
action,opts?):Promise<ActionabilityExplanation>
Defined in: driver/src/api.ts:646
Parameters
Section titled “Parameters”action
Section titled “action”"focus" | "click" | "double-click" | "hover" | "activate" | "press" | "type" | "fill" | "check" | "uncheck"
PointerOptions & object
Returns
Section titled “Returns”Promise<ActionabilityExplanation>
activate()
Section titled “activate()”activate(
opts?):Promise<ActionReceipt>
Defined in: driver/src/api.ts:670
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<ActionReceipt>
and(
other):SemanticLocator
Defined in: driver/src/api.ts:587
Parameters
Section titled “Parameters”SemanticLocator
Returns
Section titled “Returns”SemanticLocator
Inherited from
Section titled “Inherited from”LocatorBase.and
cellSnapshot()
Section titled “cellSnapshot()”cellSnapshot(
opts?):Promise<LocatorCellSnapshot>
Defined in: driver/src/api.ts:614
Atomic cells inside this locator’s qualified rectangle.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<LocatorCellSnapshot>
Inherited from
Section titled “Inherited from”LocatorBase.cellSnapshot
check()
Section titled “check()”check(
opts?):Promise<ActionReceipt>
Defined in: driver/src/api.ts:671
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<ActionReceipt>
checkpoint()
Section titled “checkpoint()”checkpoint():
ObservationStamp
Defined in: driver/src/api.ts:594
Current committed observation used to arm race-free custom waits.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”LocatorBase.checkpoint
click()
Section titled “click()”click(
opts?):Promise<ActionReceipt>
Defined in: driver/src/api.ts:601
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<ActionReceipt>
Inherited from
Section titled “Inherited from”LocatorBase.click
count()
Section titled “count()”count():
Promise<number>
Defined in: driver/src/api.ts:592
Returns
Section titled “Returns”Promise<number>
Inherited from
Section titled “Inherited from”LocatorBase.count
doubleClick()
Section titled “doubleClick()”doubleClick(
opts?):Promise<ActionReceipt>
Defined in: driver/src/api.ts:602
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<ActionReceipt>
Inherited from
Section titled “Inherited from”LocatorBase.doubleClick
dragTo()
Section titled “dragTo()”dragTo(
target,opts?):Promise<ActionReceipt>
Defined in: driver/src/api.ts:604
Parameters
Section titled “Parameters”target
Section titled “target”SemanticLocator
Returns
Section titled “Returns”Promise<ActionReceipt>
Inherited from
Section titled “Inherited from”LocatorBase.dragTo
evaluateCondition()
Section titled “evaluateCondition()”evaluateCondition(
condition,opts?):Promise<ConditionResult>
Defined in: driver/src/api.ts:645
Parameters
Section titled “Parameters”condition
Section titled “condition”Returns
Section titled “Returns”Promise<ConditionResult>
extendedState()
Section titled “extendedState()”extendedState():
Promise<SemanticExtendedObject|null>
Defined in: driver/src/api.ts:683
Returns
Section titled “Returns”Promise<SemanticExtendedObject | null>
fill()
Section titled “fill()”fill(
text,opts?):Promise<ActionReceipt>
Defined in: driver/src/api.ts:665
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<ActionReceipt>
filter()
Section titled “filter()”filter(
options):SemanticLocator
Defined in: driver/src/api.ts:626
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”SemanticLocator
first()
Section titled “first()”first():
SemanticLocator
Defined in: driver/src/api.ts:584
Returns
Section titled “Returns”SemanticLocator
Inherited from
Section titled “Inherited from”LocatorBase.first
focus()
Section titled “focus()”focus(
opts?):Promise<ActionReceipt>
Defined in: driver/src/api.ts:669
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<ActionReceipt>
geometry()
Section titled “geometry()”geometry():
Promise<LocatorGeometry>
Defined in: driver/src/api.ts:608
Atomic, evidence-qualified geometry. Never invents a rectangle.
Returns
Section titled “Returns”Promise<LocatorGeometry>
Inherited from
Section titled “Inherited from”LocatorBase.geometry
getByLabel()
Section titled “getByLabel()”getByLabel(
text,opts?):SemanticLocator
Defined in: driver/src/api.ts:622
Parameters
Section titled “Parameters”string | RegExp
exact?
Section titled “exact?”boolean
Returns
Section titled “Returns”SemanticLocator
getByRole()
Section titled “getByRole()”getByRole(
role,opts?):SemanticLocator
Defined in: driver/src/api.ts:621
Parameters
Section titled “Parameters”"application" | "region" | "dialog" | "alert" | "status" | "list" | "listitem" | "menu" | "menuitem" | "button" | "checkbox" | "radio" | "tab" | "textbox" | "heading" | "text" | "progressbar" | "separator" | "scrollbar" | "table" | "row" | "cell" | "generic"
Returns
Section titled “Returns”SemanticLocator
getByTestId()
Section titled “getByTestId()”getByTestId(
testId):SemanticLocator
Defined in: driver/src/api.ts:624
Parameters
Section titled “Parameters”testId
Section titled “testId”string
Returns
Section titled “Returns”SemanticLocator
getByText()
Section titled “getByText()”getByText(
text,opts?):SemanticLocator
Defined in: driver/src/api.ts:623
Parameters
Section titled “Parameters”string | RegExp
Returns
Section titled “Returns”SemanticLocator
hitTest()
Section titled “hitTest()”hitTest(
opts?):Promise<PointerHitTest>
Defined in: driver/src/api.ts:612
Whether pointer input at the chosen cell reaches this exact target.
Parameters
Section titled “Parameters”position?
Section titled “position?”{ columnOffset: number; rowOffset: number; }
position.columnOffset
Section titled “position.columnOffset”number
position.rowOffset
Section titled “position.rowOffset”number
Returns
Section titled “Returns”Promise<PointerHitTest>
Inherited from
Section titled “Inherited from”LocatorBase.hitTest
hover()
Section titled “hover()”hover(
opts?):Promise<ActionReceipt>
Defined in: driver/src/api.ts:603
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<ActionReceipt>
Inherited from
Section titled “Inherited from”LocatorBase.hover
last()
Section titled “last()”last():
SemanticLocator
Defined in: driver/src/api.ts:585
Returns
Section titled “Returns”SemanticLocator
Inherited from
Section titled “Inherited from”LocatorBase.last
locator()
Section titled “locator()”locator(
selector):SemanticLocator
Defined in: driver/src/api.ts:625
Parameters
Section titled “Parameters”selector
Section titled “selector”string
Returns
Section titled “Returns”SemanticLocator
nth(
index):SemanticLocator
Defined in: driver/src/api.ts:586
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”SemanticLocator
Inherited from
Section titled “Inherited from”LocatorBase.nth
or(
other):SemanticLocator
Defined in: driver/src/api.ts:588
Parameters
Section titled “Parameters”SemanticLocator
Returns
Section titled “Returns”SemanticLocator
Inherited from
Section titled “Inherited from”LocatorBase.or
paintedRegion()
Section titled “paintedRegion()”paintedRegion():
Promise<Observation<SemanticPaintedRegion>>
Defined in: driver/src/api.ts:679
Exact cells painted by this semantic recipient, never inferred from layout.
Returns
Section titled “Returns”Promise<Observation<SemanticPaintedRegion>>
press()
Section titled “press()”press(
keys,opts?):Promise<ActionReceipt>
Defined in: driver/src/api.ts:660
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<ActionReceipt>
resolve()
Section titled “resolve()”resolve(
opts?):Promise<ResolvedTarget<"semantic">>
Defined in: driver/src/api.ts:591
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<ResolvedTarget<"semantic">>
Inherited from
Section titled “Inherited from”LocatorBase.resolve
semanticScroll()
Section titled “semanticScroll()”semanticScroll():
Promise<Observation<SemanticScrollState>>
Defined in: driver/src/api.ts:675
Production application viewport state, never emulator scrollback position.
Returns
Section titled “Returns”Promise<Observation<SemanticScrollState>>
semanticState()
Section titled “semanticState()”semanticState():
Promise<SemanticState|null>
Defined in: driver/src/api.ts:682
Returns
Section titled “Returns”Promise<SemanticState | null>
semanticValue()
Section titled “semanticValue()”semanticValue():
Promise<SemanticValueObservation>
Defined in: driver/src/api.ts:673
Returns
Section titled “Returns”Promise<SemanticValueObservation>
textContent()
Section titled “textContent()”textContent():
Promise<string>
Defined in: driver/src/api.ts:615
Returns
Section titled “Returns”Promise<string>
Inherited from
Section titled “Inherited from”LocatorBase.textContent
type()
Section titled “type()”type(
text,opts?):Promise<ActionReceipt>
Defined in: driver/src/api.ts:661
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<ActionReceipt>
uncheck()
Section titled “uncheck()”uncheck(
opts?):Promise<ActionReceipt>
Defined in: driver/src/api.ts:672
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<ActionReceipt>
visibility()
Section titled “visibility()”visibility():
Promise<LocatorVisibility>
Defined in: driver/src/api.ts:610
Attached/displayed/viewport facts without collapsing unknown to false.
Returns
Section titled “Returns”Promise<LocatorVisibility>
Inherited from
Section titled “Inherited from”LocatorBase.visibility
waitFor()
Section titled “waitFor()”waitFor(
opts?):Promise<void>
Defined in: driver/src/api.ts:627
Parameters
Section titled “Parameters”object & WaitOptions
Returns
Section titled “Returns”Promise<void>
waitForCheckpointChange()
Section titled “waitForCheckpointChange()”waitForCheckpointChange(
options):Promise<ObservationStamp>
Defined in: driver/src/api.ts:596
Waits for a newer committed observation without a check/subscribe gap.
Parameters
Section titled “Parameters”options
Section titled “options”object & WaitOptions
Returns
Section titled “Returns”Promise<ObservationStamp>
Inherited from
Section titled “Inherited from”LocatorBase.waitForCheckpointChange
wheel()
Section titled “wheel()”wheel(
opts):Promise<ActionReceipt>
Defined in: driver/src/api.ts:605
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<ActionReceipt>
Inherited from
Section titled “Inherited from”LocatorBase.wheel
within()
Section titled “within()”within(
parent):SemanticLocator
Defined in: driver/src/api.ts:620
Parameters
Section titled “Parameters”parent
Section titled “parent”SemanticLocator
Returns
Section titled “Returns”SemanticLocator