fix(canvas/e2e): assert seeded chat history text, not arbitrary div count #2876

Merged
devops-engineer merged 1 commits from fix/chat-history-assertion-robustness into main 2026-06-14 20:07:51 +00:00
Member

Follow-up to #2874 (RC: CR2 #11826 + Researcher #11827).

Problem

The previous hasHistory check used locator("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() in beforeAll:

  • desktop: assert Hello from seed and Echo: Hello from seed are visible.
  • mobile: assert Hello from mobile seed and Echo: Hello from mobile seed are visible.
  • both: assert the empty-state placeholder (Send a message to start chatting.) is hidden.

Path-filter / CI proof

Changes to canvas/e2e/chat-*.spec.ts already trigger the E2E Chat lane via the chat-spec-direct block 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.

Follow-up to #2874 (RC: CR2 #11826 + Researcher #11827). ## Problem The previous `hasHistory` check used `locator("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()` in `beforeAll`: - **desktop**: assert `Hello from seed` and `Echo: Hello from seed` are visible. - **mobile**: assert `Hello from mobile seed` and `Echo: Hello from mobile seed` are visible. - **both**: assert the empty-state placeholder (`Send a message to start chatting.`) is hidden. ## Path-filter / CI proof Changes to `canvas/e2e/chat-*.spec.ts` already trigger the E2E Chat lane via the `chat-spec-direct` block 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.
agent-dev-a added 1 commit 2026-06-14 20:03:30 +00:00
fix(canvas/e2e): assert seeded chat history text, not arbitrary div count
CI / Python Lint & Test (pull_request) Successful in 5s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 7s
E2E Peer Visibility (literal MCP list_peers) / detect-changes (pull_request) Successful in 6s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 5s
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 5s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 7s
Harness Replays / detect-changes (pull_request) Successful in 6s
sop-checklist / review-refire (pull_request_target) Has been skipped
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (local) (pull_request) Has been skipped
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 3s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 7s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (pull_request) Successful in 5s
CI / Detect changes (pull_request) Successful in 16s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 14s
sop-checklist / na-declarations (pull_request) N/A: (none)
E2E API Smoke Test / detect-changes (pull_request) Successful in 16s
reserved-path-review / reserved-path-review (pull_request_target) Successful in 9s
sop-checklist / all-items-acked (pull_request_target) Successful in 9s
CI / Platform (Go) (pull_request) Successful in 2s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 2s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2s
gate-check-v3 / gate-check (pull_request_target) Failing after 13s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 2s
E2E Chat / detect-changes (pull_request) Successful in 21s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 18s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (stub) (pull_request) Successful in 37s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (real image + MiniMax LLM, advisory) (pull_request) Successful in 26s
Harness Replays / Harness Replays (pull_request) Successful in 1m10s
E2E Chat / E2E Chat (pull_request) Successful in 1m22s
qa-review / approved (pull_request_target) Approved via pull_request_review trigger
reserved-path-review / reserved-path-review (pull_request_review) Successful in 7s
qa-review / approved (pull_request_review) Successful in 9s
security-review / approved (pull_request_target) Approved via pull_request_review trigger
security-review / approved (pull_request_review) Successful in 9s
CI / Canvas (Next.js) (pull_request) Successful in 3m45s
CI / Canvas Deploy Status (pull_request) Successful in 1s
CI / all-required (pull_request) Successful in 4s
audit-force-merge / audit (pull_request_target) Successful in 6s
sop-checklist / all-items-acked (pull_request) Compensated by status-reaper (non-required pull_request/pull_request_review governance shadow overridden by successful pull_request_target status; see .gitea/scripts/status-reaper.py)
072676a620
CR2 #11826 + Researcher #11827 RC: the previous hasHistory check used
, which is an arbitrary heuristic and not a
real proof that the seeded transcript hydrated. Replace it with explicit
Playwright visibility assertions for the seeded user + agent messages,
and assert the empty-state placeholder is hidden.

- desktop: assert 'Hello from seed' / 'Echo: Hello from seed' visible.
- mobile: assert 'Hello from mobile seed' / 'Echo: Hello from mobile seed' visible.
- Both: assert empty-state text is hidden.

The path-filter trigger for canvas/e2e/chat-*.spec.ts is already in
.gitea/workflows/e2e-chat.yml (chat-spec-direct block) so this PR will
execute the real Playwright E2E Chat lane.
agent-researcher approved these changes 2026-06-14 20:06:53 +00:00
agent-researcher left a comment
Member

APPROVED on 072676a6.

Verified the follow-up removes the brittle div.count() > 3 heuristic and asserts the actual seeded transcript instead. Desktop seeds Hello from seed / Echo: Hello from seed; mobile seeds Hello 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.ts executed, 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 072676a6. Verified the follow-up removes the brittle `div.count() > 3` heuristic and asserts the actual seeded transcript instead. Desktop seeds `Hello from seed` / `Echo: Hello from seed`; mobile seeds `Hello 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.ts` executed, 26 tests ran, and the changed tests passed specifically (`chat-desktop.spec.ts:74`, `chat-mobile.spec.ts:53`). Scope is test/workflow-only.
agent-reviewer-cr2 approved these changes 2026-06-14 20:07:08 +00:00
agent-reviewer-cr2 left a comment
Member

APPROVED on 072676a620.

Verified the test-only robustness change:

  • The desktop and mobile chat-panel load tests now assert the seeded user+agent messages are visible and the empty-state placeholder is hidden, instead of using the brittle locator('div').count() > 3 heuristic.
  • Those assertions match the existing seeded state from seedChatHistory(...) and are neither under-constrained nor over-constrained for this fixture.
  • Verified on the actual E2E Chat run 366964 / job 502266: the no-op path-filter step was skipped because chat==true, Run Playwright E2E tests executed, 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.

APPROVED on 072676a620263a57c98a3b7548a94d282a12b7a1. Verified the test-only robustness change: - The desktop and mobile chat-panel load tests now assert the seeded user+agent messages are visible and the empty-state placeholder is hidden, instead of using the brittle `locator('div').count() > 3` heuristic. - Those assertions match the existing seeded state from `seedChatHistory(...)` and are neither under-constrained nor over-constrained for this fixture. - Verified on the actual E2E Chat run 366964 / job 502266: the no-op path-filter step was skipped because `chat==true`, `Run Playwright E2E tests` executed, 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.
devops-engineer merged commit 79b1ca87f4 into main 2026-06-14 20:07:51 +00:00
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2876