fix(canvas/e2e): assert seeded chat history text, not arbitrary div count #2876
Reference in New Issue
Block a user
Delete Branch "fix/chat-history-assertion-robustness"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #2874 (RC: CR2 #11826 + Researcher #11827).
Problem
The previous
hasHistorycheck usedlocator("div").count() > 3, an arbitrary heuristic that does not actually prove the seeded transcript hydrated.Fix
Replace the heuristic with explicit Playwright visibility assertions for the messages seeded by
seedChatHistory()inbeforeAll:Hello from seedandEcho: Hello from seedare visible.Hello from mobile seedandEcho: Hello from mobile seedare visible.Send a message to start chatting.) is hidden.Path-filter / CI proof
Changes to
canvas/e2e/chat-*.spec.tsalready trigger the E2E Chat lane via thechat-spec-directblock in.gitea/workflows/e2e-chat.yml(landed in #2874). This PR should therefore execute the real Playwright E2E Chat job, not a path-filter no-op.Routing
2-genuine review (CR2 + Researcher). Do not self-merge.
APPROVED on
072676a6.Verified the follow-up removes the brittle
div.count() > 3heuristic and asserts the actual seeded transcript instead. Desktop seedsHello from seed/Echo: Hello from seed; mobile seedsHello from mobile seed/Echo: Hello from mobile seed; each spec now requires those messages visible and the empty placeholder hidden. That matches the fixture and is not an over-constrained conditional case.Verified on actual E2E Chat run 366964 / job 502266: the no-op path-filter step was skipped,
npx playwright test e2e/chat-desktop.spec.ts e2e/chat-mobile.spec.ts e2e/chat-separation.spec.tsexecuted, 26 tests ran, and the changed tests passed specifically (chat-desktop.spec.ts:74,chat-mobile.spec.ts:53). Scope is test/workflow-only.APPROVED on
072676a620.Verified the test-only robustness change:
locator('div').count() > 3heuristic.seedChatHistory(...)and are neither under-constrained nor over-constrained for this fixture.chat==true,Run Playwright E2E testsexecuted, both changed chat load tests passed, and the job reported 26/26 passing.This now pins the intended seeded-history behavior directly with real Playwright proof.