clear() | (element) => Promise<void> | Clears an editable widget's content. Sets the text to empty string. | user-event.ts:441 |
click() | (element) => Promise<void> | Clicks or toggles a widget. For toggleable widgets (checkboxes, switches, toggle buttons), toggles the active state. For buttons, emits clicked signal. | user-event.ts:406 |
dblClick() | (element) => Promise<void> | Double-clicks a widget. Emits pressed/released signals with n_press=1, then n_press=2. | user-event.ts:412 |
deselectOptions() | (element, values) => Promise<void> | Deselects options in a list. Works with ListBox and multi-selection list views. | user-event.ts:459 |
hover() | (element) => Promise<void> | Simulates mouse entering a widget (hover). Triggers the "enter" signal on the widget's EventControllerMotion. | user-event.ts:465 |
keyboard() | (element, input) => Promise<void> | Simulates keyboard input. Supports special keys in braces: {Enter}, {Tab}, {Escape}, etc. Use {Key>} to hold a key down, {/Key} to release. Example await userEvent.keyboard(element, "hello"); await userEvent.keyboard(element, "{Enter}"); await userEvent.keyboard(element, "{Shift>}A{/Shift}"); | user-event.ts:485 |
pointer() | (element, input) => Promise<void> | Simulates pointer (mouse) input. Supports: "click", "[MouseLeft]", "down", "up". Example await userEvent.pointer(element, "click"); await userEvent.pointer(element, "[MouseLeft]"); | user-event.ts:497 |
selectOptions() | (element, values) => Promise<void> | Selects options in a dropdown or list. Works with DropDown, ComboBox, ListBox, ListView, GridView, and ColumnView. | user-event.ts:450 |
tab() | (element, options?) => Promise<void> | Simulates Tab key navigation. | user-event.ts:425 |
tripleClick() | (element) => Promise<void> | Triple-clicks a widget. Emits pressed/released signals with n_press=1, 2, then 3. Useful for text selection. | user-event.ts:418 |
type() | (element, text) => Promise<void> | Types text into an editable widget. Appends text to the current content. Works with Entry, SearchEntry, and SpinButton widgets. | user-event.ts:435 |
unhover() | (element) => Promise<void> | Simulates mouse leaving a widget (unhover). Triggers the "leave" signal on the widget's EventControllerMotion. | user-event.ts:471 |