Class: ChatComposerDriver
Defined in: component-driver-astryx/src/components/ChatComposerDriver.ts:18
Driver for the Astryx ChatComposer (@astryxdesign/core/ChatComposer).
ChatComposer wraps a ChatComposerInput (the
contenteditable editor), a send/stop button, and an optional status message.
The scene anchors on the root (data-testid, data-density). The embedded
input carries no data-testid of its own, so it is reached by its
role="textbox"][contenteditable]; the send button by its stable
astryx-chat-send-button class (Astryx does not forward a testid there either).
Reads are jsdom-faithful: canSend (the button's disabled), isStopShown
(the button flips aria-label SendβStop), and the status text (role="alert").
Actual send-on-Enter and the contenteditable's append-only typing constraint are
inherited from ChatComposerInput; Enter-to-submit is E2E-only.
Extendsβ
ComponentDriver<{ }>
Constructorsβ
Constructorβ
new ChatComposerDriver(
locator,interactor,option?):ChatComposerDriver
Defined in: core/dist/index.d.mts:1015
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. See the type-level fixture in
@atomic-testing/component-driver-html.
Returnsβ
ChatComposerDriver
Inherited fromβ
ComponentDriver<{}>.constructor
Propertiesβ
commutableOptionβ
readonlycommutableOption:IComponentDriverOption<{ }>
Defined in: core/dist/index.d.mts:999
Option passed to the constructor includes both universal options which can be shared across all component driver tree, and component specific options which are only applicable to the component.
Commutable option is the option that can be shared across all component driver tree.
Inherited fromβ
ComponentDriver.commutableOption
interactorβ
readonlyinteractor:Interactor
Defined in: core/dist/index.d.mts:990
Inherited fromβ
ComponentDriver.interactor
Accessorsβ
driverNameβ
Get Signatureβ
get driverName():
string
Defined in: component-driver-astryx/src/components/ChatComposerDriver.ts:61
Returnsβ
string
Overridesβ
ComponentDriver.driverName
locatorβ
Get Signatureβ
get locator():
PartLocator
Defined in: core/dist/index.d.mts:1044
Return the locator of the component
Returnsβ
PartLocator
Inherited fromβ
ComponentDriver.locator
partsβ
Get Signatureβ
get parts():
ScenePartDriver<T>
Defined in: core/dist/index.d.mts:1040
Return driver instance of all the named parts
Returnsβ
ScenePartDriver<T>
Inherited fromβ
ComponentDriver.parts
Methodsβ
activate()β
activate():
Promise<void>
Defined in: core/dist/index.d.mts:1091
Activate the component without relying on pointer geometry. See Interactor.activate.
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.activate
appendValue()β
appendValue(
text):Promise<void>
Defined in: component-driver-astryx/src/components/ChatComposerDriver.ts:33
Append text to the embedded editor (append-only β see ChatComposerInput docs).
Parametersβ
textβ
string
Returnsβ
Promise<void>
canSend()β
canSend():
Promise<boolean>
Defined in: component-driver-astryx/src/components/ChatComposerDriver.ts:43
Whether the send button is enabled (it is disabled while the editor is empty).
Returnsβ
Promise<boolean>
click()β
click(
option?):Promise<void>
Defined in: core/dist/index.d.mts:1068
Parametersβ
option?β
Partial<ClickOption>
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.click
contextMenu()β
contextMenu():
Promise<void>
Defined in: core/dist/index.d.mts:1087
Dispatch a right-click / contextmenu event on the component. See Interactor.contextMenu.
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.contextMenu
drag()β
drag(
delta):Promise<void>
Defined in: core/dist/index.d.mts:1129
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()β
dragTo(
target):Promise<void>
Defined in: core/dist/index.d.mts:1118
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: core/dist/index.d.mts:1050
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
exists()β
exists():
Promise<boolean>
Defined in: core/dist/index.d.mts:1067
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: core/dist/index.d.mts:1077
Parametersβ
option?β
Partial<FocusOption>
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.focus
getAttribute()β
getAttribute(
attributeName):Promise<Optional<string>>
Defined in: core/dist/index.d.mts:1062
Parametersβ
attributeNameβ
string
Returnsβ
Promise<Optional<string>>
Inherited fromβ
ComponentDriver.getAttribute
getBoundingRect()β
getBoundingRect():
Promise<BoundingRect>
Defined in: core/dist/index.d.mts:1136
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
getDensity()β
getDensity():
Promise<Optional<string>>
Defined in: component-driver-astryx/src/components/ChatComposerDriver.ts:28
The composer density (data-density).
Returnsβ
Promise<Optional<string>>
getMissingPartNames()β
protectedgetMissingPartNames(partName):Promise<readonlynever[]>
Defined in: core/dist/index.d.mts:1056
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
getStatusMessage()β
getStatusMessage():
Promise<Optional<string>>
Defined in: component-driver-astryx/src/components/ChatComposerDriver.ts:53
The status message text (role="alert"), or undefined when no status is set.
Returnsβ
Promise<Optional<string>>
getText()β
getText():
Promise<Optional<string>>
Defined in: core/dist/index.d.mts:1061
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: core/dist/index.d.mts:1069
Parametersβ
option?β
Partial<HoverOption>
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.hover
innerHTML()β
innerHTML():
Promise<string>
Defined in: core/dist/index.d.mts:1168
Get the inner HTML of the component
Returnsβ
Promise<string>
The inner HTML of the component
Inherited fromβ
ComponentDriver.innerHTML
isStopShown()β
isStopShown():
Promise<boolean>
Defined in: component-driver-astryx/src/components/ChatComposerDriver.ts:48
Whether the button is in its "Stop" state (aria-label="Stop") rather than "Send".
Returnsβ
Promise<boolean>
isVisible()β
isVisible():
Promise<boolean>
Defined in: core/dist/index.d.mts:1145
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
mouseDown()β
mouseDown(
option?):Promise<void>
Defined in: core/dist/index.d.mts:1071
Parametersβ
option?β
Partial<MouseDownOption>
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.mouseDown
mouseEnter()β
mouseEnter(
option?):Promise<void>
Defined in: core/dist/index.d.mts:1075
Parametersβ
option?β
Partial<MouseEnterOption>
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.mouseEnter
mouseLeave()β
mouseLeave(
option?):Promise<void>
Defined in: core/dist/index.d.mts:1076
Parametersβ
option?β
Partial<MouseLeaveOption>
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.mouseLeave
mouseMove()β
mouseMove(
option?):Promise<void>
Defined in: core/dist/index.d.mts:1070
Parametersβ
option?β
Partial<MouseMoveOption>
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.mouseMove
mouseOut()β
mouseOut(
option?):Promise<void>
Defined in: core/dist/index.d.mts:1074
Parametersβ
option?β
Partial<MouseOutOption>
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.mouseOut
mouseOver()β
mouseOver(
option?):Promise<void>
Defined in: core/dist/index.d.mts:1073
Parametersβ
option?β
Partial<HoverOption>
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.mouseOver
mouseUp()β
mouseUp(
option?):Promise<void>
Defined in: core/dist/index.d.mts:1072
Parametersβ
option?β
Partial<MouseUpOption>
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.mouseUp
pressKey()β
pressKey(
key,option?):Promise<void>
Defined in: core/dist/index.d.mts:1083
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: core/dist/index.d.mts:1174
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
scrollBy()β
scrollBy(
delta):Promise<void>
Defined in: core/dist/index.d.mts:1107
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
scrollIntoView()β
scrollIntoView():
Promise<void>
Defined in: core/dist/index.d.mts:1098
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
submit()β
submit():
Promise<void>
Defined in: component-driver-astryx/src/components/ChatComposerDriver.ts:38
Click the send/stop button.
Returnsβ
Promise<void>
waitUntil()β
waitUntil<
T>(option):Promise<T>
Defined in: core/dist/index.d.mts:1163
Type Parametersβ
Tβ
T
Parametersβ
optionβ
WaitUntilOption<T>
Returnsβ
Promise<T>
Inherited fromβ
ComponentDriver.waitUntil
waitUntilComponentState()β
waitUntilComponentState(
option?):Promise<void>
Defined in: core/dist/index.d.mts:1162
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: core/dist/index.d.mts:1150
Wait until the component is attached and becomes visible to the DOM.
Parametersβ
timeoutMs?β
number
The number of milliseconds to wait before timing out
Returnsβ
Promise<void>
Inherited fromβ
ComponentDriver.waitUntilVisible
overriddenParentLocator()β
staticoverriddenParentLocator():Optional<PartLocator>
Defined in: core/dist/index.d.mts:1026
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: core/dist/index.d.mts:1036
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