Skip to content

test(combobox-web): add keyboard, multi selection and a11y e2e specs - #2501

Merged
r0b1n merged 1 commit into
mainfrom
test/combobox-e2e-coverage
Oct 29, 2026
Merged

r0b1n merged 1 commit into
mainfrom
test/combobox-e2e-coverage

Conversation

@r0b1n

@r0b1n r0b1n commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Pull request type

Test related change (New E2E test, test automation, etc.)


Description

Widens the combobox E2E safety net before the UI rewrite (see #2499 for the unit-level net). The existing suite checked each data source family with screenshots, chip keyboard handling, onChange and menu positioning, but selected options only by mouse click and asserted no ARIA state. The rewrite will replace the rendering, so the behaviour that only a real browser shows needed to be pinned first.

New specs, 28 → 55 cases, all green locally against the combobox-web-atlas4 test project (run twice in a row):

  • ComboboxKeyboardNavigation.spec.js (single select): ArrowDown/ArrowUp/Enter, Home/End, typing into a closed combobox, Tab and click-outside closing with the filter text dropped and the selection kept, the no-options placeholder, the clear button.
  • ComboboxMultiSelection.spec.js: opening with no highlight, Space and Enter toggling with the menu kept open, option clicks, the clear button, row click mode moving options to chips and back, accessible remove buttons.
  • ComboboxMenuFeatures.spec.js (City overview, data view driven by grid selection): the unavailable placeholder until a row is selected, starts-with filtering, custom option content, filtering switched off, the select-all header with its mixed state, and the menu footer keeping the menu open.
  • ComboboxAccessibility.spec.js: the combobox pattern attributes (role, aria-expanded, aria-controls, aria-labelledby, aria-activedescendant, aria-selected), accessible names of the clear and remove controls, the disabled read-only state, and an axe scan closed and open.

Page object changes (e2e/utils/Combobox.pageObject.js, API used by OnChange.spec.js kept):

  • The filter input is located by role=combobox: a bare input locator also matches the checkbox inside every option once a multi-select menu is open.
  • Clear and remove controls are located by accessible name instead of class and index.
  • open() clicks the arrow (the earlier .widget-combobox click did not open the popup widgets) and waits for the first option, because keys pressed during the first lazy load are lost.
  • Locators prefer roles and ARIA so the specs survive the class rename planned for the rewrite.

Widget issues found while writing these specs (not fixed here)

  1. Clear button click lost with the menu open (boxes style, pinned as test.fixme in ComboboxMultiSelection.spec.js). At the default 1280px viewport two chips push the focused filter input onto a second line. Pressing the mouse on the clear button blurs the input, the input collapses to 0px (max-width: 0 while empty and unfocused), the row reflows, the button shrinks under the cursor and the mouseup lands on the input container. The click then toggles the menu instead of clearing. Users see a clear button that needs two clicks.
  2. Keys during the first lazy load are lost. The first open shows the spinner for about 20 ms locally (longer on a real server). ArrowDown in that window leaves nothing highlighted and Enter closes the menu, because downshift acts on an empty item list.
  3. Intermittent lost deselect click (checkbox style). Select A, select B, click A again: about one in three times A stays selected, the second click works. Mouse events arrive normally; no root cause found, so no test was written for it.
  4. Focus falls to the document body after a chip is removed with the mouse in row click mode.
  5. Observed once, not reproduced in isolation: the select-all checkbox stayed in the mixed state after the selection had been cleared.

Not covered because the test project lacks the configuration: lazy-load paging (every datasource has 6 objects), validation feedback, on enter/leave and filter-input change actions, clearable switched off, database multi selection with boxes.

What should be covered while testing?

Run pnpm e2e in packages/pluggableWidgets/combobox-web. No widget code changes.

Covers behaviour that only a real browser shows and that the upcoming
UI rewrite could break silently: arrow key and Enter selection,
Home/End, typing into a closed combobox, Tab and click-outside closing,
the no-options placeholder, Space/Enter toggling and the clear button
in multi selection, row click chips, the unavailable placeholder,
starts-with filtering, custom option content, filtering switched off,
the select-all header, the menu footer, the ARIA attributes of the
combobox pattern and an axe scan.

The page object now addresses the filter input by role (a bare input
locator also matches the option checkboxes), names the clear and remove
controls by their accessible names, and waits for the first option
after opening because keys pressed while the first lazy load is in
flight are lost.

One test is pinned as fixme: clearing a boxes style multi selection
while the menu is open loses the click at the default viewport, because
the filter input collapses on blur and the row reflows under the cursor.
@r0b1n
r0b1n requested a review from a team as a code owner October 29, 2026 12:11
@github-actions

Copy link
Copy Markdown
Contributor

AI Code Review

✅ Approved — no issues found


What was reviewed

File Change
packages/pluggableWidgets/combobox-web/e2e/ComboboxAccessibility.spec.js New spec for ARIA attributes, accessible names, the disabled state and an axe scan
packages/pluggableWidgets/combobox-web/e2e/ComboboxKeyboardNavigation.spec.js New single-select keyboard spec
packages/pluggableWidgets/combobox-web/e2e/ComboboxMultiSelection.spec.js New multi-select spec, including one test.fixme for a known widget bug
packages/pluggableWidgets/combobox-web/e2e/ComboboxMenuFeatures.spec.js New spec for menu features: filtering, select-all, footer, custom option content
packages/pluggableWidgets/combobox-web/e2e/utils/Combobox.pageObject.js Locators now use roles and accessible names. open() clicks the arrow and waits for the first option.

Skipped (out of scope): none

CI: pending: Run code quality check, Plan E2E matrix, sigridci · unrelated failures: security/snyk (external scanner, and no widget code changed)


Positives

  • The specs import from @mendix/run-e2e/fixtures. A search of the diff found no waitForTimeout, networkidle, manual logout or toHaveScreenshot.
  • Locators are role- and ARIA-based, so they should survive the planned class rename. The page-object API that OnChange.spec.js uses is unchanged.
  • The widget bug the PR found is recorded as a test.fixme with a documented cause, and the other issues are described in the PR. No widget code was changed. No changelog entry is needed for a tests-only change.

@r0b1n
r0b1n merged commit 8f21067 into main Oct 29, 2026
13 of 14 checks passed
@r0b1n
r0b1n deleted the test/combobox-e2e-coverage branch October 29, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants