You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add Playwright to frontend/ for browser-level end-to-end coverage of the API key management flows, plus automated accessibility checks via @axe-core/playwright. Adds a new e2e-frontend job to .github/workflows/test.yaml so both suites gate every PR alongside the existing Vitest, Go, and Helm jobs.
Motivation
Current frontend coverage is Vitest + Testing Library only (src/**/*.test.tsx) — jsdom, no real browser, no real navigation, no real Keycloak bootstrap path.
The multi-step key lifecycle (create → one-time secret reveal in KeyCreatedDialog → revoke) spans several components and is only verified in isolation today.
src/auth/keycloak.ts already exposes a window.__PW_E2E_AUTH__ injection hook explicitly reserved for Playwright — the auth seam exists but nothing uses it.
No accessibility testing exists at all; the app ships custom dialogs, a theme toggle, and Base UI/Radix primitives whose focus trapping, labeling, and contrast are currently unverified.
Both light and dark themes (ThemeProvider) plus the branding/theming work merged in Branding Support #145 need contrast regression protection.
Real-browser tests catch class of bugs jsdom cannot: focus management, scroll locking, portal rendering, CSS-dependent visibility.
Acceptance Criteria
@playwright/test and @axe-core/playwright added to frontend/devDependencies
frontend/playwright.config.ts created with a webServer block that builds/serves the app (npm run build && npm run preview) and a baseURL matching the preview port
Chromium project configured at minimum; trace: "on-first-retry" and retries set for CI
E2E specs live under frontend/e2e/ and are excluded from the Vitest include glob in vite.config.ts so npm test does not pick them up
Auth is stubbed via page.addInitScript setting window.__PW_E2E_AUTH__ (no live Keycloak in CI)
Backend /api calls stubbed with Playwright page.route fixtures — no live key-manager dependency in CI
E2E spec: keys list renders, including the empty state
E2E spec: create a key via CreateKeyDialog, assert the secret is shown once in KeyCreatedDialog and is copyable
E2E spec: revoke a key via KeyRowActions → RevokeKeyDialog, assert the row updates
E2E spec: API failure path renders ErrorBanner
E2E spec: theme toggle switches light/dark and persists across reload
A11y spec runs AxeBuilder against the main view and each open dialog, asserting zero violations for wcag2a, wcag2aa, and wcag21aa tags
A11y assertions run in both light and dark themes (color-contrast included, not disabled)
Any pre-existing violations are either fixed or recorded in a documented, time-boxed exclusion list rather than silently suppressed
npm run e2e and npm run e2e:ui scripts added to frontend/package.json
e2e-frontend job added to .github/workflows/test.yaml: checkout → actions/setup-node (using frontend/.node-version, npm cache) → npm ci → npx playwright install --with-deps chromium → npm run e2e
Playwright browser binaries cached in CI (keyed on the resolved Playwright version) to keep job time reasonable
playwright-report/, test-results/, and blob-report/ added to frontend/.gitignore
HTML report uploaded via actions/upload-artifact on failure, with the same pinned-SHA convention used by the other workflow steps
Biome config updated so frontend/e2e/ lints clean under npm run check
README.md (or docs/) documents how to run E2E locally, including running against a real key-manager with VITE_DEV_NO_AUTH=true
Out of Scope
Component-level and hook-level unit tests — already covered by Vitest + Testing Library in src/
Go test coverage for operator/ and key-manager/ — handled by the existing test-operator and test-key-manager jobs
Live Keycloak login flow testing (real IdP redirect + PKCE); this issue stubs auth at the __PW_E2E_AUTH__ seam
Cross-browser matrix (Firefox/WebKit) and mobile viewports — Chromium only for now, expandable later
Summary
Add Playwright to
frontend/for browser-level end-to-end coverage of the API key management flows, plus automated accessibility checks via@axe-core/playwright. Adds a newe2e-frontendjob to.github/workflows/test.yamlso both suites gate every PR alongside the existing Vitest, Go, and Helm jobs.Motivation
src/**/*.test.tsx) — jsdom, no real browser, no real navigation, no real Keycloak bootstrap path.KeyCreatedDialog→ revoke) spans several components and is only verified in isolation today.src/auth/keycloak.tsalready exposes awindow.__PW_E2E_AUTH__injection hook explicitly reserved for Playwright — the auth seam exists but nothing uses it.ThemeProvider) plus the branding/theming work merged in Branding Support #145 need contrast regression protection.Acceptance Criteria
@playwright/testand@axe-core/playwrightadded tofrontend/devDependenciesfrontend/playwright.config.tscreated with awebServerblock that builds/serves the app (npm run build && npm run preview) and abaseURLmatching the preview porttrace: "on-first-retry"andretriesset for CIfrontend/e2e/and are excluded from the Vitestincludeglob invite.config.tssonpm testdoes not pick them uppage.addInitScriptsettingwindow.__PW_E2E_AUTH__(no live Keycloak in CI)/apicalls stubbed with Playwrightpage.routefixtures — no livekey-managerdependency in CICreateKeyDialog, assert the secret is shown once inKeyCreatedDialogand is copyableKeyRowActions→RevokeKeyDialog, assert the row updatesErrorBannerAxeBuilderagainst the main view and each open dialog, asserting zero violations forwcag2a,wcag2aa, andwcag21aatagsnpm run e2eandnpm run e2e:uiscripts added tofrontend/package.jsone2e-frontendjob added to.github/workflows/test.yaml: checkout →actions/setup-node(usingfrontend/.node-version, npm cache) →npm ci→npx playwright install --with-deps chromium→npm run e2eplaywright-report/,test-results/, andblob-report/added tofrontend/.gitignoreactions/upload-artifacton failure, with the same pinned-SHA convention used by the other workflow stepsfrontend/e2e/lints clean undernpm run checkREADME.md(ordocs/) documents how to run E2E locally, including running against a realkey-managerwithVITE_DEV_NO_AUTH=trueOut of Scope
src/operator/andkey-manager/— handled by the existingtest-operatorandtest-key-managerjobs__PW_E2E_AUTH__seam