Skip to main content

Class: DataTableDriver

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:142

Driver for the PrimeVue DataTable component (with Column children).

DOM audit (primevue@4.5.5): the root <div data-pc-name="datatable"> wraps a REAL <table role="table"> whose <tr>/<th>/<td> carry role="row"/"columnheader"/"cell" — native table semantics, which the row/cell reads anchor on. The <thead> and <tbody> both render role="rowgroup", so the role cannot distinguish them; the two section anchors use PrimeVue's own data-pc-section="thead"/"tbody" markers instead (the documented tier-2 fallback).

Row/cell iteration uses childListHelper (:nth-child position walk with a per-position selector check) — the guard against the truncated-enumeration bug class the root CLAUDE.md records — so interleaved non-row children a future PrimeVue version might render can never silently shorten counts.

Sorting (#1034). DOM audit (primevue@4.5.5): a sortable column's <th> carries aria-sort ('ascending'/'descending', absent — read as 'none' — otherwise) and toggles on a plain click of the header cell; PrimeVue's single-sort mode never returns to 'none' once a column has been clicked (verified empirically), it only flips between the two sorted states. sortBy clicks up to twice to reach a target direction from any starting state. Header cells are matched by the whole role="columnheader" <th>'s trimmed visible text, same identity getColumnLabels already uses.

Row selection (#1034). DOM audit (primevue@4.5.5): with the DataTable's selectionMode set, each body <tr> gets aria-selected — the read DataTableRowDriver.isSelected uses. Writing selects through whichever affordance the scene renders: a checkbox-column cell (data-p-selection-column="true", a REAL native checkbox — ground truth via Interactor.isChecked) if present, else a plain click on the row itself (row-click selection). The header select-all checkbox (data-pc-name="pcheadercheckbox") is a real native checkbox too, read the same way. A checkbox-selection column has no header label (getColumnLabels/getColumnCount still count it — it reports '').

Pagination (#1034). DOM audit (primevue@4.5.5): PrimeVue's Paginator renders as a <nav> DIRECT descendant of the table root (a sibling of the table container, outside <thead>/<tbody> — getRowCount and friends become page-scoped once paginated, not a change to those methods). Prev/next/first/last are data-pc-section="prev"/"next"/"first"/"last" <button>s with a native disabled attribute at a bound; page-number buttons are data-pc-section="page" with data-p-active="true" on the current one and an aria-label="Page N" that is LOCALIZED — goToPage therefore matches on the button's visible text (just the digits, locale-independent) rather than that label, the same identity getCurrentPage already reads. getPageCount counts currently-rendered page buttons — PrimeVue slides a window of page links (default size 5) for large datasets, so it undercounts total pages beyond that window; exact for small datasets, a known bound for large ones.

Filtering (#1034), scoped to filterDisplay="menu". DOM audit (primevue@4.5.5): a filterable column's <th> carries a .p-datatable-column-filter-button trigger with aria-expanded and an aria-controls id-link to the filter panel — the SAME byAriaIdReference overlay recipe SelectDriver's dropdown part already uses, reused here rather than a fresh mechanism. The panel (role="dialog", teleported to document.body) holds the match-mode picker, the filter's #filter-slot value control (CONSUMER-authored — verified empirically that PrimeVue renders nothing for filter: true alone; setColumnFilter assumes it renders a plain <input>, the same assumption MUI's DataGridPremiumDriver makes for its filter panel), and PrimeVue-owned Apply/Clear buttons (data-pc-name="pcfilterapplybutton"/"pcfilterclearbutton" — locale-independent, like this driver's pcheadercheckbox). Apply/Clear both commit AND close the panel (verified: aria-expanded flips to false immediately; the panel's own DOM removal lags behind by its leave transition, which openFilterMenu/closeFilterMenu's waitUntil absorbs).

Focus-trap race (same class as DialogDriver's documented one). The overlay is focus-trapped and grabs initial focus a frame after mount — verified to occasionally swallow every keystroke a caller types immediately after opening (a truncated-to-EMPTY value, not merely truncated text, since the whole type happened before the trap's grab). openFilterMenu absorbs this itself (a :focus-within wait mirroring DialogDriver.waitForOpen) before returning, so setColumnFilter and every other caller of it types/reads/clicks safely without its own workaround. filterDisplay="row" (the inline per-column filter row) is a DIFFERENT DOM shape — its own "Show Filter Menu" popup is match-mode-only, with the value input inline in the header instead — and is NOT covered here; it needs its own follow-up, the same "specific control" scoping this class doc has recorded since #1034's first wave.

Virtual scroll (#1034): audited, minimal E2E-only support. DOM audit (primevue@4.5.5, virtualScrollerOptions): jsdom's zero layout is a harder failure mode here than MUI's DataGrid (which at least renders its whole unwindowed page in jsdom) — PrimeVue's VirtualScroller computes how many rows FIT from the container's clientHeight, which jsdom always reports as 0, so it renders zero or one row regardless of dataset size. No jsdom assertion on row count/content is meaningful for a virtual-scroll table — asserting one would be exactly the vacuously-green failure class the root CLAUDE.md warns about. What DOES still work in jsdom: scrolling the .p-virtualscroller container recomputes which row(s) are rendered from scrollTop, so scrollRowIntoView at least exercises its code path everywhere; its actual "bring a specific row into a multi-row rendered window" behavior is E2E-only, mirroring the MUI driver's identical scrollRowIntoView and its identical caveat.

Cell editing (#1034): see DataTableRowDriver. #903 (the keystroke Interactor primitive) unblocked it; DOM audit found editMode="cell" needs no keystroke to ENTER edit (a plain click suffices — PrimeVue marks a column editable purely by the presence of an #editor slot, no editable prop), only to commit (Enter) or cancel (Escape) — the opposite split from MUI's DataGrid, which needs a keystroke to enter. The editor control is consumer-authored (#editor slot), so DataTableRowDriver.setCellValue makes the same plain-<input> assumption as the filter's value control.

Deferred (audited, not implemented): filterDisplay="row" inline filtering, frozen columns. Both need their own control-specific follow-up — see the notes above.

Extends​

  • ComponentDriver<{ }>

Constructors​

Constructor​

new DataTableDriver(locator, interactor, option?): DataTableDriver

Defined in: packages/core/dist/index.d.mts:1374

Parameters​

locator​

PartLocator

Locator for the root of this component.

interactor​

Interactor

Environment adapter used for all interactions.

option?​

Partial<IComponentDriverOption<{ }>>

Driver option carrying the shared driver-tree context.

Composite-driver authoring rule: a driver that declares non-empty parts must type this parameter as Partial<IComponentDriverOption> (i.e. the empty <{}> default) and hardcode its own parts in the body — super(locator, interactor, { ...option, parts }). The "natural" Partial<IComponentDriverOption<typeof parts>> signature does NOT satisfy ScenePartDefinition['driver'] (constructor parameters are checked contravariantly), so a driver written that way could not be placed in a parent ScenePart. Lock a composite driver against this rule in one line with AssertScenePlaceableDriver; the rule itself is regression-tested centrally in core/src/drivers/__type-tests__ and demonstrated in @atomic-testing/component-driver-html.

Returns​

DataTableDriver

Inherited from​

ComponentDriver<{}>.constructor

Accessors​

driverName​

Get Signature​

get driverName(): string

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:622

Returns​

string

Overrides​

ComponentDriver.driverName

Methods​

clearColumnFilter()​

clearColumnFilter(columnLabel, timeoutMs?): Promise<boolean>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:516

Click the filter overlay's Clear button (opening it first if needed), resetting the column's filter.

Parameters​

columnLabel​

string

timeoutMs?​

number = defaultFilterTransitionMs

Returns​

Promise<boolean>

false when no such column/filter.


closeFilterMenu()​

closeFilterMenu(columnLabel, timeoutMs?): Promise<boolean>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:453

Close the column's filter overlay (no-op if already closed).

Parameters​

columnLabel​

string

timeoutMs?​

number = defaultFilterTransitionMs

Returns​

Promise<boolean>

false when no such column/filter.


deselectAllRows()​

deselectAllRows(): Promise<boolean>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:305

Uncheck the header select-all checkbox, if checked.

Returns​

Promise<boolean>

false if there is no such checkbox


deselectRow()​

deselectRow(index): Promise<boolean>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:268

Deselect the row at index.

Parameters​

index​

number

Returns​

Promise<boolean>

false if out of range


getColumnCount()​

getColumnCount(): Promise<number>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:210

The number of columns (header cells), including any checkbox-selection column.

Returns​

Promise<number>


getColumnFilterValue()​

getColumnFilterValue(columnLabel, timeoutMs?): Promise<Optional<string>>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:496

Read the column filter's current value — opens the overlay first if needed (left open afterward), reading it back from the value input.

Parameters​

columnLabel​

string

timeoutMs?​

number = defaultFilterTransitionMs

Returns​

Promise<Optional<string>>

undefined when no such column/filter, or the filter's value control isn't a plain input.


getColumnLabels()​

getColumnLabels(): Promise<string[]>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:196

Trimmed header label of every column, in DOM order (a selection-checkbox column reports '').

Returns​

Promise<string[]>


getCurrentPage()​

getCurrentPage(): Promise<Optional<number>>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:341

The currently active page number, or undefined when there is no paginator.

Returns​

Promise<Optional<number>>


getPageCount()​

getPageCount(): Promise<number>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:358

The number of CURRENTLY RENDERED page-number buttons — see the class doc's "Pagination" note on the sliding-window bound for large datasets.

Returns​

Promise<number>


getRowByDataIndex()​

getRowByDataIndex(dataIndex): Promise<Optional<DataTableRowDriver>>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:187

The row whose data-p-index equals dataIndex — PrimeVue's own per-row data index, stamped on every body row (verified present outside virtual scroll too) and stable regardless of scroll position, unlike getRowByIndex's DOM-position addressing (which shifts once virtual scroll windows the rendered rows — see scrollRowIntoView).

Parameters​

dataIndex​

number

Returns​

Promise<Optional<DataTableRowDriver>>

undefined when that row isn't currently rendered.


getRowByIndex()​

getRowByIndex(index): Promise<Optional<DataTableRowDriver>>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:164

The body row at the given zero-based index, or undefined if out of range.

Parameters​

index​

number

Returns​

Promise<Optional<DataTableRowDriver>>


getRowCount()​

getRowCount(): Promise<number>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:159

The number of body rows (page-scoped once a paginator is active — see the class doc).

Returns​

Promise<number>


getSortDirection()​

getSortDirection(columnLabel): Promise<Optional<SortDirection>>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:234

The sort state of the column labelled columnLabel, or undefined when no column has that label.

Parameters​

columnLabel​

string

Returns​

Promise<Optional<SortDirection>>


goToPage()​

goToPage(pageNumber): Promise<boolean>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:321

Navigate to the page whose visible number is pageNumber.

Parameters​

pageNumber​

number

Returns​

Promise<boolean>

false when that page link isn't rendered


hasColumnFilter()​

hasColumnFilter(columnLabel): Promise<boolean>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:396

Whether the column labelled columnLabel has a filter (a filterDisplay="menu" trigger).

Parameters​

columnLabel​

string

Returns​

Promise<boolean>


hasPaginator()​

hasPaginator(): Promise<boolean>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:316

Whether a Paginator is rendered for this table.

Returns​

Promise<boolean>


hasSelectAllCheckbox()​

hasSelectAllCheckbox(): Promise<boolean>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:284

Whether the header select-all checkbox exists (a checkbox-selection column with selectionMode="multiple").

Returns​

Promise<boolean>


isAllRowsSelected()​

isAllRowsSelected(): Promise<boolean>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:289

The header select-all checkbox's checked state (native checked property).

Returns​

Promise<boolean>


isFilterMenuOpen()​

isFilterMenuOpen(columnLabel): Promise<Optional<boolean>>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:401

Whether the column's filter overlay is currently open. undefined when no such column/filter.

Parameters​

columnLabel​

string

Returns​

Promise<Optional<boolean>>


isRowSelected()​

isRowSelected(index): Promise<Optional<boolean>>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:278

Whether the row at index is selected (aria-selected), or undefined if out of range.

Parameters​

index​

number

Returns​

Promise<Optional<boolean>>


nextPage()​

nextPage(): Promise<boolean>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:331

Advance to the next page.

Returns​

Promise<boolean>

false when there is no paginator or already on the last page


openFilterMenu()​

openFilterMenu(columnLabel, timeoutMs?): Promise<boolean>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:410

Open the column's filter overlay (no-op if already open).

Parameters​

columnLabel​

string

timeoutMs?​

number = defaultFilterTransitionMs

Returns​

Promise<boolean>

false when no such column/filter.


previousPage()​

previousPage(): Promise<boolean>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:336

Go back to the previous page.

Returns​

Promise<boolean>

false when there is no paginator or already on the first page


scrollRowIntoView()​

scrollRowIntoView(rowIndex, timeoutMs?, rowHeightPx?): Promise<boolean>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:584

Bring a virtualized row into the rendered window by paging the .p-virtualscroller container toward it, then scroll it into the viewport. See the class doc's "Virtual scroll" note: this is E2E-only — jsdom renders zero or one row regardless, so this can exercise the code path there but never actually verify the windowing behavior.

Parameters​

rowIndex​

number

The row's absolute data index (data-p-index, stable across scroll position).

timeoutMs?​

number = 10000

rowHeightPx?​

number = estimatedVirtualScrollRowHeightPx

Row-height estimate for sizing scroll steps; pass the table's actual virtualScrollerOptions.itemSize for precise stepping (see estimatedVirtualScrollRowHeightPx).

Returns​

Promise<boolean>


selectAllRows()​

selectAllRows(): Promise<boolean>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:294

Check the header select-all checkbox, if not already checked.

Returns​

Promise<boolean>

false if there is no such checkbox


selectRow()​

selectRow(index): Promise<boolean>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:258

Select the row at index via its checkbox column, or a row click if there is none.

Parameters​

index​

number

Returns​

Promise<boolean>

false if out of range


setColumnFilter()​

setColumnFilter(columnLabel, value, timeoutMs?): Promise<boolean>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:471

Type value into the column's filter overlay (opening it first if needed) and commit with Apply — see the class doc's "Filtering" note for why the value control is assumed to be a plain <input>.

Parameters​

columnLabel​

string

value​

string

timeoutMs?​

number = defaultFilterTransitionMs

Returns​

Promise<boolean>

false when no such column/filter, or the filter's value control isn't a plain input.


sortBy()​

sortBy(columnLabel, direction): Promise<boolean>

Defined in: packages/component-driver-primevue-v4/src/components/DataTableDriver.ts:219

Click the column labelled columnLabel until its aria-sort reaches direction, up to two clicks (see the class doc's "Sorting" note).

Parameters​

columnLabel​

string

direction​

"ascending" | "descending"

Returns​

Promise<boolean>

false when no column has that label; otherwise whether direction was reached

Inherited members (21)

Properties​

commutableOption​

readonly commutableOption: CommutableComponentDriverOption

Defined in: packages/core/dist/index.d.mts:1356

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​

readonly interactor: Interactor

Defined in: packages/core/dist/index.d.mts:1346

Inherited from​

ComponentDriver.interactor

Accessors​

locator​

Get Signature​

get locator(): PartLocator

Defined in: packages/core/dist/index.d.mts:1414

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:1410

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:1492

Parameters​
option?​

Partial<ClickOption>

Returns​

Promise<void>

Inherited from​

ComponentDriver.click


exists()​

exists(): Promise<boolean>

Defined in: packages/core/dist/index.d.mts:1491

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:1501

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:1486

Parameters​
attributeName​

string

Returns​

Promise<Optional<string>>

Inherited from​

ComponentDriver.getAttribute


getText()​

getText(): Promise<Optional<string>>

Defined in: packages/core/dist/index.d.mts:1485

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:1493

Parameters​
option?​

Partial<HoverOption>

Returns​

Promise<void>

Inherited from​

ComponentDriver.hover


isVisible()​

isVisible(): Promise<boolean>

Defined in: packages/core/dist/index.d.mts:1576

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:1508

Dispatch a keyboard key press on the component. See Interactor.pressKey for the full contract, including modifier-key delivery via PressKeyOption.

Parameters​
key​

string

A KeyboardEvent.key value, e.g. 'Escape', 'Backspace', 'Enter'

option?​

Partial<PressKeyOption>

Modifier flags and other per-press options — see PressKeyOption

Returns​

Promise<void>

Inherited from​

ComponentDriver.pressKey


runtimeCssSelector()​

runtimeCssSelector(): Promise<string>

Defined in: packages/core/dist/index.d.mts:1641

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:1529

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:1514

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:1596

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:1595

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:1583

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


within()​

within<ContentT>(parts): ScenePartDriver<ContentT>

Defined in: packages/core/dist/index.d.mts:1468

Driver instances for a caller-supplied interior scene, resolved against this component's ComponentDriver.interiorLocator.

The call-time counterpart to ComponentDriver.parts: parts is the chrome the driver author hardcodes, this is the interior the scene author owns — a dialog's body, a popover's panel, a toast's action area. A PartLocator resolves lazily and queries nothing here, so this is synchronous and safe to call before the interior has mounted.

This replaced an earlier ContainerDriver base whose content option required the same scene to be named twice — once as a type argument, once in the driver option — plus a laundering constructor in every subclass (ADR-019). Named within rather than getContent because leaf drivers already own that name for reading a component's own text (a badge's content, a tooltip's content), and a base-class member cannot collide with them.

Interior children are constructed with an empty option, exactly as content parts always have been: an interior belongs to the scene, so it inherits no driver-specific configuration from its host. This differs deliberately from ComponentDriver.parts, whose children do inherit the host's option.

Type Parameters​
ContentT​

ContentT extends ScenePart

Parameters​
parts​

ContentT

The interior scene to resolve against this component's interior

Returns​

ScenePartDriver<ContentT>

One driver instance per named part

Inherited from​

ComponentDriver.within


overriddenParentLocator()​

static overriddenParentLocator(_option?): Optional<PartLocator>

Defined in: packages/core/dist/index.d.mts:1393

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.

option is the fully-merged constructor option the driver is about to receive (the same value passed to the driver's own constructor) — a purely static, per-invocation input, not instance state — so a driver whose portalling is conditional on how its scene configures it (e.g. an overlay that can render teleported OR in-tree, such as PrimeVue's appendTo="self") can branch on a flag there instead of always re-rooting. Ignore it to keep unconditional portal behavior.

Parameters​
_option?​

Partial<IComponentDriverOption<any>>

Returns​

Optional<PartLocator>

Inherited from​

ComponentDriver.overriddenParentLocator


overrideLocatorRelativePosition()​

static overrideLocatorRelativePosition(_option?): Optional<LocatorRelativePosition>

Defined in: packages/core/dist/index.d.mts:1406

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.

See ComponentDriver.overriddenParentLocator for what option carries and why accepting it does not reintroduce instance state.

Parameters​
_option?​

Partial<IComponentDriverOption<any>>

Returns​

Optional<LocatorRelativePosition>

Inherited from​

ComponentDriver.overrideLocatorRelativePosition

Protected members (18)

Accessors​

interiorLocator​

Get Signature​

get protected interiorLocator(): PartLocator

Defined in: packages/core/dist/index.d.mts:1442

The element ComponentDriver.within resolves an interior scene against — "inside this component", as this driver defines inside. Defaults to ComponentDriver.locator, which is already correct wherever a driver's own locator resolves to the surface holding caller content (Radix/Reka anchor at Dialog.Content, Fluent at DialogSurface).

Override it when the driver's locator resolves to a wrapper instead. MUI's Dialog, Drawer and Menu are the shipped cases: their locator is the portal-rendered Modal root, whose children are the backdrop, two focus-trap sentinels and a positioning container. Un-narrowed, an interior there reaches MUI's own chrome, and a 'Child'-relative interior part resolves to .MuiBackdrop-root rather than to anything the scene wrote — silently, since a locator that matches the wrong element raises nothing.

An override only helps where that chrome is ancestral to the caller's content. Where a design system interleaves chrome beside it — Fluent's focus-trap sentinels are siblings of the dialog body — no anchor separates the two, and the default stands (ADR-019's rollout-width audit).

An override MUST resolve to an element containing everything the caller supplied. For a slotted component that means the surface, never one slot: MUI spreads caller content across DialogTitle/DialogContent/DialogActions as siblings, so narrowing to .MuiDialogContent-root would drop the action buttons scenes click. Over-narrowing fails the same silent way it fixes — the part just stops resolving (ADR-019).

Returns​

PartLocator

Inherited from​

ComponentDriver.interiorLocator

Methods​

activate()​

protected activate(): Promise<void>

Defined in: packages/core/dist/index.d.mts:1522

Activate the component without relying on pointer geometry. See Interactor.activate.

Returns​

Promise<void>

Inherited from​

ComponentDriver.activate


awaitPostcondition()​

protected awaitPostcondition(postcondition, probeFn, option?): Promise<void>

Defined in: packages/core/dist/index.d.mts:1628

Hold an action open until its own postcondition holds, so the action does not resolve while the DOM it promised is still arriving.

Why actions, not reads or assertions. An interactor settles the framework's scheduler after a write (React act(), Vue nextTick(), Angular whenStable()) and then treats the DOM as final. A component that defers its own DOM work onto a host timer — a setTimeout to re-register a select's options, to restore a picker's section spans — lands after that settle, so the next single-shot read observes a transient state that is neither the old value nor the new one. Making reads retry cannot fix this (a read does not know what it is waiting for, and negative reads must stay fast); making every mutation drain a fixed extra macrotask is a sleep at framework scale. The action is the only layer that knows what it promised, so the action is where the wait belongs.

Probing uses waitUntil's escalating intervals, so a postcondition that already holds costs one probe and no delay.

Parameters​
postcondition​

string

Human-readable description of the awaited state, used verbatim in PostconditionNotMetError. Phrase it as the state that must arrive, not the action taken.

probeFn​

() => boolean | Promise<boolean>

Returns true once the postcondition holds. Keep it cheap — it runs repeatedly.

option?​
timeoutMs?​

number

Defaults to defaultWaitForOption.timeoutMs so every wait in the library shares one flake-tolerance source (#1057).

Returns​

Promise<void>

Throws​

If the postcondition never holds. Failing here is deliberate: an action that cannot keep its promise is a real defect, and reporting it at the action gives a far better diagnostic than the downstream assertion mismatch it would otherwise become.

Inherited from​

ComponentDriver.awaitPostcondition


contextMenu()​

protected contextMenu(): Promise<void>

Defined in: packages/core/dist/index.d.mts:1518

Dispatch a right-click / contextmenu event on the component. See Interactor.contextMenu.

Returns​

Promise<void>

Inherited from​

ComponentDriver.contextMenu


drag()​

protected drag(delta): Promise<void>

Defined in: packages/core/dist/index.d.mts:1560

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()​

protected dragTo(target): Promise<void>

Defined in: packages/core/dist/index.d.mts:1549

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()​

protected enforcePartExistence(partName): Promise<void>

Defined in: packages/core/dist/index.d.mts:1474

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()​

protected getBoundingRect(): Promise<BoundingRect>

Defined in: packages/core/dist/index.d.mts:1567

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()​

protected getMissingPartNames(partName): Promise<readonly never[]>

Defined in: packages/core/dist/index.d.mts:1480

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()​

protected innerHTML(): Promise<string>

Defined in: packages/core/dist/index.d.mts:1635

Get the inner HTML of the component

Returns​

Promise<string>

The inner HTML of the component

Inherited from​

ComponentDriver.innerHTML


mouseDown()​

protected mouseDown(option?): Promise<void>

Defined in: packages/core/dist/index.d.mts:1495

Parameters​
option?​

Partial<MouseDownOption>

Returns​

Promise<void>

Inherited from​

ComponentDriver.mouseDown


mouseEnter()​

protected mouseEnter(option?): Promise<void>

Defined in: packages/core/dist/index.d.mts:1499

Parameters​
option?​

Partial<MouseEnterOption>

Returns​

Promise<void>

Inherited from​

ComponentDriver.mouseEnter


mouseLeave()​

protected mouseLeave(option?): Promise<void>

Defined in: packages/core/dist/index.d.mts:1500

Parameters​
option?​

Partial<MouseLeaveOption>

Returns​

Promise<void>

Inherited from​

ComponentDriver.mouseLeave


mouseMove()​

protected mouseMove(option?): Promise<void>

Defined in: packages/core/dist/index.d.mts:1494

Parameters​
option?​

Partial<MouseMoveOption>

Returns​

Promise<void>

Inherited from​

ComponentDriver.mouseMove


mouseOut()​

protected mouseOut(option?): Promise<void>

Defined in: packages/core/dist/index.d.mts:1498

Parameters​
option?​

Partial<MouseOutOption>

Returns​

Promise<void>

Inherited from​

ComponentDriver.mouseOut


mouseOver()​

protected mouseOver(option?): Promise<void>

Defined in: packages/core/dist/index.d.mts:1497

Parameters​
option?​

Partial<HoverOption>

Returns​

Promise<void>

Inherited from​

ComponentDriver.mouseOver


mouseUp()​

protected mouseUp(option?): Promise<void>

Defined in: packages/core/dist/index.d.mts:1496

Parameters​
option?​

Partial<MouseUpOption>

Returns​

Promise<void>

Inherited from​

ComponentDriver.mouseUp


scrollBy()​

protected scrollBy(delta): Promise<void>

Defined in: packages/core/dist/index.d.mts:1538

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