hover() and mouseUp() to drag and drop:
element.mouseDown()
Moves the mouse to the point wherefind() located the element, then presses the left button. The button stays down until you call mouseUp(). It’s the same as element.click('mouseDown').
Errors
Throws anElementNotFoundError if find() didn’t locate the element. See click() for how to check found() first.
Press at coordinates
The client has nomouseDown() method. To press the button at a point on the screen, pass action: 'mouseDown' to testdriver.click():
Examples
Reorder a list
Draw on a canvas
Complete example
tests/drag-and-drop.test.mjs
Related
- mouseUp(): release the button
- hover(): move the mouse while the button is down
- click(): a full press and release
- Perform actions: every kind of action in one guide

