Class: DrawerDriver<ContentT>
Defined in: packages/component-driver-mui-v7/src/components/DrawerDriver.ts:45
Driver for the Material UI v7 Drawer (and SwipeableDrawer) component.
A temporary Drawer is a portal-rendered Modal: its root role="presentation"
holds a .MuiBackdrop-root and a .MuiDrawer-paper panel whose class encodes
the anchor. Open/close/backdrop behavior is inherited from OverlayDriver;
this driver adds the anchor read and the portal re-rooting.
See​
https://mui.com/material-ui/react-drawer/
Extends​
OverlayDriver<ContentT, typeofdrawerParts>
Type Parameters​
ContentT​
ContentT extends ScenePart
Constructors​
Constructor​
new DrawerDriver<
ContentT>(locator,interactor,option?):DrawerDriver<ContentT>
Defined in: packages/component-driver-mui-v7/src/components/DrawerDriver.ts:46
Parameters​
locator​
PartLocator
interactor​
Interactor
option?​
Partial<IContainerDriverOption<{ }, { }>>
Returns​
DrawerDriver<ContentT>
Overrides​
Properties​
commutableOption​
readonlycommutableOption:IComponentDriverOption<{paper: {driver: typeofHTMLElementDriver;locator:CssLocator; }; }>
Defined in: packages/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​
OverlayDriver.commutableOption
interactor​
readonlyinteractor:Interactor
Defined in: packages/core/dist/index.d.mts:990
Inherited from​
Accessors​
content​
Get Signature​
get content():
ScenePartDriver<ContentT>
Defined in: packages/core/dist/index.d.mts:805
Returns​
ScenePartDriver<ContentT>
Inherited from​
driverName​
Get Signature​
get driverName():
string
Defined in: packages/component-driver-mui-v7/src/components/DrawerDriver.ts:83
Returns​
string
Overrides​
locator​
Get Signature​
get locator():
PartLocator
Defined in: packages/core/dist/index.d.mts:1044
Return the locator of the component
Returns​
PartLocator
Inherited from​
parts​
Get Signature​
get parts():
ScenePartDriver<T>
Defined in: packages/core/dist/index.d.mts:1040
Return driver instance of all the named parts
Returns​
ScenePartDriver<T>
Inherited from​
Methods​
activate()​
activate():
Promise<void>
Defined in: packages/core/dist/index.d.mts:1091
Activate the component without relying on pointer geometry. See Interactor.activate.
Returns​
Promise<void>
Inherited from​
click()​
click(
option?):Promise<void>
Defined in: packages/core/dist/index.d.mts:1068
Parameters​
option?​
Partial<ClickOption>
Returns​
Promise<void>
Inherited from​
closeByBackdrop()​
closeByBackdrop(
timeoutMs?):Promise<boolean>
Defined in: packages/component-driver-mui-v7/src/components/OverlayDriver.ts:82
Dismiss by clicking the backdrop, then wait for the close transition. Whether it actually closes depends on the consumer honoring the backdrop dismissal; the returned boolean reflects the observed close, not merely the click.
Parameters​
timeoutMs?​
number = defaultTransitionDuration
Returns​
Promise<boolean>
Inherited from​
closeByEscape()​
closeByEscape(
timeoutMs?):Promise<boolean>
Defined in: packages/component-driver-mui-v7/src/components/OverlayDriver.ts:106
Dismiss by pressing Escape on the overlay surface, then wait for the close
transition. MUI's Modal handles a keydown of Escape (reason
"escapeKeyDown") at the portal root; the event bubbles there from the
focused surface — a code path distinct from closeByBackdrop and
unreachable by any click, since a click never produces a key event. The
surface is the focus-holding element while the overlay is open, mirroring how
DialogDriver presses Escape on its container. Whether it actually
closes depends on the consumer honoring the dismissal (and
disableEscapeKeyDown); the returned boolean reflects the observed close, not
merely the key press.
Parameters​
timeoutMs?​
number = defaultTransitionDuration
Returns​
Promise<boolean>
Inherited from​
contextMenu()​
contextMenu():
Promise<void>
Defined in: packages/core/dist/index.d.mts:1087
Dispatch a right-click / contextmenu event on the component. See Interactor.contextMenu.
Returns​
Promise<void>
Inherited from​
drag()​
drag(
delta):Promise<void>
Defined in: packages/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​
dragTo()​
dragTo(
target):Promise<void>
Defined in: packages/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​
enforcePartExistence()​
protectedenforcePartExistence(partName):Promise<void>
Defined in: packages/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​
"paper" | readonly "paper"[]
Single or array of the names of the parts to be enforced
Returns​
Promise<void>
Inherited from​
OverlayDriver.enforcePartExistence
exists()​
exists():
Promise<boolean>
Defined in: packages/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​
focus()​
focus(
option?):Promise<void>
Defined in: packages/core/dist/index.d.mts:1077
Parameters​
option?​
Partial<FocusOption>
Returns​
Promise<void>
Inherited from​
getAnchor()​
getAnchor():
Promise<Optional<DrawerAnchor>>
Defined in: packages/component-driver-mui-v7/src/components/DrawerDriver.ts:70
The side the drawer is anchored to, read from the paper's anchor class, or
undefined when the drawer is closed/unmounted.
Returns​
Promise<Optional<DrawerAnchor>>
getAttribute()​
getAttribute(
attributeName):Promise<Optional<string>>
Defined in: packages/core/dist/index.d.mts:1062
Parameters​
attributeName​
string
Returns​
Promise<Optional<string>>
Inherited from​
getBackdropLocator()​
protectedgetBackdropLocator():PartLocator
Defined in: packages/component-driver-mui-v7/src/components/OverlayDriver.ts:30
Locator of the dismissible backdrop. Defaults to MUI's .MuiBackdrop-root.
Returns​
PartLocator
Inherited from​
OverlayDriver.getBackdropLocator
getBoundingRect()​
getBoundingRect():
Promise<BoundingRect>
Defined in: packages/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​
getMissingPartNames()​
protectedgetMissingPartNames(partName):Promise<readonly"paper"[]>
Defined in: packages/core/dist/index.d.mts:1056
Get the names of parts not in the DOM
Parameters​
partName​
"paper" | readonly "paper"[]
Single or array of the names of the parts to be examined
Returns​
Promise<readonly "paper"[]>
Inherited from​
OverlayDriver.getMissingPartNames
getSurfaceLocator()​
protectedgetSurfaceLocator():PartLocator
Defined in: packages/component-driver-mui-v7/src/components/DrawerDriver.ts:62
Locator of the surface whose visibility reflects the open state (e.g. the drawer/dialog paper).
Returns​
PartLocator
Overrides​
OverlayDriver.getSurfaceLocator
getText()​
getText():
Promise<Optional<string>>
Defined in: packages/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​
hover()​
hover(
option?):Promise<void>
Defined in: packages/core/dist/index.d.mts:1069
Parameters​
option?​
Partial<HoverOption>
Returns​
Promise<void>
Inherited from​
innerHTML()​
innerHTML():
Promise<string>
Defined in: packages/core/dist/index.d.mts:1168
Get the inner HTML of the component
Returns​
Promise<string>
The inner HTML of the component
Inherited from​
isOpen()​
isOpen():
Promise<boolean>
Defined in: packages/component-driver-mui-v7/src/components/OverlayDriver.ts:38
Whether the overlay is mounted and its surface is visible. Because of open/close
transitions, prefer waitForOpen()/waitForClose() immediately after an action.
Returns​
Promise<boolean>
Inherited from​
isVisible()​
isVisible():
Promise<boolean>
Defined in: packages/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​
mouseDown()​
mouseDown(
option?):Promise<void>
Defined in: packages/core/dist/index.d.mts:1071
Parameters​
option?​
Partial<MouseDownOption>
Returns​
Promise<void>
Inherited from​
mouseEnter()​
mouseEnter(
option?):Promise<void>
Defined in: packages/core/dist/index.d.mts:1075
Parameters​
option?​
Partial<MouseEnterOption>
Returns​
Promise<void>
Inherited from​
mouseLeave()​
mouseLeave(
option?):Promise<void>
Defined in: packages/core/dist/index.d.mts:1076
Parameters​
option?​
Partial<MouseLeaveOption>
Returns​
Promise<void>
Inherited from​
mouseMove()​
mouseMove(
option?):Promise<void>
Defined in: packages/core/dist/index.d.mts:1070
Parameters​
option?​
Partial<MouseMoveOption>
Returns​
Promise<void>
Inherited from​
mouseOut()​
mouseOut(
option?):Promise<void>
Defined in: packages/core/dist/index.d.mts:1074
Parameters​
option?​
Partial<MouseOutOption>
Returns​
Promise<void>
Inherited from​
mouseOver()​
mouseOver(
option?):Promise<void>
Defined in: packages/core/dist/index.d.mts:1073
Parameters​
option?​
Partial<HoverOption>
Returns​
Promise<void>
Inherited from​
mouseUp()​
mouseUp(
option?):Promise<void>
Defined in: packages/core/dist/index.d.mts:1072
Parameters​
option?​
Partial<MouseUpOption>
Returns​
Promise<void>
Inherited from​
pressKey()​
pressKey(
key,option?):Promise<void>
Defined in: packages/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​
runtimeCssSelector()​
runtimeCssSelector():
Promise<string>
Defined in: packages/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​
OverlayDriver.runtimeCssSelector
scrollBy()​
scrollBy(
delta):Promise<void>
Defined in: packages/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​
scrollIntoView()​
scrollIntoView():
Promise<void>
Defined in: packages/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​
waitForClose()​
waitForClose(
timeoutMs?):Promise<boolean>
Defined in: packages/component-driver-mui-v7/src/components/OverlayDriver.ts:62
Wait until the overlay is closed.
Parameters​
timeoutMs?​
number = defaultTransitionDuration
Returns​
Promise<boolean>
true once closed within the timeout.
Inherited from​
waitForOpen()​
waitForOpen(
timeoutMs?):Promise<boolean>
Defined in: packages/component-driver-mui-v7/src/components/OverlayDriver.ts:49
Wait until the overlay is open.
Parameters​
timeoutMs?​
number = defaultTransitionDuration
Returns​
Promise<boolean>
true once open within the timeout.
Inherited from​
waitUntil()​
waitUntil<
T>(option):Promise<T>
Defined in: packages/core/dist/index.d.mts:1163
Type Parameters​
T​
T
Parameters​
option​
WaitUntilOption<T>
Returns​
Promise<T>
Inherited from​
waitUntilComponentState()​
waitUntilComponentState(
option?):Promise<void>
Defined in: packages/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​
OverlayDriver.waitUntilComponentState
waitUntilVisible()​
waitUntilVisible(
timeoutMs?):Promise<void>
Defined in: packages/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​
OverlayDriver.waitUntilVisible
overriddenParentLocator()​
staticoverriddenParentLocator():Optional<PartLocator>
Defined in: packages/component-driver-mui-v7/src/components/DrawerDriver.ts:54
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>
Overrides​
OverlayDriver.overriddenParentLocator
overrideLocatorRelativePosition()​
staticoverrideLocatorRelativePosition():Optional<LocatorRelativePosition>
Defined in: packages/component-driver-mui-v7/src/components/DrawerDriver.ts:58
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>