Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b8c1b98
[LKPR-140] chore: add ticket and implementation plan
Jul 24, 2026
71a1a86
[LKPR-140] fix: restore AppShell composition + memories replaceState
Jul 24, 2026
b41e82e
[LKPR-140] fix: guard syncUrl replaceState against pre-router-init throw
Jul 24, 2026
23ef022
[LKPR-140] fix: memories row id mapping so detail drawer opens
Jul 24, 2026
b0f4b5e
[LKPR-140] fix: reset seed data dir for idempotent E2E seeding
Jul 24, 2026
b2934db
[LKPR-140] test: fix query spec races and stale selectors
Jul 24, 2026
5276638
[LKPR-140] test: hover a heatmap cell with data for tooltip assertion
Jul 24, 2026
940a46a
[LKPR-140] test: wait for hydration before clicking Reviewed tab
Jul 24, 2026
7aca3eb
[LKPR-140] test: click hydrated rows (tbody tr.clickable) for drawer …
Jul 24, 2026
cbaef5b
[LKPR-140] fix: SessionDrawer is a modal dialog, not complementary
Jul 24, 2026
394fa6d
[LKPR-140] test: press the palette modifier the app actually listens for
Jul 24, 2026
f38edba
[LKPR-140] test: raise query result timeout for backend cold start
Jul 24, 2026
592af24
[LKPR-140] test: replace skip-on-empty guards with hard assertions
Jul 24, 2026
b14636b
[LKPR-140] test: dual webServer + API proxy, ports offset off 7777
Jul 24, 2026
9bf3436
[LKPR-140] test: gate @visual regression behind RUN_VISUAL=1
Jul 24, 2026
24f5917
[LKPR-140] ci: add Playwright Dashboard V2 (FE+BE) job
Jul 24, 2026
ceb1f93
[LKPR-140] fix: SessionDrawer uses div, not aside, for dialog role
Jul 24, 2026
0cfd40c
[LKPR-140] test: read RUN_VISUAL off globalThis (no @types/node needed)
Jul 24, 2026
2092600
[LKPR-140] fix: allow source_type in memory PATCH update
Jul 25, 2026
0323af7
[LKPR-140] fix: wire memory drawer save/delete to backend; drop hardc…
Jul 25, 2026
e6f1cf3
[LKPR-140] fix: bridge memory id (id→lore_id) in detail drawer so PAT…
Jul 25, 2026
9e09aff
[LKPR-140] feat: wire Review nav badge to live pending-suggestions count
Jul 25, 2026
17b79c2
[LKPR-140] test: lock in memory-edit persistence and live Review badge
Jul 25, 2026
7035951
[LKPR-140] fix: refresh vector + BM25 cache on memory edit/delete
Jul 27, 2026
bb3b5fb
[LKPR-140] fix: use valid relation types in E2E seed + assert links c…
Jul 27, 2026
d6ff6cf
[LKPR-140] test: regression for search refresh on memory edit/delete
Jul 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -358,3 +358,54 @@ jobs:
HF_HOME: ~/.cache/huggingface
run: |
uv run pytest tests/e2e/ -m e2e --override-ini="addopts=" -v --tb=short

# ── Playwright Dashboard V2 (FE+BE) ──────────────────────────────────────────
playwright-dashboard:
name: Playwright Dashboard V2 (FE+BE)
runs-on: ubuntu-latest
needs: test

steps:
- uses: actions/checkout@v7

- name: Set up Python, uv & dependencies
uses: ./.github/actions/setup-python-uv

- name: Cache & pre-warm HuggingFace model
uses: ./.github/actions/setup-huggingface

- name: Setup Node.js for Dashboard V2
uses: ./.github/actions/setup-node-dashboard-v2

- name: Install Dashboard V2 npm dependencies
working-directory: src/dashboard_v2
run: npm ci --no-audit --no-fund

- name: Install Playwright browsers
working-directory: src/dashboard_v2
run: npx playwright install chromium --with-deps

- name: Run Playwright suite (seeds backend + FE via webServer)
working-directory: src/dashboard_v2
env:
CI: "true"
LORE_DATA_DIR: /tmp/lk-e2e-${{ github.run_id }}
TOKENIZERS_PARALLELISM: "false"
HF_HOME: ~/.cache/huggingface
run: npx playwright test

- name: Upload Playwright report
if: failure()
uses: actions/upload-artifact@v7
with:
name: playwright-report
path: src/dashboard_v2/playwright-report/
retention-days: 7

- name: Upload Playwright test results (traces + screenshots)
if: failure()
uses: actions/upload-artifact@v7
with:
name: playwright-test-results
path: src/dashboard_v2/test-results/
retention-days: 7
86 changes: 86 additions & 0 deletions backlogs/ready/LKPR-140-dashboard-v2-e2e-backend-integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---
id: LKPR-140
title: "Dashboard V2 E2E — Full FE/BE Integration Test Suite"
type: chore
sprint: unplanned
rice_score: ~
filed_by: Jason
filed_date: 2026-07-23
github_issue: 0
---

# [LKPR-140] Dashboard V2 E2E — Full FE/BE Integration Test Suite

## Problem

The Playwright suite added in LKPR-137 is broken for all data-driven tests in CI.

`playwright.config.ts` boots `npm run preview`, which serves only the static SvelteKit bundle with no dev proxy. The FastAPI backend (`/api/health`, `/api/memories`, `/api/config`, `/api/links`, `/api/metrics`, etc.) never starts. Every API call fails silently. Pages fall back to their error/empty-state branches. Tests that depend on real rendered data — Home stat tiles, Memory table rows, Settings sections, visual snapshots — cannot pass. The suite gives false confidence.

Additionally, there is no seeded test data. Even if the API were reachable, data-dependent tests would silently skip via their defensive `test.skip()` guards instead of failing loudly.

## Solution

Wire Playwright to a **real running FE+BE stack**:

1. FastAPI backend starts on port 7778 before any test, pointed at a temp isolated `LORE_DATA_DIR`
2. Vite dev server starts on port 7777 and proxies `/api/*` → backend
3. A `globalSetup` script seeds deterministic fixture data (10 memories, 2 links) via the live API before the suite runs
4. Defensive `test.skip()` guards are removed and replaced with hard `expect()` assertions
5. CI gets a new `playwright-dashboard` job that runs the full suite on every push

No backend code changes are required — existing FastAPI routes are already correct.

## Acceptance Criteria

- [ ] `npx playwright test` passes locally when run from `src/dashboard_v2/` with no manually started backend (webServer handles it)
- [ ] Home page: health ring visible, stat tiles show counts > 0 (real data), activity section visible
- [ ] Memories page: table renders rows from seed data, row click opens detail drawer, edit mode activates, drawer actions (edit/delete) are reachable
- [ ] Settings page: all 4 sections render (Search Weights, Scoring, Search & Links, Memory Lifecycle) with values loaded from backend, unsaved indicator fires on field change, save button triggers success toast (real PATCH to /api/config)
- [ ] Shell: nav rail renders all 6 nav items, breadcrumb updates per route, command palette aria-activedescendant updates on ArrowDown, confirm dialog opens and can be cancelled
- [ ] Sessions / Reflections page: timeline renders with 3 seeded reflections (not empty state)
- [ ] Suggestions / Review page: candidates list renders after sweep (not empty state)
- [ ] Visual snapshot tests capture pages in a fully rendered state (not loading/error branches)
- [ ] CI `playwright-dashboard` job is green on a clean push
- [ ] Playwright HTML report + screenshots uploaded as artifact on job failure
- [ ] Zero `test.skip()` guards that exist solely because "no data in test environment"

## Affected Files

**Dashboard V2:**

- `src/dashboard_v2/vite.config.ts` — add `server.proxy: { '/api': { target: 'http://127.0.0.1:7778' } }`
- `src/dashboard_v2/playwright.config.ts` — replace single webServer with two-entry array; add `globalSetup`
- `src/dashboard_v2/tests/global-setup.ts` — new file, seeds memories + links via REST, shells out to seed.py for reflections + suggestions
- `src/dashboard_v2/tests/seed.py` — new file, inserts 3 reflections + runs suggestion sweep via Python processors directly
- `src/dashboard_v2/tests/memories.spec.ts` — remove defensive test.skip guards

**CI:**

- `.github/workflows/ci.yml` — new `playwright-dashboard` job (needs: test; python+node+HF setup; upload artifact on failure)

## Dependencies

- LKPR-137: must be merged first (provides the test files this ticket wires up)

## Required Updates

- **CLAUDE.md**: [ ] N/A
- **README.md**: [ ] N/A
- **Skills**: [ ] N/A
- **Backlog**: [ ] N/A

## Open Questions

_Resolved 2026-07-23 by Jason:_

- ✅ `globalSetup` should also seed reflections and suggestions
- ✅ Chromium-only in CI for now

## Notes

See full implementation plan: `docs/plans/2026-07-23_081656-lkpr-140-dashboard-v2-e2e-backend-integration.md`

The backend starts at port 7778 (not 7777) so Vite dev owns 7777 and can proxy through. Playwright's `baseURL` stays `http://127.0.0.1:7777` — tests don't need to change.

The `HuggingFace model pre-warm` step in CI is required because the dashboard backend initialises the embedding model on startup (same as the existing `e2e` job).
Loading
Loading