Appearance
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
| Parameter | Type | Description |
|---|---|---|
ctx | Context | Context object. |
selector | string | CSS selector for the input element. |
value | string | The target value to wait for. |
options? | WaitValueOptions | Timeout, 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);