🌈 Create new beautiful Compose Gradients with our new wesite ->
Function

animateMoveTo

Move the mouse from the current position to the given position, sending a stream of move events to get an animated path of durationMillis milliseconds.

mouseInputAnimateMoveTo

@Sampled
fun mouseInputAnimateMoveTo() {
    composeTestRule.onNodeWithTag("myComponent").performMouseInput {
        // Hover over the node, making an X shape
        moveTo(topLeft)
        animateMoveTo(bottomRight)
        // Note that an actual user wouldn't be able to instantly
        // move from the bottom right to the top right
        advanceEventTime()
        moveTo(topRight)
        animateMoveTo(bottomLeft)
    }
}

trackpadInputAnimateMoveTo

@Sampled
fun trackpadInputAnimateMoveTo() {
    composeTestRule.onNodeWithTag("myComponent").performTrackpadInput {
        // Hover over the node, making an X shape
        moveTo(topLeft)
        animateMoveTo(bottomRight)
        // Note that an actual user wouldn't be able to instantly
        // move from the bottom right to the top right
        advanceEventTime()
        moveTo(topRight)
        animateMoveTo(bottomLeft)
    }
}