Overview

The HOVER step moves the mouse cursor over an element to trigger hover states. This is useful for revealing tooltips, dropdown menus, or any UI elements that respond to mouse hover events.

Parameters

targetDescription
string
required
Element selector to hover over
duration
number
default:"0"
How long to maintain the hover state (in milliseconds)
offsetX
number
default:"0"
X offset from the hover position (in pixels)
offsetY
number
default:"0"
Y offset from the hover position (in pixels)
position
enum
default:"center"
Position on the element to hover at:
  • center - Center of the element
  • topLeft - Top-left corner
  • topRight - Top-right corner
  • bottomLeft - Bottom-left corner
  • bottomRight - Bottom-right corner

Behavior

  1. Element Location: Finds the element using the provided selector
  2. Position Calculation: Calculates hover position based on position and offset parameters
  3. Mouse Movement: Moves the mouse to the calculated position
  4. Hover State: Maintains hover for the specified duration
  5. Event Triggering: Fires mouseover, mouseenter, and related events

Common Use Cases

  • Revealing dropdown menus
  • Showing tooltips or popovers
  • Triggering CSS hover states
  • Testing hover-based navigation
  • Revealing hidden action buttons
  • Testing image zoom on hover

Error Handling

The step will fail if:
  • The element cannot be found using the selector
  • The element is not visible
  • The element is not hoverable (e.g., disabled or covered)
  • The mouse cannot be moved to the specified position
Clear error messages help identify issues with element selection or hover positioning.