Interface: PointerActions
Defined in: packages/core/src/interactor/Interactor.ts:33
Pointer/mouse-driven, potentially DOM-mutating interactions: the pointer gestures a real user performs with a mouse, plus the two dispatch-based escape hatches (contextMenu, activate) for outcomes ordinary pointer geometry cannot reach, and the drag primitives.
Split out of Interactor as a capability facet (ADR-007) so a driver
can depend on just the pointer surface, and a partial-capability environment
can declare pointer support independently of the rest. Interactor
recomposes this facet unchanged.
Extended by​
Methods​
activate()​
activate(
locator):Promise<void>
Defined in: packages/core/src/interactor/Interactor.ts:87
Activate the desired element without relying on pointer geometry — a coordinate-free, dispatch-based click.
This reaches elements an ordinary click cannot:
a visually-hidden or zero-size input covered by another element (e.g. MUI
Rating's hidden <input type="radio">, where a positional click hit-tests to
the covering star label instead). Prefer click
for ordinary, visible targets.
Parameters​
locator​
Returns​
Promise<void>
click()​
click(
locator,option?):Promise<void>
Defined in: packages/core/src/interactor/Interactor.ts:39
Click on the desired element
Parameters​
locator​
option?​
Partial<ClickOption>
Returns​
Promise<void>
contextMenu()​
contextMenu(
locator):Promise<void>
Defined in: packages/core/src/interactor/Interactor.ts:73
Dispatch a right-click / contextmenu event on the desired element.
A contextmenu event is the only way to open a context menu: such menus have
no aria-expanded toggle or controlled-open prop to flip, so the menu is
reachable only by the event a right-click produces. This is analogous to
pressKey for keyboard-only behaviors — a
dedicated primitive for an outcome no ordinary click
can express. The element is focused first if focusable, mirroring pressKey,
so the event originates from the active element as in a real right-click.
Parameters​
locator​
Returns​
Promise<void>
drag()​
drag(
locator,delta):Promise<void>
Defined in: packages/core/src/interactor/Interactor.ts:123
Drag the desired element by the given pixel delta from its center.
jsdom has no layout engine, so the drag has no positional outcome there: the pointer sequence is synthesized from the caller-supplied delta and only the event wiring is exercised. Behavioral assertions about the resulting position are therefore E2E-only; the jsdom path only guarantees the events fire once the element is found.
Mouse/pointer-based only: native HTML5 drag-and-drop is not synthesized — see #922.
Parameters​
locator​
Locator of the element to drag
delta​
Pixel offset to drag by, where x is horizontal and y is vertical
Returns​
Promise<void>
dragTo()​
dragTo(
source,target):Promise<void>
Defined in: packages/core/src/interactor/Interactor.ts:106
Drag the source element and drop it onto the target element.
jsdom has no layout engine, so the drag has no positional outcome there: the pointer sequence is synthesized at zeroed coordinates and only the event wiring (mousedown/mousemove/mouseup, and any drop handler they trigger) is exercised. Behavioral assertions about the final position are therefore E2E-only; the jsdom path only guarantees the events fire once both elements are found.
Mouse/pointer-based only: native HTML5 drag-and-drop
(dragstart/dragover/drop + dataTransfer) is not synthesized, so
components built on the HTML5 DnD API are out of scope here — see #922.
Parameters​
source​
Locator of the element to drag
target​
Locator of the element to drop onto
Returns​
Promise<void>
hover()​
hover(
locator,option?):Promise<void>
Defined in: packages/core/src/interactor/Interactor.ts:129
Perform a mouse hover on the desired element
Parameters​
locator​
option?​
Returns​
Promise<void>
mouseDown()​
mouseDown(
locator,option?):Promise<void>
Defined in: packages/core/src/interactor/Interactor.ts:48
Parameters​
locator​
option?​
Partial<MouseDownOption>
Returns​
Promise<void>
mouseEnter()​
mouseEnter(
locator,option?):Promise<void>
Defined in: packages/core/src/interactor/Interactor.ts:56
Parameters​
locator​
option?​
Partial<MouseEnterOption>
Returns​
Promise<void>
mouseLeave()​
mouseLeave(
locator,option?):Promise<void>
Defined in: packages/core/src/interactor/Interactor.ts:58
Parameters​
locator​
option?​
Partial<MouseLeaveOption>
Returns​
Promise<void>
mouseMove()​
mouseMove(
locator,option?):Promise<void>
Defined in: packages/core/src/interactor/Interactor.ts:46
Mouse move on the desired element
Parameters​
locator​
option?​
Partial<MouseMoveOption>
Returns​
Promise<void>
mouseOut()​
mouseOut(
locator,option?):Promise<void>
Defined in: packages/core/src/interactor/Interactor.ts:54
Parameters​
locator​
option?​
Partial<MouseOutOption>
Returns​
Promise<void>
mouseOver()​
mouseOver(
locator,option?):Promise<void>
Defined in: packages/core/src/interactor/Interactor.ts:52
Parameters​
locator​
option?​
Partial<HoverOption>
Returns​
Promise<void>
mouseUp()​
mouseUp(
locator,option?):Promise<void>
Defined in: packages/core/src/interactor/Interactor.ts:50
Parameters​
locator​
option?​
Partial<MouseUpOption>
Returns​
Promise<void>