hubcap hover — Hover over an element

When to use

Hover over an element to trigger :hover styles, tooltips, or dropdown menus. Use mouse to move to specific coordinates instead of a selector.

Usage

hubcap hover <selector>

Arguments

ArgumentTypeRequiredDescription
selectorstringyesCSS selector of the element to hover over

Flags

None.

Output

FieldTypeDescription
hoveredbooleanWhether the hover succeeded
selectorstringThe selector that was used
{"hovered":true,"selector":".menu-trigger"}

Errors

ConditionExit codeStderr
Element not found1error: element not found: <sel>
Chrome not connected2error: connecting to Chrome: ...
Timeout3error: timeout

Examples

Hover over a menu trigger to open a dropdown:

hubcap hover '.menu-trigger'

Hover to reveal a tooltip, then read its text:

hubcap hover '.info-icon' && hubcap text '.tooltip'

See also

  • click - Single-click an element
  • mouse - Move the mouse to coordinates
  • styles - Get computed CSS styles