feat(web): Playwright E2E suite with CI integration#76
feat(web): Playwright E2E suite with CI integration#76
Conversation
Implements ADR-0008. Adds smoke and indicator-picker specs covering the v0.2 happy paths (OAuth PKCE → chart render, picker modal add/remove/persistence). Playwright's webServer config launches chartgen --serve and the Vite dev server as fixtures so the suite is self-contained. CI job `e2e` builds the release binary, installs Chromium, runs the suite, uploads playwright-report on failure. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 34 minutes and 26 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (11)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Implements ADR-0008.
Summary
Adds a Playwright browser E2E suite to
web/tests/e2e/plus a new CI job that runs it against the real release binary. Closes the manual-verification gap at merge time for the frontend's OAuth + chart + picker flows.Two specs:
smoke.spec.ts— cold-boot happy path:/→ OAuth PKCE redirect via:9315/authorize→ back to/?code=…&state=…→ token exchange → click Load → klinecharts canvas renders with non-zero dimensions and an RSI.pane-header. Asserts zero console errors throughout.indicator-picker.spec.ts— Kobalte Dialog open, search filter, add a non-RSI indicator, close modal, chip appears, chart refetches (scoped toPOST /mcpwithmethod=tools/call, params.name=generate_chart), reload — chip persists via localStorage, click Load, remove chip → chart refetches again, chip gone.Playwright's
webServerconfig (array form, supported since 1.31) launchescargo run --release -- --serveandnpm run devas managed fixtures so the suite is self-contained.reuseExistingServer: !process.env.CI. Chartgen gets a 180s startup timeout to tolerate a cold release build on CI;Swatinem/rust-cachekeeps it fast in practice.CI
New
e2ejob in.github/workflows/ci.yml, gated onbuild-release. Caches~/.cache/ms-playwright, runsnpx playwright install --with-deps chromiumthennpx playwright test. Uploadsplaywright-report/andtest-results/as artifacts on failure (7-day retention).Single worker because chartgen's OAuth store is process-global; concurrent PKCE flows would collide on state. One retry in CI to absorb first-run OAuth redirect timing.
Out of scope (deferred — see ADR)
Known limitations
Dynamic multi-indicator rendering is blocked on
fix/web-dynamic-indicators-and-layout— the currentChart.tsxonly renders RSI. Tests scope around observable state (chips,POST /mcprefetch, localStorage persistence) rather than chart-visual assertions for non-RSI indicators. The smoke test does assert the RSI.pane-headeris visible because RSI is the one indicator that's hardcoded into the chart today.Verification
cd web && npm install && npm run build— passes.cd web && npx playwright install chromium && npx playwright test— both specs pass locally in the agent environment (~6s total with warm servers).cd web && npx playwright test --list— 2 tests discovered across 2 files.cd website && npm install && npm run build— ADR-0008 andguides/testing.mdrender cleanly../scripts/gen-mcp-types.sh— no drift.coderabbit review --plain— addressed 3 findings (canvas size poll, storage-clear logging, narrower MCP response predicates). Final run to confirm zero findings hit the rate limit; re-running after merge.Test plan
e2ejob passes on Chromiumnpm run e2e:uiworks for debugging🤖 Generated with Claude Code