Playwright end-to-end test suite#500
Open
otavionvidia wants to merge 3 commits into
Open
Conversation
Introduces an end-to-end test suite under frontend/e2e/ covering chat,
collections, settings, navigation, notifications, accessibility, visual
regression, and an opt-in real-backend smoke suite. Built around a
mocked-API fixture (page.route) so the default run is fast (~13s on
chromium) and deterministic.
Key design choices, aligned with 2026 Playwright best practices:
- Hybrid backend strategy: mocks by default, separate "integration"
project for real-backend validation.
- Page Object Model with user-intent methods over semantic locators.
- Composed waitForAppReady (DOMContentLoaded + networkidle + header
visible) to settle React Query's cascade of /api/health +
/api/configuration + /api/collections requests.
- Global animations-off init script via page.addInitScript so KUI
Popover/SidePanel/Dropdown enter-leave animations don't race
assertions.
- Deterministic streaming control (mockApi.streamChat({ hold: true })
+ releaseChat()) replaces wall-clock delays for stop-button and
streaming-state assertions.
- Selective retries via @flaky tag (retries=0 globally, retries=2 on
the flaky-chromium project) instead of a global retry budget that
masks regressions.
- Auto-retrying expect.toHaveAttribute over one-shot getAttribute.
- Coverage opt-in via E2E_COVERAGE=1 wired through monocart-reporter
with E2E-tier thresholds (50/50/40/25).
Also adds data-testid + aria-label attributes to ~17 frontend
components so the POMs have stable, semantic locators, and a sharded
GitHub Actions workflow (.github/workflows/e2e.yml) with separate
a11y/visual jobs and an opt-in integration job.
Stable, semantic locator contract for the Playwright e2e suite added in the previous commit. These attributes were dropped from that commit by an interaction with the pre-commit auto-stash mechanism during a multi-attempt commit; this commit completes the set so the e2e POMs have the testids they reference. Touches ~16 components across chat, collections, drawer, filtering, layout, and notifications, plus the package.json scripts and the Playwright run-artifact ignore rules in .gitignore. No behavior changes — purely additive testid + aria-label attributes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a comprehensive Playwright end-to-end test suite for the React frontend, plus a CI workflow to run it on every PR. The suite ships 59 tests across 9 spec areas (chat, collections, settings, navigation, notifications, accessibility, visual, integration, error states) with deterministic mocks, Page Object Models, axe-core a11y assertions, and V8 + CSS code coverage via
monocart-reporter.What's included
Test infrastructure (
frontend/e2e/)playwright.config.tswith 6 projects:chromium/webkit(default mocked),flaky-chromium(selective retries for@flaky-tagged tests),firefox(opt-in),visual(screenshots),integration(real backend, opt-in viaE2E_INTEGRATION=1).base.ts,mock-api.ts,coverage.ts,seed-storage.ts,axe.ts) — all responses default to deterministicpage.routemocks; integration mode swaps in a no-op stub.ChatPage,CollectionsPanel,CitationsDrawer,NotificationPanel,SettingsPage, etc.) backed bydata-testidselectors.mockApi.streamChat({ hold: true })+releaseChat()removes timing-based flake. GlobaladdInitScriptdisables CSS animations/transitions in all tests.utils/sse.ts),localStorageseeding helpers.Frontend changes (
frontend/src/)data-testidandaria-labelattributes to ~16 components across chat, collections, notifications, settings, and layout (no behavioral changes).data-testid="collection-drawer"is on an inner<Stack>insideCollectionDrawerrather than the<SidePanel>wrapper, to avoid clobbering KUI's internalnv-side-panel-contenttestid that unit tests rely on.CI (
.github/workflows/e2e.yml)playwright merge-reportsand uploaded as artifacts.COVERAGE_ENFORCE=1.Tooling
e2e,e2e:chromium,e2e:integration,e2e:a11y,e2e:visual,e2e:flaky,e2e:report, …).frontend/.gitignore+frontend/e2e/.gitignoreexcludeplaywright-report/,test-results/,blob-report/.frontend/e2e/README.mddocuments run modes, structure, coverage interpretation, CI behavior, and known caveats.Verification
pnpm e2e:chromium→ 59/59 passing, ~13s wall time on a clean checkout.frontend/e2e/tests/chat/streaming.spec.ts(separateuseSendMessage()instances each create their ownAbortController, so the stop button aborts a different controller than the in-flight fetch — left as a follow-up; the test asserts current behavior).Not included
src/nvidia_rag/), Helm, ordocker-compose.yamlchanges.Checklist
git commit -s) and GPG signed (git commit -S).