Skip to content

[test-helpers] Add EuiAccordionObject - #10003

Merged
steliosmavro merged 7 commits into
elastic:mainfrom
steliosmavro:stelios/test-helpers-accordion
Sep 7, 2026
Merged

steliosmavro merged 7 commits into
elastic:mainfrom
steliosmavro:stelios/test-helpers-accordion

Conversation

@steliosmavro

@steliosmavro steliosmavro commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds EuiAccordionObject, a Playwright Component Object for EuiAccordion, following the package's CONTRIBUTING guide.

No live Scout consumer exists yet, so this is Storybook-validated only, same as the other recent helpers.

Context

Unlike the last several helpers, this one is not backed by a specific duplicated-logic finding. aria-expanded on the trigger already reflects open state synchronously, no wait or poll needed, and there is no ambiguous or missing selector to hide. This is scoped as a minimal getter-only wrapper as part of moving toward broader EUI component coverage over time, per team direction, rather than a response to a specific audit finding the way EuiModal/EuiFlyout/EuiPopover were.

Update: nested accordions

Weronika found that trigger/content used a plain descendant search (.locator(...)), which also matched a nested EuiAccordion inside content, throwing a Playwright strict-mode violation. Fixed by scoping both to direct children (> selector) of the root instead, so a nested accordion never matches this instance's own elements. Added a NestedAccordion story and a spec that reproduces the old failure (2 matches) and confirms the fix (1).

API

  • trigger: a Locator for the trigger button.
  • content: a Locator for the children wrapper, scoped to the instance.

Both read by their stable class (euiAccordion__button, euiAccordion__childWrapper) rather than a data-test-subj, since EUI sets neither.

Deliberately excluded from v1

  • Waiting for the open/close transition: while closed, content is height: 0 with opacity: 0, so Playwright already treats its contents as not visible and auto-waits. Only the brief opening transition is not fully covered by its actionability checks. No consumer has hit this; noted in the README rather than solved speculatively.

Testing

tsc --noEmit clean. 3 Playwright validation specs pass against Storybook (Layout/EuiAccordion, Playground story), 18/18 on a repeat-6 flake check. Also ran the full package suite (87 specs), all green.

Playwright Component Object for EuiAccordion, following the package
CONTRIBUTING guide. No live Scout consumer exists yet, so this is
Storybook-validated only.

Minimal getter API, per direction to move toward covering common EUI
components even where the object is a thin wrapper: trigger (aria-expanded
reflects open state synchronously, no wait needed) and content, both scoped
to the instance via stable classes rather than a data-test-subj EUI does not
set on either.
@steliosmavro
steliosmavro marked this pull request as ready for review September 4, 2026 14:23
@steliosmavro
steliosmavro requested a review from a team as a code owner September 4, 2026 14:23
@steliosmavro steliosmavro self-assigned this Sep 4, 2026

@weronikaolejniczak weronikaolejniczak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blocking:

This PR doesn't consider nested accordions (and we have such in e.g. kbn-grouping).

.euiAccordion                    <!-- parent, data-test-subj -->
  > .euiAccordion__triggerWrapper > .euiAccordion__button
  > .euiAccordion__childWrapper
      .euiAccordion              <!-- child -->
        .euiAccordion__button    <!-- also matches -->

In Playwright strict mode this throws because it matches multiple elements.

We can also add a new story along the lines of "Nested accordion" so that we can test the helpers against it.

steliosmavro and others added 3 commits September 7, 2026 12:57
Per review: a nested EuiAccordion inside content matched the same class
selectors and threw a Playwright strict-mode violation. trigger and content
now use a direct-child (>) selector instead of a plain descendant search, so
a nested accordion's own elements never match this instance's.

Adds a NestedAccordion story to validate against, per the suggestion, and a
spec that fails against the old selectors (2 matches instead of 1) and
passes against the fix.
@weronikaolejniczak weronikaolejniczak added the skip-changelog-eui Use on PRs to skip changelog requirement (for @elastic/eui) label Sep 7, 2026

@weronikaolejniczak weronikaolejniczak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🟢

@steliosmavro
steliosmavro enabled auto-merge (squash) September 7, 2026 10:34
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @steliosmavro

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @steliosmavro

@steliosmavro
steliosmavro merged commit 8517a3e into elastic:main Sep 7, 2026
7 checks passed
Dosant added a commit to elastic/kibana that referenced this pull request Sep 11, 2026
Part of elastic/eui-private#766

Staged commits cherry-picked from:
- #287310
- #288418
- #235177

## Dependency updates

`@elastic/eui` - 120.0.0 ⏩ 121.0.0
`@elastic/eui-test-helpers` - 1.5.0-snapshot ⏩ 1.6.0

> [!WARNING]
> `EuiHeaderLogo`: `iconType` is removed and `children` text is no
longer rendered. Use `logoType` (`glyph` or `horizontal`). Staged in
#288418.

Also in this PR:
- `EuiButtonGroup` Children API migrations and snapshot updates from
#287310
- New i18n token `euiTimeWindowButtons.label` (`Time window controls`)

## Package updates

### `@elastic/eui`
[v121.0.0](https://github.com/elastic/eui/blob/main/packages/eui/changelogs/CHANGELOG_2026.md)

- Added `isDisabled`, `isLoading`, `href`, and `target` props to
`EuiFlyoutMenuAction`.
([#9992](elastic/eui#9992))
- Updated `onClick` on `EuiFlyoutMenuAction` to be optional, so actions
can navigate via `href` alone.
([#9992](elastic/eui#9992))
- Added `tableSparkles` icon
([#9987](elastic/eui#9987))
- Updated styles of `EuiFilterButton`
([#9961](elastic/eui#9961))
- Updated `EuiFilterGroup`
([#9961](elastic/eui#9961))
    - Updated styles
- Added `display` prop (values: `'regular' | 'highlighted'`) to render
different visual toggle variants
- Added `showDividers` prop to optionally render dividers between group
children
- Updated `EuiSplitButton` disabled styles
([#9986](elastic/eui#9986))
- Updated styles on `EuiButtonGroup` with legacy Options API
([#9953](elastic/eui#9953))
- Updated usages of `EuiButtonGroup` in `EuiDataGrid`'s display selector
and column sorting to use the Children API
([#9953](elastic/eui#9953))
- Updated `EuiSuperDatePicker`'s time window buttons to use
`EuiButtonGroup` with Children API
([#9953](elastic/eui#9953))

**Bug fixes**

- Fixed `EuiPopoverTitle` and `EuiPopoverFooter` backgrounds not
following the popover panel's corner radius
([#9985](elastic/eui#9985))
- Fixed `EuiFlyoutBody` content becoming inaccessible at short viewport
heights ([#9944](elastic/eui#9944))

**Deprecations**

- Deprecated `options` on `EuiButtonGroup` - Use the new Children API
via `children` prop instead.
([#9953](elastic/eui#9953))
- Deprecated `color` on `EuiButtonGroup` - `color` will be fixed to
`text` in the future.
([#9953](elastic/eui#9953))
- Deprecated `buttonSize="compressed"` on `EuiButtonGroup` - Renders as
`buttonSize="s"` instead.
([#9953](elastic/eui#9953))

**Breaking changes**

- Added a new `logoType` prop to `EuiHeaderLogo` to render either the
`glyph` or `horizontal` Elastic logo. The `iconType` prop has been
removed, and `children` text content is no longer rendered.
([#9875](elastic/eui#9875))

### `@elastic/eui-test-helpers`
[v1.6.0](https://github.com/elastic/eui/blob/main/packages/test-helpers/changelogs/CHANGELOG_2026.md)

- Added `EuiPopoverObject`, a Playwright Component Object for
`EuiPopover` ([#9993](elastic/eui#9993))
- Added `EuiFlyoutObject`, a Playwright Component Object for `EuiFlyout`
([#9994](elastic/eui#9994))
- Added `EuiModalObject`, a Playwright Component Object for
`EuiModal`/`EuiConfirmModal`
([#10002](elastic/eui#10002))
- Added `EuiAccordionObject`, a Playwright Component Object for
`EuiAccordion` ([#10003](elastic/eui#10003))

**Bug fixes**

- Fixed `EuiComboBoxObject.clear()` and `setSelectedOptions()` timing
out on `singleSelection` combo boxes, whose pills have no close button
([#9998](elastic/eui#9998))

---------

Co-authored-by: Lene Gadewoll <[email protected]>
Co-authored-by: JoseLuisGJ <[email protected]>
ppisljar pushed a commit to ppisljar/kibana that referenced this pull request Sep 21, 2026
Part of elastic/eui-private#766

Staged commits cherry-picked from:
- elastic#287310
- elastic#288418
- elastic#235177

## Dependency updates

`@elastic/eui` - 120.0.0 ⏩ 121.0.0
`@elastic/eui-test-helpers` - 1.5.0-snapshot ⏩ 1.6.0

> [!WARNING]
> `EuiHeaderLogo`: `iconType` is removed and `children` text is no
longer rendered. Use `logoType` (`glyph` or `horizontal`). Staged in
elastic#288418.

Also in this PR:
- `EuiButtonGroup` Children API migrations and snapshot updates from
elastic#287310
- New i18n token `euiTimeWindowButtons.label` (`Time window controls`)

## Package updates

### `@elastic/eui`
[v121.0.0](https://github.com/elastic/eui/blob/main/packages/eui/changelogs/CHANGELOG_2026.md)

- Added `isDisabled`, `isLoading`, `href`, and `target` props to
`EuiFlyoutMenuAction`.
([elastic#9992](elastic/eui#9992))
- Updated `onClick` on `EuiFlyoutMenuAction` to be optional, so actions
can navigate via `href` alone.
([elastic#9992](elastic/eui#9992))
- Added `tableSparkles` icon
([elastic#9987](elastic/eui#9987))
- Updated styles of `EuiFilterButton`
([elastic#9961](elastic/eui#9961))
- Updated `EuiFilterGroup`
([elastic#9961](elastic/eui#9961))
    - Updated styles
- Added `display` prop (values: `'regular' | 'highlighted'`) to render
different visual toggle variants
- Added `showDividers` prop to optionally render dividers between group
children
- Updated `EuiSplitButton` disabled styles
([elastic#9986](elastic/eui#9986))
- Updated styles on `EuiButtonGroup` with legacy Options API
([elastic#9953](elastic/eui#9953))
- Updated usages of `EuiButtonGroup` in `EuiDataGrid`'s display selector
and column sorting to use the Children API
([elastic#9953](elastic/eui#9953))
- Updated `EuiSuperDatePicker`'s time window buttons to use
`EuiButtonGroup` with Children API
([elastic#9953](elastic/eui#9953))

**Bug fixes**

- Fixed `EuiPopoverTitle` and `EuiPopoverFooter` backgrounds not
following the popover panel's corner radius
([elastic#9985](elastic/eui#9985))
- Fixed `EuiFlyoutBody` content becoming inaccessible at short viewport
heights ([elastic#9944](elastic/eui#9944))

**Deprecations**

- Deprecated `options` on `EuiButtonGroup` - Use the new Children API
via `children` prop instead.
([elastic#9953](elastic/eui#9953))
- Deprecated `color` on `EuiButtonGroup` - `color` will be fixed to
`text` in the future.
([elastic#9953](elastic/eui#9953))
- Deprecated `buttonSize="compressed"` on `EuiButtonGroup` - Renders as
`buttonSize="s"` instead.
([elastic#9953](elastic/eui#9953))

**Breaking changes**

- Added a new `logoType` prop to `EuiHeaderLogo` to render either the
`glyph` or `horizontal` Elastic logo. The `iconType` prop has been
removed, and `children` text content is no longer rendered.
([elastic#9875](elastic/eui#9875))

### `@elastic/eui-test-helpers`
[v1.6.0](https://github.com/elastic/eui/blob/main/packages/test-helpers/changelogs/CHANGELOG_2026.md)

- Added `EuiPopoverObject`, a Playwright Component Object for
`EuiPopover` ([elastic#9993](elastic/eui#9993))
- Added `EuiFlyoutObject`, a Playwright Component Object for `EuiFlyout`
([elastic#9994](elastic/eui#9994))
- Added `EuiModalObject`, a Playwright Component Object for
`EuiModal`/`EuiConfirmModal`
([elastic#10002](elastic/eui#10002))
- Added `EuiAccordionObject`, a Playwright Component Object for
`EuiAccordion` ([elastic#10003](elastic/eui#10003))

**Bug fixes**

- Fixed `EuiComboBoxObject.clear()` and `setSelectedOptions()` timing
out on `singleSelection` combo boxes, whose pills have no close button
([elastic#9998](elastic/eui#9998))

---------

Co-authored-by: Lene Gadewoll <[email protected]>
Co-authored-by: JoseLuisGJ <[email protected]>
weronikaolejniczak pushed a commit to boriskirov/eui that referenced this pull request Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog-eui Use on PRs to skip changelog requirement (for @elastic/eui)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants