test(e2e): add Playwright persistence happy-path test#2475
test(e2e): add Playwright persistence happy-path test#2475henrypark133 merged 2 commits intostagingfrom
Conversation
Add `test_message_persists_across_page_reload` which validates the full persistence round-trip: send a message via the chat UI, reload the page (clearing all client-side state), switch back to the thread, and verify both user message and assistant response are restored from the database. Cross-checks via the history API that exactly one user turn exists with a completed response. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request introduces a new end-to-end test to ensure that chat messages and assistant responses are correctly persisted and retrieved from the database after a page reload. The review feedback suggests improving test reliability by replacing a hardcoded sleep with a conditional wait and adhering to project conventions by using the centralized selector dictionary for the authentication screen.
There was a problem hiding this comment.
Pull request overview
Adds an end-to-end regression test to ensure chat messages persist across a full browser reload, validating both UI rehydration and server-side history persistence for a single completed turn.
Changes:
- Add
test_message_persists_across_page_reloadPlaywright E2E test covering send → persist → reload → re-render. - Validate persistence via both DOM assertions (user + assistant messages visible) and
/api/chat/historycross-check (single completed user turn).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Replace fixed `wait_for_timeout(2000)` with polling via history API until the turn reaches `Completed` state (avoids CI flakiness) - Use `SEL["auth_screen"]` instead of hardcoded `"#auth-screen"` selector (follows project convention from helpers.py) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Merge staging into feat/rich-tool-history-cards, resolving the test_message_persistence.py conflict (PR's superset version wins over the basic staging version from #2475). Also fix a bug where the processingThreads spinner would persist if a background thread ended with "Interrupted", "Rejected", or "Tool call denied." — only "Done" and "Awaiting approval" were clearing the Set, leaving stale spinners until the next SSE reconnect. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
test_message_persists_across_page_reloadE2E test that validates the full persistence round-trip: send a message, reload the page, verify both user message and assistant response survive from DBTest plan
pytest scenarios/test_message_persistence.py -vpasses locally (10.97s)🤖 Generated with Claude Code