Skip to main content

Class: DateTimeInputDriver

Defined in: component-driver-astryx/src/components/DateTimeInputDriver.ts:26

Driver for the Astryx DateTimeInput (@astryxdesign/core/DateTimeInput).

DateTimeInput pairs a date field — an <input role="combobox"> with a calendar popover, identical to DateInputDriver, whose behaviour this driver inherits — with a separate time <input>. The root <div> self-emits data-testid. The date field's accessors are reused as getDateValue/ setDate; the time field adds getTimeValue/setTime.

The time input's accessible name is no longer a fixed aria-label="Time" as of Astryx 0.1.3 — it defaults to "{label} time" (and is overridable via a timeLabel prop), so it's no longer a stable match value. Since the widget only ever renders these two <input>s, the time field is instead reached as whichever one is NOT the date combobox.

disabledMessage renders a single tooltip for the whole control, but Astryx wires its aria-describedby link onto the date field only — the time <input> carries no aria-describedby at all. getDisabledMessage, inherited from DateInputDriver, already resolves through the date field and needs no override here.

Extends​

Constructors​

Constructor​

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

Defined in: core/dist/index.d.mts:1200

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​

DateTimeInputDriver

Inherited from​

DateInputDriver.constructor

Accessors​

driverName​

Get Signature​

get driverName(): string

Defined in: component-driver-astryx/src/components/DateTimeInputDriver.ts:51

Returns​

string

Overrides​

DateInputDriver.driverName

Methods​

getDateValue()​

getDateValue(): Promise<Optional<string>>

Defined in: component-driver-astryx/src/components/DateTimeInputDriver.ts:32

The date field's displayed value (formatted date), or undefined when empty.

Returns​

Promise<Optional<string>>


getTimeValue()​

getTimeValue(): Promise<Optional<string>>

Defined in: component-driver-astryx/src/components/DateTimeInputDriver.ts:42

The time field's displayed value (e.g. "10:30 AM"), or undefined when empty.

Returns​

Promise<Optional<string>>


setDate()​

setDate(text): Promise<void>

Defined in: component-driver-astryx/src/components/DateTimeInputDriver.ts:37

Type into the date field (replacing any existing text).

Parameters​

text​

string

Returns​

Promise<void>


setTime()​

setTime(text): Promise<void>

Defined in: component-driver-astryx/src/components/DateTimeInputDriver.ts:47

Type into the time field (replacing any existing text).

Parameters​

text​

string

Returns​

Promise<void>

Inherited members (29)

Properties​

commutableOption​

readonly commutableOption: CommutableComponentDriverOption

Defined in: 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​

DateInputDriver.commutableOption


interactor​

readonly interactor: Interactor

Defined in: core/dist/index.d.mts:1172

Inherited from​

DateInputDriver.interactor

Accessors​

locator​

Get Signature​

get locator(): PartLocator

Defined in: core/dist/index.d.mts:1229

Return the locator of the component

Returns​

PartLocator

Inherited from​

DateInputDriver.locator


parts​

Get Signature​

get parts(): ScenePartDriver<T>

Defined in: core/dist/index.d.mts:1225

Return driver instance of all the named parts

Returns​

ScenePartDriver<T>

Inherited from​

DateInputDriver.parts

Methods​

clear()​

clear(): Promise<boolean>

Defined in: component-driver-astryx/src/components/DateInputDriver.ts:114

Clear the value via the clear control.

Returns​

Promise<boolean>

false when there is no clear control (hasClear is off or the input is empty).

Inherited from​

DateInputDriver.clear


click()​

click(option?): Promise<void>

Defined in: core/dist/index.d.mts:1253

Parameters​
option?​

Partial<ClickOption>

Returns​

Promise<void>

Inherited from​

DateInputDriver.click


close()​

close(): Promise<void>

Defined in: component-driver-astryx/src/components/DateInputDriver.ts:81

Close the calendar popover by clicking the toggle, if open.

Returns​

Promise<void>

Inherited from​

DateInputDriver.close


exists()​

exists(): Promise<boolean>

Defined in: 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​

DateInputDriver.exists


focus()​

focus(option?): Promise<void>

Defined in: core/dist/index.d.mts:1262

Parameters​
option?​

Partial<FocusOption>

Returns​

Promise<void>

Inherited from​

DateInputDriver.focus


getAttribute()​

getAttribute(attributeName): Promise<Optional<string>>

Defined in: core/dist/index.d.mts:1247

Parameters​
attributeName​

string

Returns​

Promise<Optional<string>>

Inherited from​

DateInputDriver.getAttribute


getDisabledMessage()​

getDisabledMessage(): Promise<Optional<string>>

Defined in: component-driver-astryx/src/components/DateInputDriver.ts:53

The disabledMessage tooltip text, resolved via the input's composed aria-describedby — the id list also carries the description/status-message ids, so this picks out whichever target has role="tooltip". undefined when the input has no disabled-reason tooltip.

Returns​

Promise<Optional<string>>

Inherited from​

DateInputDriver.getDisabledMessage


getText()​

getText(): Promise<Optional<string>>

Defined in: 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​

DateInputDriver.getText


getValue()​

getValue(): Promise<Optional<string>>

Defined in: component-driver-astryx/src/components/DateInputDriver.ts:28

The displayed value text (formatted date), or undefined when empty.

Returns​

Promise<Optional<string>>

Inherited from​

DateInputDriver.getValue


hover()​

hover(option?): Promise<void>

Defined in: core/dist/index.d.mts:1254

Parameters​
option?​

Partial<HoverOption>

Returns​

Promise<void>

Inherited from​

DateInputDriver.hover


isExpanded()​

isExpanded(): Promise<boolean>

Defined in: component-driver-astryx/src/components/DateInputDriver.ts:38

Whether the calendar popover is open — read from the input's aria-expanded.

Returns​

Promise<boolean>

Inherited from​

DateInputDriver.isExpanded


isInvalid()​

isInvalid(): Promise<boolean>

Defined in: component-driver-astryx/src/components/DateInputDriver.ts:43

Whether the input is invalid (aria-invalid="true").

Returns​

Promise<boolean>

Inherited from​

DateInputDriver.isInvalid


isVisible()​

isVisible(): Promise<boolean>

Defined in: 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​

DateInputDriver.isVisible


open()​

open(): Promise<void>

Defined in: component-driver-astryx/src/components/DateInputDriver.ts:63

Open the calendar popover by clicking the toggle, if not already open, then wait for aria-expanded to flip — click() resolves before React mounts the popover (and sets aria-controls), so a pickDate that raced ahead would miss the day cells.

Returns​

Promise<void>

Inherited from​

DateInputDriver.open


pickDate()​

pickDate(isoDate): Promise<boolean>

Defined in: component-driver-astryx/src/components/DateInputDriver.ts:100

Open the calendar and click the day with the given ISO date (YYYY-MM-DD).

Parameters​
isoDate​

string

Returns​

Promise<boolean>

false when that day is not rendered in the open popover.

Inherited from​

DateInputDriver.pickDate


pressKey()​

pressKey(key, option?): Promise<void>

Defined in: 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​

DateInputDriver.pressKey


runtimeCssSelector()​

runtimeCssSelector(): Promise<string>

Defined in: 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​

DateInputDriver.runtimeCssSelector


scrollIntoView()​

scrollIntoView(): Promise<void>

Defined in: 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​

DateInputDriver.scrollIntoView


setValue()​

setValue(text): Promise<void>

Defined in: component-driver-astryx/src/components/DateInputDriver.ts:33

Type a value into the input (replacing any existing text).

Parameters​
text​

string

Returns​

Promise<void>

Inherited from​

DateInputDriver.setValue


typeText()​

typeText(text): Promise<void>

Defined in: 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​

DateInputDriver.typeText


waitUntil()​

waitUntil<T>(option): Promise<T>

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

Type Parameters​
T​

T

Parameters​
option​

WaitUntilOption<T>

Returns​

Promise<T>

Inherited from​

DateInputDriver.waitUntil


waitUntilComponentState()​

waitUntilComponentState(option?): Promise<void>

Defined in: 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​

DateInputDriver.waitUntilComponentState


waitUntilVisible()​

waitUntilVisible(timeoutMs?): Promise<void>

Defined in: 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​

DateInputDriver.waitUntilVisible


overriddenParentLocator()​

static overriddenParentLocator(): Optional<PartLocator>

Defined in: 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​

DateInputDriver.overriddenParentLocator


overrideLocatorRelativePosition()​

static overrideLocatorRelativePosition(): Optional<LocatorRelativePosition>

Defined in: 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​

DateInputDriver.overrideLocatorRelativePosition

Protected members (18)

Accessors​

input​

Get Signature​

get protected input(): PartLocator

Defined in: component-driver-astryx/src/components/DateInputDriver.ts:19

Returns​

PartLocator

Inherited from​

DateInputDriver.input

Methods​

activate()​

protected activate(): Promise<void>

Defined in: core/dist/index.d.mts:1282

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

Returns​

Promise<void>

Inherited from​

DateInputDriver.activate


contextMenu()​

protected contextMenu(): Promise<void>

Defined in: core/dist/index.d.mts:1278

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

Returns​

Promise<void>

Inherited from​

DateInputDriver.contextMenu


drag()​

protected drag(delta): Promise<void>

Defined in: 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​

DateInputDriver.drag


dragTo()​

protected dragTo(target): Promise<void>

Defined in: 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​

DateInputDriver.dragTo


enforcePartExistence()​

protected enforcePartExistence(partName): Promise<void>

Defined in: 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​

DateInputDriver.enforcePartExistence


getBoundingRect()​

protected getBoundingRect(): Promise<BoundingRect>

Defined in: 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​

DateInputDriver.getBoundingRect


getMissingPartNames()​

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

Defined in: 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​

DateInputDriver.getMissingPartNames


innerHTML()​

protected innerHTML(): Promise<string>

Defined in: core/dist/index.d.mts:1361

Get the inner HTML of the component

Returns​

Promise<string>

The inner HTML of the component

Inherited from​

DateInputDriver.innerHTML


mouseDown()​

protected mouseDown(option?): Promise<void>

Defined in: core/dist/index.d.mts:1256

Parameters​
option?​

Partial<MouseDownOption>

Returns​

Promise<void>

Inherited from​

DateInputDriver.mouseDown


mouseEnter()​

protected mouseEnter(option?): Promise<void>

Defined in: core/dist/index.d.mts:1260

Parameters​
option?​

Partial<MouseEnterOption>

Returns​

Promise<void>

Inherited from​

DateInputDriver.mouseEnter


mouseLeave()​

protected mouseLeave(option?): Promise<void>

Defined in: core/dist/index.d.mts:1261

Parameters​
option?​

Partial<MouseLeaveOption>

Returns​

Promise<void>

Inherited from​

DateInputDriver.mouseLeave


mouseMove()​

protected mouseMove(option?): Promise<void>

Defined in: core/dist/index.d.mts:1255

Parameters​
option?​

Partial<MouseMoveOption>

Returns​

Promise<void>

Inherited from​

DateInputDriver.mouseMove


mouseOut()​

protected mouseOut(option?): Promise<void>

Defined in: core/dist/index.d.mts:1259

Parameters​
option?​

Partial<MouseOutOption>

Returns​

Promise<void>

Inherited from​

DateInputDriver.mouseOut


mouseOver()​

protected mouseOver(option?): Promise<void>

Defined in: core/dist/index.d.mts:1258

Parameters​
option?​

Partial<HoverOption>

Returns​

Promise<void>

Inherited from​

DateInputDriver.mouseOver


mouseUp()​

protected mouseUp(option?): Promise<void>

Defined in: core/dist/index.d.mts:1257

Parameters​
option?​

Partial<MouseUpOption>

Returns​

Promise<void>

Inherited from​

DateInputDriver.mouseUp


popoverDay()​

protected popoverDay(isoDate): Promise<PartLocator | null>

Defined in: component-driver-astryx/src/components/DateInputDriver.ts:88

The open calendar popover's day cell for the given ISO date, scoped via aria-controls.

Parameters​
isoDate​

string

Returns​

Promise<PartLocator | null>

Inherited from​

DateInputDriver.popoverDay


scrollBy()​

protected scrollBy(delta): Promise<void>

Defined in: 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​

DateInputDriver.scrollBy