@atomic-testing/component-driver-mui-v9 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +76 -0
  3. package/dist/index.cjs +2439 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.d.cts +1391 -0
  6. package/dist/index.d.mts +1391 -0
  7. package/dist/index.mjs +2386 -0
  8. package/dist/index.mjs.map +1 -0
  9. package/package.json +48 -0
  10. package/src/components/AccordionDriver.ts +109 -0
  11. package/src/components/AlertDriver.ts +74 -0
  12. package/src/components/AutoCompleteDriver.ts +151 -0
  13. package/src/components/AvatarDriver.ts +51 -0
  14. package/src/components/AvatarGroupDriver.ts +79 -0
  15. package/src/components/BadgeDriver.ts +43 -0
  16. package/src/components/BottomNavigationActionDriver.ts +23 -0
  17. package/src/components/BottomNavigationDriver.ts +138 -0
  18. package/src/components/ButtonDriver.ts +16 -0
  19. package/src/components/CheckboxDriver.ts +98 -0
  20. package/src/components/ChipDriver.ts +53 -0
  21. package/src/components/DialogDriver.ts +122 -0
  22. package/src/components/DrawerDriver.ts +90 -0
  23. package/src/components/FabDriver.ts +11 -0
  24. package/src/components/InputDriver.ts +112 -0
  25. package/src/components/ListDriver.ts +42 -0
  26. package/src/components/ListItemDriver.ts +34 -0
  27. package/src/components/MenuDriver.ts +65 -0
  28. package/src/components/MenuItemDriver.ts +15 -0
  29. package/src/components/OverlayDriver.ts +98 -0
  30. package/src/components/PaginationDriver.ts +117 -0
  31. package/src/components/ProgressDriver.ts +78 -0
  32. package/src/components/RadioDriver.ts +63 -0
  33. package/src/components/RadioGroupDriver.ts +129 -0
  34. package/src/components/RatingDriver.ts +121 -0
  35. package/src/components/SelectDriver.ts +223 -0
  36. package/src/components/SliderDriver.ts +109 -0
  37. package/src/components/SnackbarDriver.ts +68 -0
  38. package/src/components/SpeedDialDriver.ts +83 -0
  39. package/src/components/StepperDriver.ts +109 -0
  40. package/src/components/SwitchDriver.ts +62 -0
  41. package/src/components/TabDriver.ts +39 -0
  42. package/src/components/TableCellDriver.ts +14 -0
  43. package/src/components/TableDriver.ts +148 -0
  44. package/src/components/TablePaginationDriver.ts +110 -0
  45. package/src/components/TableRowDriver.ts +79 -0
  46. package/src/components/TabsDriver.ts +133 -0
  47. package/src/components/TextFieldDriver.ts +155 -0
  48. package/src/components/ToggleButtonDriver.ts +21 -0
  49. package/src/components/ToggleButtonGroupDriver.ts +75 -0
  50. package/src/components/TooltipDriver.ts +82 -0
  51. package/src/errors/MenuItemDisabledError.ts +17 -0
  52. package/src/errors/MenuItemNotFoundError.ts +17 -0
  53. package/src/index.ts +52 -0
@@ -0,0 +1,1391 @@
1
+ import { HTMLButtonDriver, HTMLCheckboxDriver, HTMLElementDriver, HTMLRadioButtonGroupDriver, HTMLSelectDriver, HTMLTextInputDriver } from "@atomic-testing/component-driver-html";
2
+ import { ComponentDriver, ComponentDriverCtor, ContainerDriver, ErrorBase, IComponentDriverOption, IContainerDriverOption, IFormFieldDriver, IInputDriver, IToggleDriver, Interactor, ListComponentDriver, ListComponentDriverSpecificOption, LocatorRelativePosition, Nullable, Optional, PartLocator, ScenePart } from "@atomic-testing/core";
3
+
4
+ //#region src/components/AccordionDriver.d.ts
5
+ declare const parts$13: {
6
+ /**
7
+ * The clickable area to expand/collapse the accordion.
8
+ */
9
+ disclosure: {
10
+ locator: import("@atomic-testing/core").CssLocator;
11
+ driver: typeof HTMLElementDriver;
12
+ };
13
+ summary: {
14
+ locator: import("@atomic-testing/core").CssLocator;
15
+ driver: typeof HTMLElementDriver;
16
+ };
17
+ content: {
18
+ locator: import("@atomic-testing/core").CssLocator;
19
+ driver: typeof HTMLElementDriver;
20
+ };
21
+ };
22
+ /**
23
+ * Driver for Material UI v9 Accordion component.
24
+ * @see https://mui.com/material-ui/react-accordion/
25
+ */
26
+ declare class AccordionDriver extends ComponentDriver<typeof parts$13> {
27
+ constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>);
28
+ /**
29
+ * Get the title/summary of the accordion.
30
+ * @returns The title/summary of the accordion.
31
+ */
32
+ getSummary(): Promise<string | null>;
33
+ /**
34
+ * Whether the accordion is expanded.
35
+ * @returns True if the accordion is expanded, false if collapsed.
36
+ */
37
+ isExpanded(): Promise<boolean>;
38
+ /**
39
+ * Whether the accordion is disabled.
40
+ * @returns True if the accordion is disabled, false if enabled.
41
+ */
42
+ isDisabled(): Promise<boolean>;
43
+ click(): Promise<void>;
44
+ /**
45
+ * Expand the accordion.
46
+ */
47
+ expand(): Promise<void>;
48
+ /**
49
+ * Collapse the accordion.
50
+ */
51
+ collapse(): Promise<void>;
52
+ get driverName(): string;
53
+ }
54
+ //#endregion
55
+ //#region src/components/AlertDriver.d.ts
56
+ declare const parts$12: {
57
+ title: {
58
+ locator: import("@atomic-testing/core").CssLocator;
59
+ driver: typeof HTMLElementDriver;
60
+ };
61
+ message: {
62
+ locator: import("@atomic-testing/core").CssLocator;
63
+ driver: typeof HTMLElementDriver;
64
+ };
65
+ };
66
+ /**
67
+ * Driver for Material UI v9 Alert component.
68
+ * @see https://mui.com/material-ui/react-alert/
69
+ */
70
+ declare class AlertDriver<ContentT extends ScenePart = {}> extends ContainerDriver<ContentT, typeof parts$12> {
71
+ constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IContainerDriverOption>);
72
+ getTitle(): Promise<string | null>;
73
+ getMessage(): Promise<string | null>;
74
+ getSeverity(): Promise<string | null>;
75
+ get driverName(): string;
76
+ }
77
+ //#endregion
78
+ //#region src/components/AvatarDriver.d.ts
79
+ /**
80
+ * Driver for the Material UI v9 Avatar component.
81
+ *
82
+ * An Avatar renders a `.MuiAvatar-root`; with a `src` it contains an
83
+ * `img.MuiAvatar-img`, otherwise it shows letter initials (or an icon). The
84
+ * driver reads the image's `alt`, the presence of the image, and the letter
85
+ * initials accordingly.
86
+ * @see https://mui.com/material-ui/react-avatar/
87
+ */
88
+ declare class AvatarDriver extends ComponentDriver {
89
+ private get imageLocator();
90
+ /**
91
+ * Whether the avatar renders an image (vs letter/icon fallback).
92
+ */
93
+ hasImage(): Promise<boolean>;
94
+ /**
95
+ * The image's alt text, or `undefined` when the avatar has no image.
96
+ */
97
+ getAltText(): Promise<Optional<string>>;
98
+ /**
99
+ * The letter initials of a text avatar, or `undefined` for an image or icon
100
+ * avatar (which render no text).
101
+ */
102
+ getInitials(): Promise<Optional<string>>;
103
+ get driverName(): string;
104
+ }
105
+ //#endregion
106
+ //#region src/components/AvatarGroupDriver.d.ts
107
+ declare const defaultAvatarGroupDriverOption: ListComponentDriverSpecificOption<AvatarDriver>;
108
+ type AvatarGroupDriverOption<ItemT extends AvatarDriver> = ListComponentDriverSpecificOption<ItemT> & Partial<IComponentDriverOption<any>>;
109
+ /**
110
+ * Driver for the Material UI v9 AvatarGroup component.
111
+ *
112
+ * AvatarGroup renders up to `max` avatars plus a surplus "+N" avatar when there
113
+ * are more. This is a {@link ListComponentDriver} over the rendered avatars
114
+ * (surplus included via `getItems`), with helpers to count the real avatars and
115
+ * read the surplus label.
116
+ * @see https://mui.com/material-ui/react-avatar/#grouped
117
+ */
118
+ declare class AvatarGroupDriver<ItemT extends AvatarDriver = AvatarDriver> extends ListComponentDriver<ItemT> {
119
+ constructor(locator: PartLocator, interactor: Interactor, option?: Partial<AvatarGroupDriverOption<ItemT>>);
120
+ /**
121
+ * The number of real avatars shown, excluding the surplus "+N" indicator.
122
+ */
123
+ getVisibleCount(): Promise<number>;
124
+ /**
125
+ * The surplus indicator's label (e.g. "+3"), or `undefined` when every avatar
126
+ * fits within `max` and no surplus is shown.
127
+ */
128
+ getSurplusLabel(): Promise<Optional<string>>;
129
+ get driverName(): string;
130
+ }
131
+ //#endregion
132
+ //#region src/components/AutoCompleteDriver.d.ts
133
+ declare const parts$11: {
134
+ input: {
135
+ locator: import("@atomic-testing/core").CssLocator;
136
+ driver: typeof HTMLTextInputDriver;
137
+ };
138
+ dropdown: {
139
+ locator: import("@atomic-testing/core").LinkedCssLocator;
140
+ driver: typeof HTMLElementDriver;
141
+ };
142
+ };
143
+ /**
144
+ * The match type of the autocomplete, default to 'exact'
145
+ * 'exact': The value must match exactly to one of the options
146
+ * 'first-available': The value will be set to the first available option
147
+ */
148
+ type AutoCompleteMatchType = 'exact' | 'first-available';
149
+ interface AutoCompleteDriverSpecificOption {
150
+ matchType: AutoCompleteMatchType;
151
+ }
152
+ interface AutoCompleteDriverOption extends IComponentDriverOption, AutoCompleteDriverSpecificOption {}
153
+ declare const defaultAutoCompleteDriverOption: AutoCompleteDriverSpecificOption;
154
+ declare class AutoCompleteDriver extends ComponentDriver<typeof parts$11> implements IInputDriver<string | null> {
155
+ private _option;
156
+ constructor(locator: PartLocator, interactor: Interactor, option?: Partial<AutoCompleteDriverOption>);
157
+ /**
158
+ * Get the display of the autocomplete
159
+ */
160
+ getValue(): Promise<string | null>;
161
+ /**
162
+ * Set the value of the autocomplete, how selection happens
163
+ * depends on the option assigned to AutoCompleteDriver
164
+ * By default, when the option has matchType set to exact, only option with matching text would be selected
165
+ * When the option has matchType set to first-available, the first option would be selected regardless of the text
166
+ *
167
+ * Option of auto complete can be set at the time of part definition, for example
168
+ * ```
169
+ * {
170
+ * myAutoComplete: {
171
+ * locator: byCssSelector('my-auto-complete'),
172
+ * driver: AutoCompleteDriver,
173
+ * option: {
174
+ * matchType: 'first-available',
175
+ * },
176
+ * },
177
+ * }
178
+ * ```
179
+ *
180
+ * @param value
181
+ * @returns
182
+ */
183
+ setValue(value: string | null): Promise<boolean>;
184
+ isDisabled(): Promise<boolean>;
185
+ isReadonly(): Promise<boolean>;
186
+ /**
187
+ * Whether the popup is currently showing its loading indicator (the
188
+ * `loadingText`). Only meaningful while the popup is open — open it first
189
+ * (e.g. by typing into the input), since MUI renders nothing otherwise.
190
+ */
191
+ isLoading(): Promise<boolean>;
192
+ /**
193
+ * Whether the popup is currently showing its "no options" message. Same
194
+ * open-the-popup-first caveat as {@link AutoCompleteDriver.isLoading}.
195
+ */
196
+ hasNoOptions(): Promise<boolean>;
197
+ get driverName(): string;
198
+ }
199
+ //#endregion
200
+ //#region src/components/BadgeDriver.d.ts
201
+ declare const parts$10: {
202
+ contentDisplay: {
203
+ locator: import("@atomic-testing/core").CssLocator;
204
+ driver: typeof HTMLElementDriver;
205
+ };
206
+ };
207
+ /**
208
+ * Driver for Material UI v9 Badge component.
209
+ * @see https://mui.com/material-ui/react-badge/
210
+ */
211
+ declare class BadgeDriver extends ComponentDriver<typeof parts$10> {
212
+ constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>);
213
+ /**
214
+ * Get the content of the badge.
215
+ * @returns The content of the badge.
216
+ */
217
+ getContent(): Promise<string | null>;
218
+ get driverName(): string;
219
+ }
220
+ //#endregion
221
+ //#region src/components/BottomNavigationActionDriver.d.ts
222
+ /**
223
+ * Driver for a single Material UI v9 BottomNavigationAction.
224
+ *
225
+ * Each action renders as a `<button>` (no explicit ARIA role); MUI marks the
226
+ * active one with the `Mui-selected` state class, so selection is read from the
227
+ * class while `getText`/`click`/`isDisabled` come from {@link HTMLButtonDriver}
228
+ * and the base `ComponentDriver`.
229
+ * @see https://mui.com/material-ui/react-bottom-navigation/
230
+ */
231
+ declare class BottomNavigationActionDriver extends HTMLButtonDriver {
232
+ /**
233
+ * Whether this action is selected (MUI applies the `Mui-selected` state class).
234
+ */
235
+ isSelected(): Promise<boolean>;
236
+ get driverName(): string;
237
+ }
238
+ //#endregion
239
+ //#region src/components/BottomNavigationDriver.d.ts
240
+ interface BottomNavigationActionInfo {
241
+ /** The action's visible label. */
242
+ label: Optional<string>;
243
+ /** Whether the action is currently selected. */
244
+ selected: boolean;
245
+ }
246
+ type BottomNavigationDriverOption<ItemT extends BottomNavigationActionDriver> = ListComponentDriverSpecificOption<ItemT> & Partial<IComponentDriverOption<any>>;
247
+ /**
248
+ * Driver for the Material UI v9 BottomNavigation component.
249
+ *
250
+ * A {@link ListComponentDriver} over the action buttons, exposing the selected
251
+ * index/label, selection by index/label, and per-action info, plus per-action
252
+ * {@link BottomNavigationActionDriver} instances via `getItems`/`getItemByIndex`/
253
+ * `getItemByLabel`.
254
+ * @see https://mui.com/material-ui/react-bottom-navigation/
255
+ */
256
+ declare class BottomNavigationDriver<ItemT extends BottomNavigationActionDriver = BottomNavigationActionDriver> extends ListComponentDriver<ItemT> {
257
+ constructor(locator: PartLocator, interactor: Interactor, option?: Partial<BottomNavigationDriverOption<ItemT>>);
258
+ /**
259
+ * Every action with its label and selected state, in order.
260
+ */
261
+ getActions(): Promise<BottomNavigationActionInfo[]>;
262
+ /**
263
+ * Zero-based index of the selected action, or `-1` when none is selected.
264
+ */
265
+ getSelectedIndex(): Promise<number>;
266
+ /**
267
+ * Label of the selected action, or `null` when none is selected. Returns `null`
268
+ * (not `undefined`) to match the sibling `TabsDriver.getSelectedLabel` contract.
269
+ */
270
+ getSelectedLabel(): Promise<Nullable<string>>;
271
+ /**
272
+ * Select the action at the given zero-based index.
273
+ * @returns `false` when the index is out of range.
274
+ */
275
+ selectByIndex(index: number): Promise<boolean>;
276
+ /**
277
+ * Select the first action whose visible label equals `label`.
278
+ * @returns `false` when no action matches.
279
+ */
280
+ selectByLabel(label: string): Promise<boolean>;
281
+ get driverName(): string;
282
+ }
283
+ //#endregion
284
+ //#region src/components/ButtonDriver.d.ts
285
+ /**
286
+ * Driver for Material UI v9 Button component.
287
+ * @see https://mui.com/material-ui/react-button/
288
+ */
289
+ declare class ButtonDriver extends HTMLButtonDriver {
290
+ getValue(): Promise<string | null>;
291
+ get driverName(): string;
292
+ }
293
+ //#endregion
294
+ //#region src/components/CheckboxDriver.d.ts
295
+ declare const checkboxPart: {
296
+ checkbox: {
297
+ locator: import("@atomic-testing/core").CssLocator;
298
+ driver: typeof HTMLCheckboxDriver;
299
+ };
300
+ };
301
+ type CheckboxScenePart = typeof checkboxPart;
302
+ declare class CheckboxDriver extends ComponentDriver<CheckboxScenePart> implements IFormFieldDriver<string | null>, IToggleDriver {
303
+ constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>);
304
+ isSelected(): Promise<boolean>;
305
+ setSelected(selected: boolean): Promise<void>;
306
+ getValue(): Promise<string | null>;
307
+ isIndeterminate(): Promise<boolean>;
308
+ isDisabled(): Promise<boolean>;
309
+ isReadonly(): Promise<boolean>;
310
+ /**
311
+ * Get the text of the label associated with the checkbox, or `undefined` when the checkbox
312
+ * is rendered without one (e.g. a bare `<Checkbox>` outside of a `FormControlLabel`).
313
+ *
314
+ * MUI's `FormControlLabel` does not expose a `for`/`id` or `aria-labelledby` association; it
315
+ * labels the control implicitly by wrapping it in a `<label>` and rendering the text as a
316
+ * sibling. The label therefore lives outside this driver's own subtree, so we re-root at the
317
+ * enclosing `<label>` — matched against this checkbox via `:has()`, while preserving the
318
+ * surrounding scope — and read its text. This resolves to a single CSS selector, so it behaves
319
+ * identically across every interactor (DOM/React/Vue and Playwright).
320
+ */
321
+ getLabel(): Promise<Optional<string>>;
322
+ /**
323
+ * Build a locator for the `<label>` that encloses this checkbox, scoped to the same ancestor
324
+ * context as the checkbox itself so that sibling checkboxes are never mismatched.
325
+ */
326
+ private getEnclosingLabelLocator;
327
+ get driverName(): string;
328
+ }
329
+ //#endregion
330
+ //#region src/components/ChipDriver.d.ts
331
+ declare const parts$9: {
332
+ contentDisplay: {
333
+ locator: import("@atomic-testing/core").CssLocator;
334
+ driver: typeof HTMLElementDriver;
335
+ };
336
+ removeButton: {
337
+ locator: import("@atomic-testing/core").CssLocator;
338
+ driver: typeof HTMLElementDriver;
339
+ };
340
+ };
341
+ /**
342
+ * Driver for Material UI v9 Chip component.
343
+ * @see https://mui.com/material-ui/react-chip/
344
+ */
345
+ declare class ChipDriver extends ComponentDriver<typeof parts$9> {
346
+ constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>);
347
+ /**
348
+ * Get the label content of the chip.
349
+ * @returns The label text content of the chip.
350
+ */
351
+ getLabel(): Promise<string | null>;
352
+ clickRemove(): Promise<void>;
353
+ get driverName(): string;
354
+ }
355
+ //#endregion
356
+ //#region src/components/DialogDriver.d.ts
357
+ declare const parts$8: {
358
+ title: {
359
+ locator: import("@atomic-testing/core").CssLocator;
360
+ driver: typeof HTMLElementDriver;
361
+ };
362
+ dialogContainer: {
363
+ locator: import("@atomic-testing/core").CssLocator;
364
+ driver: typeof HTMLElementDriver;
365
+ };
366
+ };
367
+ declare class DialogDriver<ContentT extends ScenePart> extends ContainerDriver<ContentT, typeof parts$8> {
368
+ constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IContainerDriverOption>);
369
+ overriddenParentLocator(): Optional<PartLocator>;
370
+ overrideLocatorRelativePosition(): Optional<LocatorRelativePosition>;
371
+ getTitle(): Promise<string | null>;
372
+ /**
373
+ * Dismiss the dialog by clicking outside its content, then wait for it to close.
374
+ *
375
+ * MUI's "backdrop click" is handled on the `.MuiDialog-container` surface (which
376
+ * overlays the visual `.MuiBackdrop-root`), firing `onClose` only when the click
377
+ * target is the container itself. The click therefore lands on the container near
378
+ * its top-left corner to avoid the centered paper. Whether it actually closes
379
+ * depends on the consumer's `onClose` handling (MUI reports a `"backdropClick"`
380
+ * reason); the returned boolean reflects the observed close, not merely the click.
381
+ *
382
+ * @param timeoutMs How long to wait for the close transition to finish
383
+ * @returns true if the dialog closed
384
+ */
385
+ closeByBackdropClick(timeoutMs?: number): Promise<boolean>;
386
+ /**
387
+ * Wait for dialog to open
388
+ * @param timeoutMs
389
+ * @returns true open has performed successfully
390
+ */
391
+ waitForOpen(timeoutMs?: number): Promise<boolean>;
392
+ /**
393
+ * Wait for dialog to close
394
+ * @param timeoutMs
395
+ * @returns true open has performed successfully
396
+ */
397
+ waitForClose(timeoutMs?: number): Promise<boolean>;
398
+ /**
399
+ * Check if the dialog box is open. Caution, because of animation, upon an open/close action is performed
400
+ * use waitForOpen() or waitForClose() before using isOpen() would result a more accurate open state of the dialog
401
+ * @returns true if dialog box is open
402
+ */
403
+ isOpen(): Promise<boolean>;
404
+ get driverName(): string;
405
+ }
406
+ //#endregion
407
+ //#region src/components/OverlayDriver.d.ts
408
+ /**
409
+ * Shared base for MUI portal-rendered overlays (Drawer today; Dialog, Menu,
410
+ * Popover and SpeedDial are prospective consumers). It owns the open/close
411
+ * lifecycle that {@link DialogDriver} first proved out: `isOpen` derived from the
412
+ * visible surface, `waitForOpen`/`waitForClose` spanning the transition, and
413
+ * `closeByBackdrop`.
414
+ *
415
+ * Subclasses supply {@link getSurfaceLocator} (the element whose visibility means
416
+ * "open") and, when the overlay is portal-rendered, override
417
+ * `overriddenParentLocator()`/`overrideLocatorRelativePosition()` to re-root.
418
+ *
419
+ * `closeByEscape` is intentionally absent: keyboard dismissal needs a key-press
420
+ * primitive the `Interactor` interface does not yet expose, which would have to be
421
+ * added to every interactor (DOM/React/Vue/Playwright). It is deferred rather than
422
+ * partially implemented.
423
+ */
424
+ declare abstract class OverlayDriver<ContentT extends ScenePart, T extends ScenePart = {}> extends ContainerDriver<ContentT, T> {
425
+ /**
426
+ * Locator of the surface whose visibility reflects the open state (e.g. the
427
+ * drawer/dialog paper).
428
+ */
429
+ protected abstract getSurfaceLocator(): PartLocator;
430
+ /**
431
+ * Locator of the dismissible backdrop. Defaults to MUI's `.MuiBackdrop-root`.
432
+ */
433
+ protected getBackdropLocator(): PartLocator;
434
+ /**
435
+ * Whether the overlay is mounted and its surface is visible. Because of open/close
436
+ * transitions, prefer `waitForOpen()`/`waitForClose()` immediately after an action.
437
+ */
438
+ isOpen(): Promise<boolean>;
439
+ /**
440
+ * Wait until the overlay is open.
441
+ * @returns true once open within the timeout.
442
+ */
443
+ waitForOpen(timeoutMs?: number): Promise<boolean>;
444
+ /**
445
+ * Wait until the overlay is closed.
446
+ * @returns true once closed within the timeout.
447
+ */
448
+ waitForClose(timeoutMs?: number): Promise<boolean>;
449
+ /**
450
+ * Dismiss by clicking the backdrop, then wait for the close transition. Whether
451
+ * it actually closes depends on the consumer honoring the backdrop dismissal; the
452
+ * returned boolean reflects the observed close, not merely the click.
453
+ */
454
+ closeByBackdrop(timeoutMs?: number): Promise<boolean>;
455
+ }
456
+ //#endregion
457
+ //#region src/components/DrawerDriver.d.ts
458
+ declare const drawerParts: {
459
+ paper: {
460
+ locator: import("@atomic-testing/core").CssLocator;
461
+ driver: typeof HTMLElementDriver;
462
+ };
463
+ };
464
+ type DrawerAnchor = 'left' | 'right' | 'top' | 'bottom';
465
+ /**
466
+ * Driver for the Material UI v9 Drawer (and SwipeableDrawer) component.
467
+ *
468
+ * A temporary Drawer is a portal-rendered Modal: its root `role="presentation"`
469
+ * (`.MuiDrawer-root`) carries the anchor class and holds a `.MuiBackdrop-root` plus
470
+ * the `.MuiDrawer-paper` panel. Open/close/backdrop behavior is inherited from
471
+ * {@link OverlayDriver}; this driver adds the anchor read and the portal re-rooting.
472
+ * @see https://mui.com/material-ui/react-drawer/
473
+ */
474
+ declare class DrawerDriver<ContentT extends ScenePart> extends OverlayDriver<ContentT, typeof drawerParts> {
475
+ constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IContainerDriverOption>);
476
+ overriddenParentLocator(): Optional<PartLocator>;
477
+ overrideLocatorRelativePosition(): Optional<LocatorRelativePosition>;
478
+ protected getSurfaceLocator(): PartLocator;
479
+ /**
480
+ * The side the drawer is anchored to, read from the portal root's anchor class, or
481
+ * `undefined` when the drawer is closed/unmounted.
482
+ *
483
+ * The anchor class sits on the `role="presentation"` root itself, so it is read
484
+ * directly off {@link drawerRootLocator} rather than through a part (parts resolve
485
+ * as descendants of that root, but the class is on the root).
486
+ */
487
+ getAnchor(): Promise<Optional<DrawerAnchor>>;
488
+ get driverName(): string;
489
+ }
490
+ //#endregion
491
+ //#region src/components/FabDriver.d.ts
492
+ /**
493
+ * Driver for Material UI v9 Floating Action Button component.
494
+ * @see https://mui.com/material-ui/react-floating-action-button/
495
+ */
496
+ declare class FabDriver extends ButtonDriver {
497
+ get driverName(): string;
498
+ }
499
+ //#endregion
500
+ //#region src/components/InputDriver.d.ts
501
+ declare const parts$7: {
502
+ singlelineInput: {
503
+ locator: import("@atomic-testing/core").CssLocator;
504
+ driver: typeof HTMLTextInputDriver;
505
+ };
506
+ multilineInput: {
507
+ locator: import("@atomic-testing/core").CssLocator;
508
+ driver: typeof HTMLTextInputDriver;
509
+ };
510
+ };
511
+ /**
512
+ * A driver for the Material UI v9 Input, FilledInput, OutlinedInput, and StandardInput components.
513
+ */
514
+ declare class InputDriver extends ComponentDriver<typeof parts$7> implements IInputDriver<string | null> {
515
+ constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>);
516
+ private getInputType;
517
+ /**
518
+ * Retrieve the current value of the input element, handling both single line
519
+ * and multiline configurations.
520
+ */
521
+ getValue(): Promise<string | null>;
522
+ /**
523
+ * Set the value of the underlying input element.
524
+ *
525
+ * @param value The text to assign to the input.
526
+ */
527
+ setValue(value: string | null): Promise<boolean>;
528
+ /**
529
+ * Determine whether the input element is disabled.
530
+ */
531
+ isDisabled(): Promise<boolean>;
532
+ /**
533
+ * Determine whether the input element is read only.
534
+ */
535
+ isReadonly(): Promise<boolean>;
536
+ /**
537
+ * Identifier for this driver.
538
+ */
539
+ get driverName(): string;
540
+ }
541
+ //#endregion
542
+ //#region src/components/ListItemDriver.d.ts
543
+ /**
544
+ * @internal
545
+ */
546
+ declare class ListItemDriver extends ComponentDriver {
547
+ label(): Promise<string | null>;
548
+ isSelected(): Promise<boolean>;
549
+ isDisabled(): Promise<boolean>;
550
+ click(): Promise<void>;
551
+ get driverName(): string;
552
+ }
553
+ //#endregion
554
+ //#region src/components/ListDriver.d.ts
555
+ type ListDriverOption<ItemT extends ListItemDriver> = ListComponentDriverSpecificOption<ItemT> & Partial<IComponentDriverOption<any>>;
556
+ declare class ListDriver<ItemT extends ListItemDriver = ListItemDriver> extends ListComponentDriver<ItemT> {
557
+ constructor(locator: PartLocator, interactor: Interactor, option?: ListDriverOption<ItemT>);
558
+ getSelected(): Promise<ListItemDriver | null>;
559
+ get driverName(): string;
560
+ }
561
+ //#endregion
562
+ //#region src/components/MenuItemDriver.d.ts
563
+ /**
564
+ * @internal
565
+ */
566
+ declare class MenuItemDriver extends ListItemDriver {
567
+ value(): Promise<string | null>;
568
+ get driverName(): string;
569
+ }
570
+ //#endregion
571
+ //#region src/components/MenuDriver.d.ts
572
+ declare const parts$6: {
573
+ menu: {
574
+ locator: import("@atomic-testing/core").CssLocator;
575
+ driver: typeof HTMLElementDriver;
576
+ };
577
+ };
578
+ declare class MenuDriver extends ComponentDriver<typeof parts$6> {
579
+ constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>);
580
+ overriddenParentLocator(): Optional<PartLocator>;
581
+ overrideLocatorRelativePosition(): Optional<LocatorRelativePosition>;
582
+ getMenuItemByLabel(label: string): Promise<MenuItemDriver | null>;
583
+ selectByLabel(label: string): Promise<void>;
584
+ get driverName(): string;
585
+ }
586
+ //#endregion
587
+ //#region src/components/PaginationDriver.d.ts
588
+ /**
589
+ * Driver for the Material UI v9 Pagination component.
590
+ *
591
+ * Pagination renders a `<nav>` whose `MuiPaginationItem` buttons are each wrapped
592
+ * in their own `<li>` (so they are not siblings — positional `:nth-of-type`
593
+ * iteration does not apply). Page controls are read by their accessible name
594
+ * instead: every page button's aria-label ends in its page number ("Go to page N",
595
+ * or "page N" once selected), and first/previous/next/last carry stable
596
+ * aria-labels and become `disabled` at the bounds.
597
+ * @see https://mui.com/material-ui/react-pagination/
598
+ */
599
+ declare class PaginationDriver extends ComponentDriver {
600
+ private get pageItemsLocator();
601
+ /**
602
+ * The selected page number, or `-1` when no page is marked current.
603
+ */
604
+ getSelectedPage(): Promise<number>;
605
+ /**
606
+ * Total number of pages, taken from the highest numbered page control. MUI
607
+ * always renders the upper boundary page (boundaryCount >= 1), so this is exact
608
+ * even when middle pages collapse into an ellipsis.
609
+ */
610
+ getPageCount(): Promise<number>;
611
+ /**
612
+ * Click the numbered control for `page`. A no-op (returns `true`) when `page` is
613
+ * already selected.
614
+ * @returns `false` when that page is not currently rendered (e.g. hidden behind
615
+ * an ellipsis) or is disabled.
616
+ */
617
+ goToPage(page: number): Promise<boolean>;
618
+ /**
619
+ * Click a navigation control unless it is absent or disabled (at a bound).
620
+ * @returns whether the click was performed.
621
+ */
622
+ private clickNavButton;
623
+ /** Go to the next page. Returns `false` when on the last page or the control is hidden. */
624
+ next(): Promise<boolean>;
625
+ /** Go to the previous page. Returns `false` when on the first page or the control is hidden. */
626
+ previous(): Promise<boolean>;
627
+ /** Jump to the first page. Returns `false` when already there or the control is hidden (needs `showFirstButton`). */
628
+ first(): Promise<boolean>;
629
+ /** Jump to the last page. Returns `false` when already there or the control is hidden (needs `showLastButton`). */
630
+ last(): Promise<boolean>;
631
+ get driverName(): string;
632
+ }
633
+ //#endregion
634
+ //#region src/components/ProgressDriver.d.ts
635
+ declare const parts$5: {
636
+ choices: {
637
+ locator: import("@atomic-testing/core").CssLocator;
638
+ driver: typeof HTMLRadioButtonGroupDriver;
639
+ };
640
+ };
641
+ declare class ProgressDriver extends ComponentDriver<typeof parts$5> implements IInputDriver<number | null> {
642
+ constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>);
643
+ getValue(): Promise<number | null>;
644
+ getType(): Promise<'linear' | 'circular'>;
645
+ isDeterminate(): Promise<boolean>;
646
+ setValue(value: number | null): Promise<boolean>;
647
+ get driverName(): string;
648
+ }
649
+ //#endregion
650
+ //#region src/components/RadioDriver.d.ts
651
+ /**
652
+ * Driver for a single Material UI v9 Radio option (a `FormControlLabel` wrapping a
653
+ * `Radio`). Its label text is the `FormControlLabel`'s text; selected/value/disabled
654
+ * state is read from the underlying radio `<input>`.
655
+ *
656
+ * Used as the item driver of {@link RadioGroupDriver}, but also usable on its own
657
+ * when a single radio option is addressed directly. It declares no parts (so it
658
+ * composes as a list item) and reads the input via descendant locators.
659
+ * @see https://mui.com/material-ui/react-radio-button/
660
+ */
661
+ declare class RadioDriver extends ComponentDriver {
662
+ private get input();
663
+ /**
664
+ * The option's visible label, or `undefined` when it renders without text.
665
+ */
666
+ getLabel(): Promise<Optional<string>>;
667
+ /**
668
+ * The option's `value` attribute.
669
+ */
670
+ getValue(): Promise<string | null>;
671
+ /**
672
+ * Whether this option is the selected one in its group.
673
+ */
674
+ isSelected(): Promise<boolean>;
675
+ /**
676
+ * Whether this option is disabled.
677
+ */
678
+ isDisabled(): Promise<boolean>;
679
+ /**
680
+ * Select this option by clicking its radio input. No-op effect when already selected.
681
+ */
682
+ select(): Promise<void>;
683
+ get driverName(): string;
684
+ }
685
+ //#endregion
686
+ //#region src/components/RadioGroupDriver.d.ts
687
+ /**
688
+ * Radio options are located by their `FormControlLabel` root, which wraps the
689
+ * radio `<input>` and renders the label text — the unit a {@link RadioDriver}
690
+ * drives.
691
+ */
692
+ declare const defaultRadioGroupDriverOption: ListComponentDriverSpecificOption<RadioDriver>;
693
+ type RadioGroupDriverOption<ItemT extends RadioDriver> = ListComponentDriverSpecificOption<ItemT> & Partial<IComponentDriverOption<any>>;
694
+ /**
695
+ * Driver for the Material UI v9 RadioGroup component.
696
+ *
697
+ * `<RadioGroup>` renders a `role="radiogroup"` whose options are `FormControlLabel`s
698
+ * wrapping a radio `<input>`. This driver is a {@link ListComponentDriver} over those
699
+ * options, so per-option {@link RadioDriver} instances are available via
700
+ * `getItems`/`getItemByIndex`/`getItemByLabel`, on top of the group-level value and
701
+ * label helpers. The selected value is read from the checked `<input>` and selection
702
+ * is made by value or label.
703
+ * @see https://mui.com/material-ui/react-radio-button/
704
+ */
705
+ declare class RadioGroupDriver<ItemT extends RadioDriver = RadioDriver> extends ListComponentDriver<ItemT> implements IInputDriver<string | null> {
706
+ constructor(locator: PartLocator, interactor: Interactor, option?: Partial<RadioGroupDriverOption<ItemT>>);
707
+ /**
708
+ * The `value` of the selected option, or `null` when none is selected.
709
+ */
710
+ getValue(): Promise<string | null>;
711
+ /**
712
+ * Select the option whose radio `<input>` has the given `value`.
713
+ * @returns `false` when no option has that value, or when `value` is `null`.
714
+ */
715
+ setValue(value: string | null): Promise<boolean>;
716
+ /**
717
+ * The visible label of every option, in DOM order.
718
+ */
719
+ getOptions(): Promise<string[]>;
720
+ /**
721
+ * The label of the selected option, or `null` when none is selected.
722
+ */
723
+ getSelectedLabel(): Promise<Nullable<string>>;
724
+ /**
725
+ * Select the first option whose visible label equals `label`.
726
+ * @returns `false` when no option matches.
727
+ */
728
+ selectByLabel(label: string): Promise<boolean>;
729
+ /**
730
+ * Whether the option with the given label is disabled.
731
+ * @returns `false` when no option matches.
732
+ */
733
+ isOptionDisabled(label: string): Promise<boolean>;
734
+ get driverName(): string;
735
+ }
736
+ //#endregion
737
+ //#region src/components/RatingDriver.d.ts
738
+ declare const parts$4: {
739
+ choices: {
740
+ locator: import("@atomic-testing/core").CssLocator;
741
+ driver: typeof HTMLRadioButtonGroupDriver;
742
+ };
743
+ };
744
+ declare class RatingDriver extends ComponentDriver<typeof parts$4> implements IInputDriver<number | null> {
745
+ constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>);
746
+ getValue(): Promise<number | null>;
747
+ /**
748
+ * Read the value of a read-only Rating.
749
+ *
750
+ * Primary source is the root's `aria-label`, which MUI populates with the accessible
751
+ * name (e.g. `"2.5 Stars"`) — accessibility-first and precision-accurate. When a
752
+ * caller supplies a custom, non-numeric `aria-label`, fall back to counting the
753
+ * filled star icons; that count is exact for whole-star ratings.
754
+ */
755
+ private getReadOnlyValue;
756
+ /**
757
+ * Whether the Rating is disabled. `disabled` is reflected as the `Mui-disabled`
758
+ * class on the root span (the composed radio-group driver exposes no `isDisabled`).
759
+ */
760
+ isDisabled(): Promise<boolean>;
761
+ setValue(value: number | null): Promise<boolean>;
762
+ get driverName(): string;
763
+ }
764
+ //#endregion
765
+ //#region src/components/SelectDriver.d.ts
766
+ declare const selectPart: {
767
+ trigger: {
768
+ locator: import("@atomic-testing/core").CssLocator;
769
+ driver: typeof HTMLButtonDriver;
770
+ };
771
+ dropdown: {
772
+ locator: import("@atomic-testing/core").CssLocator;
773
+ driver: typeof HTMLElementDriver;
774
+ };
775
+ input: {
776
+ locator: import("@atomic-testing/core").CssLocator;
777
+ driver: typeof HTMLTextInputDriver;
778
+ };
779
+ nativeSelect: {
780
+ locator: import("@atomic-testing/core").CssLocator;
781
+ driver: typeof HTMLSelectDriver;
782
+ };
783
+ };
784
+ type SelectScenePart$1 = typeof selectPart;
785
+ interface MenuItemGetOption {
786
+ /**
787
+ * When true, the driver will not check if the dropdown is open, which helps speed the process up.
788
+ */
789
+ skipDropdownCheck?: boolean;
790
+ }
791
+ declare class SelectDriver extends ComponentDriver<SelectScenePart$1> implements IInputDriver<string | null> {
792
+ constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>);
793
+ isNative(): Promise<boolean>;
794
+ getValue(): Promise<string | null>;
795
+ setValue(value: string | null): Promise<boolean>;
796
+ /**
797
+ * Select menu item by its label, if it exists
798
+ * Limitation, this method will not work if the dropdown is a native select.
799
+ * @param label
800
+ * @returns
801
+ */
802
+ getMenuItemByLabel(label: string, option?: MenuItemGetOption): Promise<MenuItemDriver | null>;
803
+ /**
804
+ * Selects an option by its label
805
+ * @param label
806
+ * @returns
807
+ */
808
+ selectByLabel(label: string): Promise<void>;
809
+ getSelectedLabel(): Promise<string | null>;
810
+ exists(): Promise<boolean>;
811
+ /**
812
+ * Check if the dropdown is open, or if it is a native select, it is always open because there is no known way check its open state
813
+ * @returns For native dropdown it is always true. For custom dropdown, it is true if the dropdown is open.
814
+ */
815
+ isDropdownOpen(): Promise<boolean>;
816
+ openDropdown(): Promise<void>;
817
+ closeDropdown(): Promise<void>;
818
+ isDisabled(): Promise<boolean>;
819
+ isReadonly(): Promise<boolean>;
820
+ get driverName(): string;
821
+ }
822
+ //#endregion
823
+ //#region src/components/SliderDriver.d.ts
824
+ declare const parts$3: {
825
+ input: {
826
+ locator: import("@atomic-testing/core").CssLocator;
827
+ driver: typeof HTMLTextInputDriver;
828
+ };
829
+ };
830
+ type SelectScenePart = typeof parts$3;
831
+ declare class SliderDriver extends ComponentDriver<SelectScenePart> implements IInputDriver<number> {
832
+ constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>);
833
+ /**
834
+ * Return the first occurrence of the Slider input
835
+ * @returns
836
+ */
837
+ getValue(): Promise<number>;
838
+ /**
839
+ * Set slider's range value. Do not use as it will throw an error
840
+ * @param values
841
+ * @see https://github.com/atomic-testing/atomic-testing/issues/73
842
+ */
843
+ setValue(value: number): Promise<boolean>;
844
+ getRangeValues(count?: number): Promise<readonly number[]>;
845
+ private getInputLocator;
846
+ /**
847
+ * Set slider's range values. Do not use as it will throw an error
848
+ * @param values
849
+ * @see https://github.com/atomic-testing/atomic-testing/issues/73
850
+ */
851
+ setRangeValues(_values: readonly number[]): Promise<boolean>;
852
+ isDisabled(): Promise<boolean>;
853
+ get driverName(): string;
854
+ }
855
+ //#endregion
856
+ //#region src/components/SnackbarDriver.d.ts
857
+ declare const parts$2: {
858
+ contentDisplay: {
859
+ locator: import("@atomic-testing/core").CssLocator;
860
+ driver: typeof HTMLElementDriver;
861
+ };
862
+ actionArea: {
863
+ locator: import("@atomic-testing/core").CssLocator;
864
+ driver: typeof HTMLElementDriver;
865
+ };
866
+ };
867
+ /**
868
+ * Driver for Material UI v9 Snackbar component.
869
+ * @see https://mui.com/material-ui/react-snackbar/
870
+ */
871
+ declare class SnackbarDriver extends ComponentDriver<typeof parts$2> {
872
+ constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>);
873
+ /**
874
+ * Get the label content of the snackbar.
875
+ * @returns The label text content of the snackbar.
876
+ */
877
+ getLabel(): Promise<string | null>;
878
+ /**
879
+ * Get a driver instance of a component in the action area of the snackbar.
880
+ * @param locator
881
+ * @param driverClass
882
+ * @returns
883
+ */
884
+ getActionComponent<ItemClass extends ComponentDriver>(locator: PartLocator, driverClass: ComponentDriverCtor<ItemClass>): Promise<ItemClass | null>;
885
+ get driverName(): string;
886
+ }
887
+ //#endregion
888
+ //#region src/components/SpeedDialDriver.d.ts
889
+ /**
890
+ * Driver for the Material UI v9 SpeedDial component.
891
+ *
892
+ * SpeedDial renders a trigger FAB (`.MuiSpeedDial-fab`, `aria-expanded` reflects
893
+ * open state) and a set of action FABs (`.MuiSpeedDialAction-fab`, each
894
+ * aria-labelled with its name). The actions stay mounted but are only revealed
895
+ * when open, so open state is read from the FAB's `aria-expanded` rather than
896
+ * action presence.
897
+ * @see https://mui.com/material-ui/react-speed-dial/
898
+ */
899
+ declare class SpeedDialDriver extends ComponentDriver {
900
+ private get fab();
901
+ /**
902
+ * Whether the speed dial is open (its FAB reports `aria-expanded="true"`).
903
+ */
904
+ isOpen(): Promise<boolean>;
905
+ /**
906
+ * Open the speed dial by hovering its FAB. No-op when already open.
907
+ *
908
+ * Hover (`onMouseEnter`) is the trigger that opens consistently across MUI
909
+ * versions and browsers — clicking only focuses-then-opens in Chromium, and
910
+ * focus opens in v7 but not v5, whereas hover opens everywhere.
911
+ */
912
+ open(): Promise<void>;
913
+ /**
914
+ * Close the speed dial by moving the pointer off its FAB. No-op when already closed.
915
+ */
916
+ close(): Promise<void>;
917
+ /**
918
+ * The labels of every action, in order (read from each action FAB's aria-label).
919
+ */
920
+ getActionLabels(): Promise<string[]>;
921
+ /**
922
+ * Trigger the action with the given label, opening the dial first if needed.
923
+ * @returns `false` when no action has that label.
924
+ */
925
+ triggerActionByLabel(label: string): Promise<boolean>;
926
+ get driverName(): string;
927
+ }
928
+ //#endregion
929
+ //#region src/components/StepperDriver.d.ts
930
+ interface StepInfo {
931
+ /** The step's visible label. */
932
+ label: Optional<string>;
933
+ /** Whether this is the active step (MUI marks the label `Mui-active`). */
934
+ active: boolean;
935
+ /** Whether the step has been completed (`Mui-completed`). */
936
+ completed: boolean;
937
+ /** Whether the step is disabled (`Mui-disabled`). */
938
+ disabled: boolean;
939
+ }
940
+ /**
941
+ * Driver for the Material UI v9 Stepper component.
942
+ *
943
+ * Each step's state lives on its `.MuiStepLabel-label` (`Mui-active`,
944
+ * `Mui-completed`, `Mui-disabled`); reading every label's class in one pass gives
945
+ * the step states and count in document order. Steps are addressed positionally
946
+ * for label text and clicks via {@link stepLabelAt}/{@link stepButtonAt}.
947
+ *
948
+ * Supported layouts: the default horizontal stepper and the vertical orientation.
949
+ * In v9 every `.MuiStep-root` is a consecutive sibling (the connector lives inside
950
+ * the step), and every step renders a text label, so positional addressing lines up
951
+ * with the document-order class list. The unsupported case is icon-only steps, which
952
+ * render no `.MuiStepLabel-label`; under those the document-order class list has fewer
953
+ * entries than steps and the two desynchronize. Robustly supporting that needs an
954
+ * interactor primitive to address the n-th of non-sibling matches
955
+ * (CSS `:nth-child(of S)` is unsupported in jsdom), which is out of this driver's scope.
956
+ * @see https://mui.com/material-ui/react-stepper/
957
+ */
958
+ declare class StepperDriver extends ComponentDriver {
959
+ private getStepClassList;
960
+ /**
961
+ * The number of steps.
962
+ */
963
+ getStepCount(): Promise<number>;
964
+ /**
965
+ * Zero-based index of the active step, or `-1` when none is active.
966
+ */
967
+ getActiveStepIndex(): Promise<number>;
968
+ /**
969
+ * Every step with its label and active/completed/disabled state, in order.
970
+ */
971
+ getSteps(): Promise<StepInfo[]>;
972
+ /**
973
+ * Navigate to the step at `index` by clicking its control (requires a clickable
974
+ * `StepButton`, e.g. a non-linear stepper).
975
+ * @returns `false` when the step is out of range, has no button, or is disabled.
976
+ */
977
+ goToStep(index: number): Promise<boolean>;
978
+ get driverName(): string;
979
+ }
980
+ //#endregion
981
+ //#region src/components/SwitchDriver.d.ts
982
+ declare const parts$1: {
983
+ input: {
984
+ locator: import("@atomic-testing/core").CssLocator;
985
+ driver: typeof HTMLCheckboxDriver;
986
+ };
987
+ };
988
+ declare class SwitchDriver extends ComponentDriver<typeof parts$1> implements IFormFieldDriver<string | null>, IToggleDriver {
989
+ constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>);
990
+ exists(): Promise<boolean>;
991
+ isSelected(): Promise<boolean>;
992
+ setSelected(selected: boolean): Promise<void>;
993
+ getValue(): Promise<string | null>;
994
+ isDisabled(): Promise<boolean>;
995
+ isReadonly(): Promise<boolean>;
996
+ get driverName(): string;
997
+ }
998
+ //#endregion
999
+ //#region src/components/TableCellDriver.d.ts
1000
+ /**
1001
+ * Driver for a single Material UI v9 TableCell (`<td>`/`<th>`, `.MuiTableCell-root`).
1002
+ *
1003
+ * A cell's content is plain text, so it relies on the inherited `getText()`/`exists()`;
1004
+ * it exists as a distinct type so {@link TableRowDriver} can expose typed cell drivers.
1005
+ * @see https://mui.com/material-ui/react-table/
1006
+ */
1007
+ declare class TableCellDriver extends ComponentDriver {
1008
+ get driverName(): string;
1009
+ }
1010
+ //#endregion
1011
+ //#region src/components/TableRowDriver.d.ts
1012
+ /**
1013
+ * Cells are located by `.MuiTableCell-root`, covering both `<td>` body cells and
1014
+ * `<th>` header cells.
1015
+ */
1016
+ declare const defaultTableRowDriverOption: ListComponentDriverSpecificOption<TableCellDriver>;
1017
+ type TableRowDriverOption<ItemT extends TableCellDriver> = ListComponentDriverSpecificOption<ItemT> & Partial<IComponentDriverOption<any>>;
1018
+ /**
1019
+ * Driver for a single Material UI v9 TableRow (`.MuiTableRow-root`).
1020
+ *
1021
+ * A {@link ListComponentDriver} over the row's cells, exposing per-cell
1022
+ * {@link TableCellDriver}s (via `getItems`/`getItemByIndex`) plus convenience reads
1023
+ * of the cell texts.
1024
+ *
1025
+ * Cells are addressed positionally via `:nth-of-type`, which counts per element type.
1026
+ * This assumes a row's cells are homogeneous (all `<td>`, or all `<th>` for a header
1027
+ * row) — the common MUI rendering. A row mixing a leading `<th scope="row">` with
1028
+ * `<td>` data cells would desynchronize the index (the `<td>`s start at type-index 1
1029
+ * after the `<th>`); such rows are out of scope.
1030
+ * @see https://mui.com/material-ui/react-table/
1031
+ */
1032
+ declare class TableRowDriver<ItemT extends TableCellDriver = TableCellDriver> extends ListComponentDriver<ItemT> {
1033
+ constructor(locator: PartLocator, interactor: Interactor, option?: Partial<TableRowDriverOption<ItemT>>);
1034
+ /**
1035
+ * The number of cells in the row.
1036
+ */
1037
+ getCellCount(): Promise<number>;
1038
+ /**
1039
+ * The cell driver at the given zero-based column index, or `null` when out of range.
1040
+ */
1041
+ getCell(index: number): Promise<ItemT | null>;
1042
+ /**
1043
+ * The text of every cell, in column order.
1044
+ */
1045
+ getCellTexts(): Promise<string[]>;
1046
+ get driverName(): string;
1047
+ }
1048
+ //#endregion
1049
+ //#region src/components/TableDriver.d.ts
1050
+ /** Reported sort state of a column, mirroring the `aria-sort` values MUI emits. */
1051
+ type TableSortDirection = 'ascending' | 'descending';
1052
+ /**
1053
+ * Body rows are located under `.MuiTableBody-root`, so header rows are never
1054
+ * mistaken for data rows.
1055
+ */
1056
+ declare const defaultTableDriverOption: ListComponentDriverSpecificOption<TableRowDriver>;
1057
+ type TableDriverOption<ItemT extends TableRowDriver> = ListComponentDriverSpecificOption<ItemT> & Partial<IComponentDriverOption<any>>;
1058
+ /**
1059
+ * Driver for the Material UI v9 Table component.
1060
+ *
1061
+ * A {@link ListComponentDriver} over the data rows (`.MuiTableBody-root > .MuiTableRow-root`),
1062
+ * exposing per-row {@link TableRowDriver}s plus header reads and column sort state.
1063
+ * Locators key off MUI's structural classes (`MuiTableHead/Body/Row/Cell-root`),
1064
+ * which are stable across v9. Sort state is read from the header cell's `aria-sort`
1065
+ * and driven by clicking its `TableSortLabel`.
1066
+ * @see https://mui.com/material-ui/react-table/
1067
+ */
1068
+ declare class TableDriver<ItemT extends TableRowDriver = TableRowDriver> extends ListComponentDriver<ItemT> {
1069
+ constructor(locator: PartLocator, interactor: Interactor, option?: Partial<TableDriverOption<ItemT>>);
1070
+ /**
1071
+ * The number of data (body) rows.
1072
+ */
1073
+ getRowCount(): Promise<number>;
1074
+ /**
1075
+ * The data-row driver at the given zero-based index, or `null` when out of range.
1076
+ */
1077
+ getRow(index: number): Promise<ItemT | null>;
1078
+ /**
1079
+ * The header row as a {@link TableRowDriver}, or `null` when the table has no header.
1080
+ */
1081
+ getHeaderRow(): Promise<TableRowDriver | null>;
1082
+ /**
1083
+ * The number of columns, derived from the header cell count (0 when no header).
1084
+ */
1085
+ getColumnCount(): Promise<number>;
1086
+ /**
1087
+ * The header cell texts, in column order (empty when no header).
1088
+ */
1089
+ getHeaderTexts(): Promise<string[]>;
1090
+ /**
1091
+ * The text of the data cell at the given row/column, or `undefined` when either
1092
+ * index is out of range.
1093
+ */
1094
+ getCellText(rowIndex: number, columnIndex: number): Promise<Optional<string>>;
1095
+ /**
1096
+ * The sort direction applied to the column at `columnIndex`, read from the header
1097
+ * cell's `aria-sort`, or `undefined` when that column is not the sorted one.
1098
+ */
1099
+ getSortDirection(columnIndex: number): Promise<Optional<TableSortDirection>>;
1100
+ /**
1101
+ * Toggle/apply sorting on the column at `columnIndex` by clicking its
1102
+ * `TableSortLabel`.
1103
+ * @returns `false` when the column has no sort control.
1104
+ */
1105
+ sortByColumn(columnIndex: number): Promise<boolean>;
1106
+ get driverName(): string;
1107
+ }
1108
+ //#endregion
1109
+ //#region src/components/TablePaginationDriver.d.ts
1110
+ /**
1111
+ * Driver for the Material UI v9 TablePagination component.
1112
+ *
1113
+ * TablePagination is a composite: a "rows per page" MUI Select (a portal-backed
1114
+ * `role="combobox"`), an aria-labelled previous/next pair that disables at the
1115
+ * bounds, and a `.MuiTablePagination-displayedRows` label ("1–5 of 13"). The
1116
+ * rows-per-page control is delegated to {@link SelectDriver} rather than
1117
+ * reimplemented — the driver's own root contains exactly one combobox/input, so
1118
+ * SelectDriver scoped to that root resolves it unambiguously.
1119
+ * @see https://mui.com/material-ui/react-pagination/#table-pagination
1120
+ */
1121
+ declare class TablePaginationDriver extends ComponentDriver {
1122
+ private get rowsPerPageSelect();
1123
+ /**
1124
+ * The current rows-per-page value (read from the select's hidden input), or
1125
+ * `-1` when it cannot be parsed.
1126
+ */
1127
+ getRowsPerPage(): Promise<number>;
1128
+ /**
1129
+ * Choose a rows-per-page value by opening the select and picking the option.
1130
+ * @returns `false` when no such option exists.
1131
+ */
1132
+ setRowsPerPage(rowsPerPage: number): Promise<boolean>;
1133
+ /**
1134
+ * The raw "displayed rows" label (e.g. "1–5 of 13"), or `undefined` when absent.
1135
+ * Returned verbatim because its exact format (separator, "of") is locale-defined.
1136
+ */
1137
+ getDisplayedRowsText(): Promise<Optional<string>>;
1138
+ /** Whether the previous-page control is disabled (i.e. on the first page). */
1139
+ isPreviousDisabled(): Promise<boolean>;
1140
+ /** Whether the next-page control is disabled (i.e. on the last page). */
1141
+ isNextDisabled(): Promise<boolean>;
1142
+ /**
1143
+ * An absent control counts as disabled — both to stay consistent with
1144
+ * {@link clickNavButton} (which reports a no-op for a missing control) and
1145
+ * because Playwright's `isDisabled` throws on a zero-match locator rather than
1146
+ * returning false the way jsdom does.
1147
+ */
1148
+ private isNavDisabled;
1149
+ /**
1150
+ * Advance to the next page unless the control is disabled (last page).
1151
+ * @returns whether the click was performed.
1152
+ */
1153
+ nextPage(): Promise<boolean>;
1154
+ /**
1155
+ * Go back to the previous page unless the control is disabled (first page).
1156
+ * @returns whether the click was performed.
1157
+ */
1158
+ previousPage(): Promise<boolean>;
1159
+ private clickNavButton;
1160
+ get driverName(): string;
1161
+ }
1162
+ //#endregion
1163
+ //#region src/components/TabDriver.d.ts
1164
+ /**
1165
+ * Driver for a single Material UI v9 Tab.
1166
+ *
1167
+ * A `<Tab>` renders as a `<button role="tab">`; MUI marks the active one with
1168
+ * `aria-selected="true"` and renders a real `disabled` button when disabled, so
1169
+ * selection and disabled state are read straight off the accessible attributes
1170
+ * (`isDisabled` is inherited from {@link HTMLButtonDriver}; `getText`/`click` from
1171
+ * the base `ComponentDriver`).
1172
+ *
1173
+ * Unlike a toggle button this is intentionally not an `IToggleDriver`: a tab can
1174
+ * be selected but not toggled off (selecting another tab deselects it), so only
1175
+ * `isSelected`/`select` are exposed.
1176
+ * @see https://mui.com/material-ui/react-tabs/
1177
+ */
1178
+ declare class TabDriver extends HTMLButtonDriver {
1179
+ /**
1180
+ * Whether this tab is the selected one, i.e. MUI set `aria-selected="true"`.
1181
+ */
1182
+ isSelected(): Promise<boolean>;
1183
+ /**
1184
+ * Activate this tab by clicking it, unless it is already selected. A selected
1185
+ * tab cannot be toggled off, so this is a no-op when already active.
1186
+ */
1187
+ select(): Promise<void>;
1188
+ get driverName(): string;
1189
+ }
1190
+ //#endregion
1191
+ //#region src/components/TabsDriver.d.ts
1192
+ /**
1193
+ * Tabs are located by their accessible `role="tab"` children rather than by MUI
1194
+ * class names, so the driver is resilient to MUI styling/version changes.
1195
+ */
1196
+ declare const defaultTabsDriverOption: ListComponentDriverSpecificOption<TabDriver>;
1197
+ type TabsDriverOption<ItemT extends TabDriver> = ListComponentDriverSpecificOption<ItemT> & Partial<IComponentDriverOption<any>>;
1198
+ /**
1199
+ * Driver for the Material UI v9 Tabs component.
1200
+ *
1201
+ * `<Tabs>` renders a `role="tablist"` whose `role="tab"` buttons carry the
1202
+ * selected (`aria-selected`) and disabled state. This driver is a
1203
+ * {@link ListComponentDriver} over those tabs, exposing both group-level helpers
1204
+ * (selected index/label, select by index/label) and per-tab {@link TabDriver}
1205
+ * instances via `getItems`/`getItemByIndex`/`getItemByLabel`.
1206
+ * @see https://mui.com/material-ui/react-tabs/
1207
+ */
1208
+ declare class TabsDriver<ItemT extends TabDriver = TabDriver> extends ListComponentDriver<ItemT> {
1209
+ constructor(locator: PartLocator, interactor: Interactor, option?: Partial<TabsDriverOption<ItemT>>);
1210
+ /**
1211
+ * The visible label of every tab, in DOM order.
1212
+ */
1213
+ getTabLabels(): Promise<string[]>;
1214
+ /**
1215
+ * The number of tabs in the group.
1216
+ */
1217
+ getTabCount(): Promise<number>;
1218
+ /**
1219
+ * Zero-based index of the selected tab, or `-1` when no tab is selected
1220
+ * (e.g. `<Tabs value={false}>`).
1221
+ */
1222
+ getSelectedIndex(): Promise<number>;
1223
+ /**
1224
+ * Label of the selected tab, or `null` when no tab is selected. Returns `null`
1225
+ * (not `undefined`) to match the sibling `SelectDriver.getSelectedLabel` contract.
1226
+ */
1227
+ getSelectedLabel(): Promise<Nullable<string>>;
1228
+ /**
1229
+ * Select the tab at the given zero-based index.
1230
+ * @returns `false` when the index is out of range.
1231
+ */
1232
+ selectByIndex(index: number): Promise<boolean>;
1233
+ /**
1234
+ * Select the first tab whose visible label equals `label`.
1235
+ * @returns `false` when no tab matches.
1236
+ */
1237
+ selectByLabel(label: string): Promise<boolean>;
1238
+ /**
1239
+ * Whether the tab at the given index is disabled.
1240
+ * @returns `false` when the index is out of range.
1241
+ */
1242
+ isTabDisabled(index: number): Promise<boolean>;
1243
+ get driverName(): string;
1244
+ }
1245
+ //#endregion
1246
+ //#region src/components/TextFieldDriver.d.ts
1247
+ declare const parts: {
1248
+ label: {
1249
+ locator: import("@atomic-testing/core").CssLocator;
1250
+ driver: typeof HTMLElementDriver;
1251
+ };
1252
+ helperText: {
1253
+ locator: import("@atomic-testing/core").CssLocator;
1254
+ driver: typeof HTMLElementDriver;
1255
+ };
1256
+ singlelineInput: {
1257
+ locator: import("@atomic-testing/core").CssLocator;
1258
+ driver: typeof HTMLTextInputDriver;
1259
+ };
1260
+ multilineInput: {
1261
+ locator: import("@atomic-testing/core").CssLocator;
1262
+ driver: typeof HTMLTextInputDriver;
1263
+ };
1264
+ selectInput: {
1265
+ locator: import("@atomic-testing/core").CssLocator;
1266
+ driver: typeof SelectDriver;
1267
+ };
1268
+ richSelectInputDetect: {
1269
+ locator: import("@atomic-testing/core").CssLocator;
1270
+ driver: typeof HTMLElementDriver;
1271
+ };
1272
+ nativeSelectInputDetect: {
1273
+ locator: import("@atomic-testing/core").CssLocator;
1274
+ driver: typeof HTMLElementDriver;
1275
+ };
1276
+ };
1277
+ /**
1278
+ * A driver for the Material UI v9 TextField component with single line or multiline text input.
1279
+ */
1280
+ declare class TextFieldDriver extends ComponentDriver<typeof parts> implements IInputDriver<string | null> {
1281
+ constructor(locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>);
1282
+ private getInputType;
1283
+ getValue(): Promise<string | null>;
1284
+ setValue(value: string | null): Promise<boolean>;
1285
+ getLabel(): Promise<Optional<string>>;
1286
+ getHelperText(): Promise<Optional<string>>;
1287
+ isDisabled(): Promise<boolean>;
1288
+ isReadonly(): Promise<boolean>;
1289
+ get driverName(): string;
1290
+ }
1291
+ //#endregion
1292
+ //#region src/components/ToggleButtonDriver.d.ts
1293
+ declare class ToggleButtonDriver extends ButtonDriver implements IToggleDriver {
1294
+ isSelected(): Promise<boolean>;
1295
+ setSelected(targetState: boolean): Promise<void>;
1296
+ get driverName(): string;
1297
+ }
1298
+ //#endregion
1299
+ //#region src/components/ToggleButtonGroupDriver.d.ts
1300
+ declare class ToggleButtonGroupDriver extends ComponentDriver implements IInputDriver<readonly string[]> {
1301
+ protected itemLocator: import("@atomic-testing/core").PartLocator;
1302
+ /**
1303
+ * Get all the selected toggle buttons' values.
1304
+ * @returns
1305
+ */
1306
+ getValue(): Promise<readonly string[]>;
1307
+ /**
1308
+ * Toggle all the toggle buttons such that only those with value in the given array are selected.
1309
+ * @param value Always true
1310
+ * @returns
1311
+ */
1312
+ setValue(value: readonly string[]): Promise<boolean>;
1313
+ get driverName(): string;
1314
+ }
1315
+ /**
1316
+ * A toggle button group driver that only allows a single selection.
1317
+ *
1318
+ * INTENTIONAL @ts-ignore comments below: This class intentionally narrows the return type
1319
+ * from `readonly string[]` to `string | null` for exclusive selection mode. TypeScript
1320
+ * correctly flags this as a type incompatibility because the subclass changes the interface
1321
+ * contract. However, this design is intentional as exclusive and multi-select toggle groups
1322
+ * have fundamentally different value semantics, and we want the type system to reflect
1323
+ * `string | null` for exclusive mode rather than forcing consumers to work with arrays.
1324
+ */
1325
+ declare class ExclusiveToggleButtonGroupDriver extends ToggleButtonGroupDriver implements IInputDriver<string | null> {
1326
+ getValue(): Promise<string | null>;
1327
+ setValue(value: string | null): Promise<boolean>;
1328
+ get driverName(): string;
1329
+ }
1330
+ //#endregion
1331
+ //#region src/components/TooltipDriver.d.ts
1332
+ /**
1333
+ * Driver for the Material UI v9 Tooltip component.
1334
+ *
1335
+ * The driver is rooted at the **trigger** element. MUI shows the tooltip on
1336
+ * hover/focus and renders it into a portal (a `role="tooltip"` popper) outside the
1337
+ * trigger's subtree, so the text is read from the document root via
1338
+ * {@link tooltipLocator} after revealing it. The tooltip unmounts when not shown,
1339
+ * so presence of that element doubles as the visible state.
1340
+ *
1341
+ * Note: hover reveal depends on the tooltip's `enterDelay`; with a non-zero delay
1342
+ * the reveal is timer-bound. {@link getTitle} waits for the tooltip to appear.
1343
+ * @see https://mui.com/material-ui/react-tooltip/
1344
+ */
1345
+ declare class TooltipDriver extends ComponentDriver {
1346
+ /**
1347
+ * Reveal the tooltip by hovering its trigger, waiting until it is shown (or the
1348
+ * timeout elapses, e.g. when the trigger has no tooltip).
1349
+ */
1350
+ show(timeoutMs?: number): Promise<void>;
1351
+ /**
1352
+ * Hide the tooltip by moving the pointer off its trigger, waiting until it is gone.
1353
+ */
1354
+ hide(timeoutMs?: number): Promise<void>;
1355
+ /**
1356
+ * Whether a tooltip is currently shown.
1357
+ */
1358
+ isVisible(): Promise<boolean>;
1359
+ /**
1360
+ * Reveal the tooltip, read its text, then restore the un-hovered state. Returns
1361
+ * `undefined` when the trigger has no tooltip (none appears within the timeout).
1362
+ *
1363
+ * The hover is undone before returning so a subsequent read on a *different*
1364
+ * trigger isn't shadowed by this still-open tooltip: MUI renders all tooltips into
1365
+ * one portal and provides no per-trigger DOM link, and jsdom's synthetic hover does
1366
+ * not fire `mouseout` on the previously-hovered sibling.
1367
+ *
1368
+ * @param timeoutMs How long to wait for the tooltip to appear after hovering.
1369
+ */
1370
+ getTitle(timeoutMs?: number): Promise<Optional<string>>;
1371
+ get driverName(): string;
1372
+ }
1373
+ //#endregion
1374
+ //#region src/errors/MenuItemDisabledError.d.ts
1375
+ declare const MenuItemDisabledErrorId = "MenuItemDisabledError";
1376
+ declare class MenuItemDisabledError extends ErrorBase {
1377
+ readonly label: string;
1378
+ readonly driver: ComponentDriver<any>;
1379
+ constructor(label: string, driver: ComponentDriver<any>);
1380
+ }
1381
+ //#endregion
1382
+ //#region src/errors/MenuItemNotFoundError.d.ts
1383
+ declare const MenuItemNotFoundErrorId = "MenuItemNotFoundError";
1384
+ declare class MenuItemNotFoundError extends ErrorBase {
1385
+ readonly label: string;
1386
+ readonly driver: ComponentDriver<any>;
1387
+ constructor(label: string, driver: ComponentDriver<any>);
1388
+ }
1389
+ //#endregion
1390
+ export { AccordionDriver, AlertDriver, AutoCompleteDriver, type AutoCompleteDriverOption, type AutoCompleteDriverSpecificOption, type AutoCompleteMatchType, AvatarDriver, AvatarGroupDriver, BadgeDriver, BottomNavigationActionDriver, type BottomNavigationActionInfo, BottomNavigationDriver, ButtonDriver, CheckboxDriver, ChipDriver, DialogDriver, type DrawerAnchor, DrawerDriver, ExclusiveToggleButtonGroupDriver, FabDriver, InputDriver, ListDriver, ListItemDriver, MenuDriver, MenuItemDisabledError, MenuItemDisabledErrorId, MenuItemDriver, MenuItemNotFoundError, MenuItemNotFoundErrorId, OverlayDriver, PaginationDriver, ProgressDriver, RadioDriver, RadioGroupDriver, RatingDriver, SelectDriver, SliderDriver, SnackbarDriver, SpeedDialDriver, type StepInfo, StepperDriver, SwitchDriver, TabDriver, TableCellDriver, TableDriver, TablePaginationDriver, TableRowDriver, type TableSortDirection, TabsDriver, TextFieldDriver, ToggleButtonDriver, ToggleButtonGroupDriver, TooltipDriver, defaultAutoCompleteDriverOption, defaultAvatarGroupDriverOption, defaultRadioGroupDriverOption, defaultTableDriverOption, defaultTableRowDriverOption, defaultTabsDriverOption, drawerParts };
1391
+ //# sourceMappingURL=index.d.mts.map