Skip to content

Function: waitForValue()

ts
function waitForValue(
   ctx: Context, 
   selector: string, 
   value: string, 
options?: WaitValueOptions): Promise<ElementHandle<Element>>;

Defined in: src/wait/waiters/waitForValue.ts:20

Wait for an input element to reach a specific value.

Parameters

ParameterTypeDescription
ctxContextContext object.
selectorstringCSS selector for the input element.
valuestringThe target value to wait for.
options?WaitValueOptionsTimeout, polling, and initial value settings.

Returns

Promise<ElementHandle<Element>>

The element handle once the value matches.

Example

ts
// Wait until the display name is set
const input = await waitForValue(ctx, '#display-name-input', 'Captain Spreadsheet');
console.log('Welcome aboard, Captain!', input);

Matterway Assistant SDK Documentation