Skip to content

test(e2e): add Playwright smoke suite and accessible names for icon-only controls - #5872

Merged
SteKoe merged 2 commits into
masterfrom
test/e2e-playwright-smoke-suite
Nov 6, 2026
Merged

SteKoe merged 2 commits into
masterfrom
test/e2e-playwright-smoke-suite

Conversation

@SteKoe

@SteKoe SteKoe commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Why

An analysis of the last three years of issues showed a recurring class of regressions that our unit tests can't catch: the assembled application breaks after a release. The UI doesn't load, the sidebar is empty, login/logout fails with a context path, or extension views lose their route. Examples: #4646, #4649, #4831, #4986, #5438, #3828/#3829, #5724, #4259, #4272.

Vitest tests components against mocked responses and JUnit tests the server. Nothing checks that server-rendered HTML, the built bundle, Spring Security, the context path and extensions work together. This PR adds a small, targeted Playwright smoke suite for exactly that. It is not meant to replace unit tests; business logic stays in Vitest/JUnit.

What

1. fix(ui): accessible names for icon-only controls

Several controls had no accessible name. Screen readers announced them as plain "button", and tests had to find them through the DOM structure (xpath=following-sibling::button, :scope > a > button, .hex).

Element Before After
Dropdown chevron of external views with a link unnamed button "Show entries of {label}" (new optional buttonLabel prop on sba-nav-dropdown)
User menu unnamed button "User menu of {name}"
Instance sidebar unnamed <aside> "Instance navigation"
Sidebar group toggles unnamed button "Expand/Collapse {group}" + aria-expanded
Wallboard hexagons clickable <g> with no role role="button", name "{app} ({status})", focusable, Enter/Space
iframe of sidebar links title="Google" URL of the embedded page
iframe of external views no title view label

New strings in en and de; other locales fall back to English. Unit tests added for the user menu name and the group toggles.

2. test(e2e): Playwright smoke suite (spring-boot-admin-e2e/)

  • Starts the packaged servlet sample incl. custom UI in two scenarios:

    • insecure
    • secure: form login + context path /admin
  • 65 tests, about 50 s:

    File Covers
    shell.spec.ts UI and server resources are delivered, applications list, wallboard → details, about page, deep link reload
    instance-views.spec.ts sidebar offers exactly the expected views; one test per view, each waiting for view-specific content
    security.spec.ts redirect to login, wrong password, login → logout → login, deep link after login
    extensions.spec.ts custom views, external view dropdown, iframe views, sidebar links
  • Every UI test fails on uncaught exceptions, console.error and missing scripts/stylesheets.

  • Follows Playwright best practices:

    • session stored once via a setup project (storageState)
    • role/label-based locators only
    • external requests stubbed, no internet access
    • no fixed waits
  • Separate workflow .github/workflows/e2e.yml. Not part of the Maven reactor, so ./mvnw install does not need browsers.

Found while writing the tests

  • Wallboard: hex-mesh.vue renders <path d="M NaN,NaN …"> on first render (probably sideLength = 0 before the first layout pass). Currently ignored in tests/fixtures.ts → follow-up issue.
  • /customSub in the custom-ui sample shows the parent view's content instead of "Hello from the submenu item". The test pins the current behaviour; is this intended?

Open questions for the team

  • Should the E2E job be a required check? My suggestion: informational only for now, then review flakiness and value after ~3 releases (see the [Team discussion] Make tests less fragile #5274 discussion).
  • The changed public component sba-nav-dropdown has a new optional prop buttonLabel. Worth a changelog line.
  • Please try the wallboard keyboard navigation (Tab/Enter) by hand once.

How to test

./mvnw install -DskipTests -pl spring-boot-admin-samples/spring-boot-admin-sample-servlet -am
cd spring-boot-admin-e2e
npm ci && npx playwright install chromium
npm test        # or: npm run test:ui

Locally: full Vitest suite green (608 tests), lint without new warnings, E2E suite green incl. --repeat-each=3 (193 passed).

Several interactive elements had no accessible name, so screen readers
announced them as plain "button" and tests had to locate them via DOM
structure.

- nav dropdown: optional `buttonLabel` prop; used for the chevron of
  external views with a link and for the user menu
- instance sidebar: label the landmark, label group toggles with
  "Expand/Collapse <group>" and expose `aria-expanded`
- wallboard: hexagons get role="button", a name and keyboard support
- iframes: meaningful titles instead of none / "Google"
Unit tests cover components and server logic in isolation, but several
releases shipped a completely broken UI (#4646, #4649, #4831, #5438,
#5724). These tests start the packaged servlet sample and drive it in a
browser.

- two scenarios: insecure, and secure with form login + context path
- shell, every instance view, login/logout and UI extensions
- fail on uncaught exceptions, console errors and missing assets
- session stored once per scenario, external requests stubbed
- separate GitHub workflow, not part of the Maven reactor
@SteKoe
SteKoe marked this pull request as ready for review November 6, 2026 13:39
@SteKoe
SteKoe requested a review from a team as a code owner November 6, 2026 13:39
@SteKoe
SteKoe enabled auto-merge (squash) November 6, 2026 13:43
@SteKoe
SteKoe merged commit c3034e1 into master Nov 6, 2026
2 checks passed
@SteKoe
SteKoe deleted the test/e2e-playwright-smoke-suite branch November 6, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant