Skip to content

Interface: RoleLocatorOptions

@termwright/driver


@termwright/driver / RoleLocatorOptions

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

@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();

readonly optional exact?: boolean

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


readonly optional frameworkType?: string | RegExp

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

Narrows to nodes whose framework type matches, e.g. getByRole('generic', { frameworkType: 'ScrollView' }).

Without it generic is barely selectable: every widget a recognizer did not know arrives under that one role, and the role alone cannot tell them apart.


readonly optional name?: string | RegExp

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


readonly optional state?: Partial<SemanticState>

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