Class: TooltipDriver
Defined in: packages/component-driver-radix-v1/src/components/TooltipDriver.ts:39
Driver for a Radix Tooltip (Tooltip.Root/Tooltip.Content from
radix-ui), anchored at the TRIGGER, like PopoverDriver β not at the
portalled content via the static re-root hooks DialogDriver uses.
Why trigger-anchored: the portalled Tooltip.Content outer <div> is
ROLE-LESS (verified against rendered radix-ui@1.6.1 DOM β the
role="tooltip" element is a visually-hidden inner <span> Radix appends
for screen readers), so there is no generic role to statically re-root at,
and the static hooks carry no per-instance data anyway. The trigger, an
ordinary in-tree element, carries the full state contract instead:
data-state (closed/delayed-open/instant-open) is ALWAYS present, and
while open Radix adds aria-describedby pointing at the hidden
role="tooltip" span β followed at call time with byLinkedElement, the
same technique PopoverDriver uses for aria-controls.
jsdom vs E2E split: opening via open (a hover) works under jsdom
because DOMInteractor.hover fires the full userEvent.hover pointer
sequence Radix's trigger listens to β but only the open TRANSITION driven by
delays is timing-faithful in a real browser. Keep example scenes at
delayDuration={0} for deterministic jsdom probes, and treat
delay-behaviour assertions (default 700ms open delay, skip-delay grace
window) as E2E-only. Closing by pointer-leave is ALSO E2E-only: jsdom's
mouseOut/mouseLeave fire mouse events but not the pointerleave Radix
listens for β dismiss (Escape through DismissableLayer) is the
portable close path.
Extendsβ
ComponentDriver<{ }>
Constructorsβ
Constructorβ
new TooltipDriver(
locator,interactor,option?):TooltipDriver
Defined in: packages/component-driver-radix-v1/src/components/TooltipDriver.ts:42
Parametersβ
locatorβ
PartLocator
interactorβ
Interactor
option?β
Partial<IComponentDriverOption<{ }>>
Returnsβ
TooltipDriver
Overridesβ
ComponentDriver<{}>.constructor
Accessorsβ
driverNameβ
Get Signatureβ
get driverName():
string
Defined in: packages/component-driver-radix-v1/src/components/TooltipDriver.ts:121
Returnsβ
string
Overridesβ
ComponentDriver.driverName
Methodsβ
dismiss()β
dismiss(
timeoutMs?):Promise<boolean>
Defined in: packages/component-driver-radix-v1/src/components/TooltipDriver.ts:94
Dismiss the tooltip by pressing Escape on the trigger, then wait for it
to close. Radix's DismissableLayer handles Escape while open β the
portable close path, since pointer-leave closing is E2E-only (see the
class doc).
Parametersβ
timeoutMs?β
number = defaultTransitionDuration
Returnsβ
Promise<boolean>
getContent()β
getContent():
Promise<Optional<string>>
Defined in: packages/component-driver-radix-v1/src/components/TooltipDriver.ts:73
The tooltip's accessible text, resolved through the trigger's
aria-describedby β the hidden role="tooltip" span. undefined while
closed β the link only exists while open, and the unresolvable
LinkedCssLocator throw (the byLinkedElement-wide gap noted on
PopoverDriver) is translated here rather than surfaced.
Returnsβ
Promise<Optional<string>>
getState()β
getState():
Promise<Optional<string>>
Defined in: packages/component-driver-radix-v1/src/components/TooltipDriver.ts:62
The trigger's data-state: closed, delayed-open or instant-open.
Returnsβ
Promise<Optional<string>>
isOpen()β
isOpen():
Promise<boolean>
Defined in: packages/component-driver-radix-v1/src/components/TooltipDriver.ts:56
Whether the tooltip is open. Read from the trigger's ALWAYS-present
data-state (delayed-open/instant-open while open, closed
otherwise) β cheaper and throw-free compared to probing the portalled
content, which only mounts while open.
Returnsβ
Promise<boolean>
open()β
open():
Promise<void>
Defined in: packages/component-driver-radix-v1/src/components/TooltipDriver.ts:82
Open the tooltip by hovering its trigger (also opens on keyboard focus in real browsers).
Returnsβ
Promise<void>
waitForClose()β
waitForClose(
timeoutMs?):Promise<boolean>
Defined in: packages/component-driver-radix-v1/src/components/TooltipDriver.ts:112
Wait for the tooltip to close.
Parametersβ
timeoutMs?β
number = defaultTransitionDuration
Returnsβ
Promise<boolean>
waitForOpen()β
waitForOpen(
timeoutMs?):Promise<boolean>
Defined in: packages/component-driver-radix-v1/src/components/TooltipDriver.ts:102
Wait for the tooltip to open. With Radix's default 700ms open delay, pass a larger timeoutMs.
Parametersβ
timeoutMs?β
number = defaultTransitionDuration
Returnsβ
Promise<boolean>
Inherited members (20)
Propertiesβ
commutableOptionβ
readonlycommutableOption:CommutableComponentDriverOption
Defined in: packages/core/dist/index.d.mts:1182
The component-agnostic slice of the constructor option that is safe to share
across the whole driver tree β everything the constructor received EXCEPT the
component-specific parts, which each driver owns for itself. Parent drivers
pass this straight to the constructors of children they create dynamically
(see the list helpers). See CommutableComponentDriverOption.
Inherited fromβ
ComponentDriver.commutableOption
interactorβ
readonlyinteractor:Interactor
Defined in: packages/core/dist/index.d.mts:1172
Inherited fromβ
ComponentDriver.interactor
Accessorsβ
locatorβ
Get Signatureβ
get locator():
PartLocator
Defined in: packages/core/dist/index.d.mts:1229
Return the locator of the component
Returnsβ
PartLocator
Inherited fromβ
ComponentDriver.locator
partsβ
Get Signatureβ
get parts():
ScenePartDriver<T>
Defined in: packages/core/dist/index.d.mts:1225
Return driver instance of all the named parts
Returnsβ
ScenePartDriver<T>
Inherited fromβ
ComponentDriver.parts
Methodsβ
click()β
click(
option?):Promise<void>
Defined in: packages/core/dist/index.d.mts:1253
Parametersβ
option?β
Partial<ClickOption>
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.click
exists()β
exists():
Promise<boolean>
Defined in: packages/core/dist/index.d.mts:1252
Whether the component exists/attached to the DOM
Returnsβ
Promise<boolean>
true if the component is attached to the DOM, false otherwise
Inherited fromβ
ComponentDriver.exists
focus()β
focus(
option?):Promise<void>
Defined in: packages/core/dist/index.d.mts:1262
Parametersβ
option?β
Partial<FocusOption>
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.focus
getAttribute()β
getAttribute(
attributeName):Promise<Optional<string>>
Defined in: packages/core/dist/index.d.mts:1247
Parametersβ
attributeNameβ
string
Returnsβ
Promise<Optional<string>>
Inherited fromβ
ComponentDriver.getAttribute
getText()β
getText():
Promise<Optional<string>>
Defined in: packages/core/dist/index.d.mts:1246
Get the combined text content of the component
Returnsβ
Promise<Optional<string>>
If the component exists and has content, it should return the text or otherwise undefined
Inherited fromβ
ComponentDriver.getText
hover()β
hover(
option?):Promise<void>
Defined in: packages/core/dist/index.d.mts:1254
Parametersβ
option?β
Partial<HoverOption>
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.hover
isVisible()β
isVisible():
Promise<boolean>
Defined in: packages/core/dist/index.d.mts:1336
Whether the component is visible. Visibility is defined
that the component does not have the CSS property display: none,
visibility: hidden, or opacity: 0. However this does not
check whether the component is within the viewport.
Returnsβ
Promise<boolean>
true if the component is visible, false otherwise
Inherited fromβ
ComponentDriver.isVisible
pressKey()β
pressKey(
key,option?):Promise<void>
Defined in: packages/core/dist/index.d.mts:1268
Dispatch a keyboard key press on the component. See Interactor.pressKey.
Parametersβ
keyβ
string
A KeyboardEvent.key value, e.g. 'Escape', 'Backspace', 'Enter'
option?β
Partial<PressKeyOption>
Reserved for future modifier-key support
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.pressKey
runtimeCssSelector()β
runtimeCssSelector():
Promise<string>
Defined in: packages/core/dist/index.d.mts:1367
Get the runtime CSS selector of the component. This is useful for debugging and testing purposes.
Returnsβ
Promise<string>
The runtime CSS selector of the component
Inherited fromβ
ComponentDriver.runtimeCssSelector
scrollIntoView()β
scrollIntoView():
Promise<void>
Defined in: packages/core/dist/index.d.mts:1289
Scroll the component into the viewport. See Interactor.scrollIntoView.
jsdom has no layout engine, so the scroll is a no-op there and behavioral assertions (visibility, offset) are E2E-only.
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.scrollIntoView
typeText()β
typeText(
text):Promise<void>
Defined in: packages/core/dist/index.d.mts:1274
Type text into the component as real per-character keystrokes, inserting at the current caret without clearing. See Interactor.typeText.
Parametersβ
textβ
string
The literal text to type, one keystroke per character
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.typeText
waitUntil()β
waitUntil<
T>(option):Promise<T>
Defined in: packages/core/dist/index.d.mts:1356
Type Parametersβ
Tβ
T
Parametersβ
optionβ
WaitUntilOption<T>
Returnsβ
Promise<T>
Inherited fromβ
ComponentDriver.waitUntil
waitUntilComponentState()β
waitUntilComponentState(
option?):Promise<void>
Defined in: packages/core/dist/index.d.mts:1355
Wait until the component is in the expected state such as the component's visibility or existence. If the component has not reached the expected state within the timeout, it will throw an error.
By default it waits until the component is attached to the DOM within 30 seconds.
Parametersβ
option?β
Partial<Readonly<WaitForOption>>
The option to configure the wait behavior
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.waitUntilComponentState
waitUntilVisible()β
waitUntilVisible(
timeoutMs?):Promise<void>
Defined in: packages/core/dist/index.d.mts:1343
Wait until the component is attached and becomes visible to the DOM.
Parametersβ
timeoutMs?β
number
The number of milliseconds to wait before timing out. Defaults to defaultWaitForOption.timeoutMs so this wait shares a single flake-tolerance source with waitUntilComponentState (#1057).
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.waitUntilVisible
overriddenParentLocator()β
staticoverriddenParentLocator():Optional<PartLocator>
Defined in: packages/core/dist/index.d.mts:1211
Portal hook: where to re-root this driver's locator when its component renders
outside the parent's DOM (a modal, popup, drawer). Return the PartLocator
that locates the component from the document root, or undefined (the default)
for normal in-tree components whose locator chains from the parent.
This is static because it is per-class metadata read off the constructor
before any instance exists β which makes the "no instance state" constraint
structural rather than a documented caution. Override with static override.
Returnsβ
Optional<PartLocator>
Inherited fromβ
ComponentDriver.overriddenParentLocator
overrideLocatorRelativePosition()β
staticoverrideLocatorRelativePosition():Optional<LocatorRelativePosition>
Defined in: packages/core/dist/index.d.mts:1221
Portal hook: the locator relative position to apply when the component's real
DOM is a sibling/elsewhere rather than a descendant (e.g. a MUI dialog rendered
at the document root, located by a "Same"-level selector). Return undefined
(the default) to keep the natural position declared by the ScenePart.
Static for the same reason as ComponentDriver.overriddenParentLocator:
it is class-level metadata read before construction. Override with static override.
Returnsβ
Optional<LocatorRelativePosition>
Inherited fromβ
ComponentDriver.overrideLocatorRelativePosition
Protected members (16)
Methodsβ
activate()β
protectedactivate():Promise<void>
Defined in: packages/core/dist/index.d.mts:1282
Activate the component without relying on pointer geometry. See Interactor.activate.
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.activate
contextMenu()β
protectedcontextMenu():Promise<void>
Defined in: packages/core/dist/index.d.mts:1278
Dispatch a right-click / contextmenu event on the component. See Interactor.contextMenu.
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.contextMenu
drag()β
protecteddrag(delta):Promise<void>
Defined in: packages/core/dist/index.d.mts:1320
Drag this component by the given pixel delta from its center. See Interactor.drag.
Prefer a keyboard-driven setValue over a true drag in real drivers β these
drag primitives exist only for cases keyboard cannot express (e.g. panning a
Lightbox, reordering a column). jsdom has no layout engine, so the positional
outcome of the drag is E2E-only there.
Parametersβ
deltaβ
Point
Pixel offset to drag by
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.drag
dragTo()β
protecteddragTo(target):Promise<void>
Defined in: packages/core/dist/index.d.mts:1309
Drag this component and drop it onto another component. See Interactor.dragTo.
Prefer a keyboard-driven setValue over a true drag in real drivers β these
drag primitives exist only for cases keyboard cannot express (e.g. panning a
Lightbox, reordering a column). jsdom has no layout engine, so the positional
outcome of the drag is E2E-only there.
Parametersβ
targetβ
ComponentDriver<any>
Another driver whose root element is the drop target
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.dragTo
enforcePartExistence()β
protectedenforcePartExistence(partName):Promise<void>
Defined in: packages/core/dist/index.d.mts:1235
Check the specified parts' existences, and throw MissingPartError if any of the part is found not existence. Existence is defined by the part's existence in the DOM regardless of its visibility on the screen
Parametersβ
partNameβ
readonly never[]
Single or array of the names of the parts to be enforced
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.enforcePartExistence
getBoundingRect()β
protectedgetBoundingRect():Promise<BoundingRect>
Defined in: packages/core/dist/index.d.mts:1327
Get this component's bounding rectangle. See Interactor.getBoundingRect.
jsdom has no layout engine, so every coordinate and dimension is 0 there;
real geometry is E2E-only.
Returnsβ
Promise<BoundingRect>
Inherited fromβ
ComponentDriver.getBoundingRect
getMissingPartNames()β
protectedgetMissingPartNames(partName):Promise<readonlynever[]>
Defined in: packages/core/dist/index.d.mts:1241
Get the names of parts not in the DOM
Parametersβ
partNameβ
readonly never[]
Single or array of the names of the parts to be examined
Returnsβ
Promise<readonly never[]>
Inherited fromβ
ComponentDriver.getMissingPartNames
innerHTML()β
protectedinnerHTML():Promise<string>
Defined in: packages/core/dist/index.d.mts:1361
Get the inner HTML of the component
Returnsβ
Promise<string>
The inner HTML of the component
Inherited fromβ
ComponentDriver.innerHTML
mouseDown()β
protectedmouseDown(option?):Promise<void>
Defined in: packages/core/dist/index.d.mts:1256
Parametersβ
option?β
Partial<MouseDownOption>
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.mouseDown
mouseEnter()β
protectedmouseEnter(option?):Promise<void>
Defined in: packages/core/dist/index.d.mts:1260
Parametersβ
option?β
Partial<MouseEnterOption>
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.mouseEnter
mouseLeave()β
protectedmouseLeave(option?):Promise<void>
Defined in: packages/core/dist/index.d.mts:1261
Parametersβ
option?β
Partial<MouseLeaveOption>
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.mouseLeave
mouseMove()β
protectedmouseMove(option?):Promise<void>
Defined in: packages/core/dist/index.d.mts:1255
Parametersβ
option?β
Partial<MouseMoveOption>
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.mouseMove
mouseOut()β
protectedmouseOut(option?):Promise<void>
Defined in: packages/core/dist/index.d.mts:1259
Parametersβ
option?β
Partial<MouseOutOption>
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.mouseOut
mouseOver()β
protectedmouseOver(option?):Promise<void>
Defined in: packages/core/dist/index.d.mts:1258
Parametersβ
option?β
Partial<HoverOption>
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.mouseOver
mouseUp()β
protectedmouseUp(option?):Promise<void>
Defined in: packages/core/dist/index.d.mts:1257
Parametersβ
option?β
Partial<MouseUpOption>
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.mouseUp
scrollBy()β
protectedscrollBy(delta):Promise<void>
Defined in: packages/core/dist/index.d.mts:1298
Scroll the component by the given pixel delta. See Interactor.scrollBy.
jsdom has no layout engine, so the scroll is a no-op there and behavioral assertions (resulting offset) are E2E-only.
Parametersβ
deltaβ
Point
Pixel offset to scroll by
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.scrollBy