Skip to content

API Reference / @gtkx/testing / UserEvent

Type Alias: UserEvent

UserEvent = object

Defined in: packages/testing/dist/user-event/index.d.ts:15

User interactions exposed by userEvent.

Properties

clear

clear: typeof clear

Defined in: packages/testing/dist/user-event/index.d.ts:29

Deletes all text from an editable widget.


click

click: typeof click

Defined in: packages/testing/dist/user-event/index.d.ts:19

Activates or presses and releases a widget.


copy

copy: typeof copy

Defined in: packages/testing/dist/user-event/index.d.ts:31

Copies the current selection.


cut

cut: typeof cut

Defined in: packages/testing/dist/user-event/index.d.ts:33

Cuts the current selection.


dblClick

dblClick: typeof dblClick

Defined in: packages/testing/dist/user-event/index.d.ts:21

Delivers a double-click gesture.


deselectOptions

deselectOptions: typeof deselectOptions

Defined in: packages/testing/dist/user-event/index.d.ts:39

Unselects positions without activating them.


drag

drag: typeof drag

Defined in: packages/testing/dist/user-event/index.d.ts:53

Runs a begin, update, and end sequence on the widget's drag gestures, ending at the given offset.


dragAndDrop

dragAndDrop: typeof dragAndDrop

Defined in: packages/testing/dist/user-event/index.d.ts:57

Requires a drag source on the source widget, then emits drop with the content on the target's drop targets.


drop

drop: typeof drop

Defined in: packages/testing/dist/user-event/index.d.ts:55

Emits drop with the given content on the widget's drop targets.


hover

hover: typeof hover

Defined in: packages/testing/dist/user-event/index.d.ts:41

Emits a motion enter on the widget, adding a motion controller when it has none.


keyboard

keyboard: (widget, input) => Promise<void>

Defined in: packages/testing/dist/user-event/index.d.ts:63

Sends a key sequence through GTK's propagation chain.

Parameters

widget

Gtk.Widget

input

string

Returns

Promise<void>


longPress

longPress: typeof longPress

Defined in: packages/testing/dist/user-event/index.d.ts:51

Emits pressed at the given point on the widget's long-press gestures.


paste

paste: typeof paste

Defined in: packages/testing/dist/user-event/index.d.ts:35

Pastes text or clipboard contents.


pointer

pointer: (widget, input) => Promise<void>

Defined in: packages/testing/dist/user-event/index.d.ts:65

Applies a pointer token while preserving held-button state.

Parameters

widget

Gtk.Widget

input

PointerInput

Returns

Promise<void>


rotate

rotate: typeof rotate

Defined in: packages/testing/dist/user-event/index.d.ts:45

Emits angle-changed on the widget's rotate gestures.


scroll

scroll: typeof scroll

Defined in: packages/testing/dist/user-event/index.d.ts:61

Adds the delta to the adjustments of the widget itself, or of its nearest scrollable ancestor.


selectOptions

selectOptions: typeof selectOptions

Defined in: packages/testing/dist/user-event/index.d.ts:37

Selects positions without activating them.


setup

setup: (options?) => UserEvent

Defined in: packages/testing/dist/user-event/index.d.ts:17

Creates an instance with shared keyboard and pointer state.

Parameters

options?

UserEventOptions

Returns

UserEvent


slide

slide: typeof slide

Defined in: packages/testing/dist/user-event/index.d.ts:59

Emits a jump change-value on a Gtk.Range so it moves to the given value.


swipe

swipe: typeof swipe

Defined in: packages/testing/dist/user-event/index.d.ts:49

Emits swipe with the given velocity on the widget's swipe gestures.


tab

tab: typeof tab

Defined in: packages/testing/dist/user-event/index.d.ts:25

Moves focus forward or backward within the root.


tripleClick

tripleClick: typeof tripleClick

Defined in: packages/testing/dist/user-event/index.d.ts:23

Delivers a triple-click gesture.


type

type: typeof type

Defined in: packages/testing/dist/user-event/index.d.ts:27

Types into an editable widget.


unhover

unhover: typeof unhover

Defined in: packages/testing/dist/user-event/index.d.ts:43

Emits a motion leave on the widget, adding a motion controller when it has none.


zoom

zoom: typeof zoom

Defined in: packages/testing/dist/user-event/index.d.ts:47

Emits scale-changed on the widget's zoom gestures.

Released under the MPL-2.0 License.