Skip to content

test(c-messages): add aimock e2e pilot (Task #4 slice 1)#462

Closed
blove wants to merge 4 commits into
mainfrom
claude/c-messages-aimock
Closed

test(c-messages): add aimock e2e pilot (Task #4 slice 1)#462
blove wants to merge 4 commits into
mainfrom
claude/c-messages-aimock

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 19, 2026

Summary

  • Adds aimock-driven Playwright e2e coverage for the c-messages cap.
  • First slice of Task feat: autogenerated API reference from JSDoc #4 (aimock e2e for newly-eligible caps): pilots the per-cap scaffold pattern; remaining 7 chat caps batch in a follow-up PR.
  • Hand-authored single-entry fixture (Hello → canned text response). No live recording in this PR; recording fallback documented in the plan if mismatch surfaces.

Files

  • New: cockpit/chat/messages/angular/e2e/{c-messages.spec.ts,playwright.config.ts,global-setup-impl.ts,tsconfig.json,fixtures/c-messages.json}
  • Modified: cockpit/chat/messages/angular/project.json (add e2e target), .github/workflows/ci.yml (uv-sync + bash loop).

Test plan

  • CI Cockpit — e2e gate passes (new cap exercised + existing 4 still pass).
  • CI Cockpit — build / test passes (cockpit-e2e-wiring spec auto-discovers new cap).
  • Reviewer: confirm fixture content reads sensibly for the demo's chip suggestions.

🤖 Generated with Claude Code

blove and others added 3 commits May 19, 2026 09:20
First slice of Task #4 (aimock e2e for newly-eligible caps). Pilots
the per-cap scaffold pattern on cockpit/chat/messages so the
remaining 7 chat caps can be batched in a follow-up PR.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
11-task plan: 5 e2e/ files + project.json e2e target + ci.yml uv-sync
& bash loop edits. Hand-authored single-entry fixture with recording
fallback. Verifies via cockpit-e2e-wiring spec + local nx e2e.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
First slice of Task #4. Pilots the per-cap aimock e2e scaffold on
cockpit/chat/messages so the remaining 7 chat caps can be batched in
a follow-up PR.

- e2e/ scaffold (playwright config, global-setup-impl, tsconfig,
  c-messages.spec.ts with 2 tests, c-messages.json fixture).
- Add e2e target to project.json.
- Wire cockpit/chat/messages/python uv-sync + cockpit-chat-messages-
  angular into ci.yml's cockpit-e2e job.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
threadplane Ready Ready Preview, Comment May 19, 2026 4:55pm

Request Review

…button

c-messages uses raw ChatInputComponent primitives (not the composed
<chat> component). With aimock's ~30ms response, the isLoading() signal
flips false before Playwright can observe the conditional Stop generating
button, so sendPromptAndWait's 10s timeout fires.

Replace the helper with an inline submitAndWaitForResponse that waits
directly on the durable end-state:
  chat-message[data-role="assistant"][data-streaming="false"]

Log evidence: langgraph 'Background run succeeded' in 12-32ms with
HTTP 200 from aimock confirms backend + fixture work correctly — only
the helper's loading-state assumption was wrong for this cap.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@blove
Copy link
Copy Markdown
Contributor Author

blove commented May 19, 2026

Closing this pilot PR — investigation surfaced that c-messages.component.ts (and c-input) use raw <chat-message-list [agent]="agent"/> without projecting message templates. The list's @for+findTemplate finds nothing, so messages don't render at all. This is a production demo bug, not an e2e issue. Will be addressed in a follow-up PR fixing both primitive-style demos; aimock e2e pilot will re-open against a working demo afterward.

@blove blove closed this May 19, 2026
@blove blove deleted the claude/c-messages-aimock branch May 19, 2026 17:07
blove added a commit that referenced this pull request May 19, 2026
c-messages and c-input use <chat-message-list [agent]="agent" /> standalone
(intentionally, per their docstrings, to demonstrate primitive composition).
The list discovers projected `<ng-template chatMessageTemplate="...">`
blocks via contentChildren; with none projected, every findTemplate call
returns undefined and nothing renders.

Project the minimal four templates (human, ai, tool, system) matching
the defaults that the composed <chat> component provides internally.
Templates use ChatMessageComponent + ChatStreamingMdComponent — the
public primitives — so the demos still showcase "use the primitives
directly without composition" as the docstrings intend.

Unblocks Task #4's c-messages aimock e2e pilot (PR #462 was closed
when this bug surfaced — the e2e was timing out waiting for assistant
bubbles that never rendered).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
blove added a commit that referenced this pull request May 19, 2026
#14) (#469)

* docs: spec for cockpit-e2e matrix migration + submit helper

Task #14 in the pre-batching cleanup arc. Replaces the sequential bash
for-loop in the cockpit-e2e job with a GitHub matrix (one runner per
cap, max-parallel=5, fail-fast=false, summary job preserving the
"Cockpit — e2e" required-check name). Also ships
submitAndWaitForResponse helper in libs/e2e-harness/src/ — addresses
the leaky sendPromptAndWait pattern surfaced by PR #462 (loading-state
observability fails for fast-streaming aimock paths).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs: plan for cockpit-e2e matrix migration

5-task plan: add submitAndWaitForResponse to harness, export from barrel,
verify harness tests, replace cockpit-e2e job with matrix + summary,
commit/push/PR. CI is the verification gate.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* ci(cockpit-e2e): matrix-per-cap + submitAndWaitForResponse helper

Replaces the sequential bash for-loop in the cockpit-e2e job with a
GitHub Actions matrix strategy (one runner per cap, max-parallel=5,
fail-fast=false). Adds a cockpit-e2e-summary job that preserves the
"Cockpit — e2e" required-check name for branch protection.

Drops the stale 5s sleep workaround (was a pre-per-cap-migration
artifact for port 8123 collisions; each cap now binds its own pythonPort
and matrix runners are fully isolated anyway).

Ships submitAndWaitForResponse in libs/e2e-harness/src/ — waits directly
on chat-message[data-role="assistant"][data-streaming="false"] instead
of the Stop-generating button. Addresses the leaky-helper finding from
PR #462: loading-state observability fails for fast-streaming aimock
paths regardless of cap UI shape.

Unblocks the Task #4 c-messages aimock re-pilot (and the 7-cap chat
batch follow-up) by giving them a clean matrix entry pattern + a helper
that doesn't depend on UI streaming state.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(cockpit-e2e-wiring): accept matrix python entry as uv-sync evidence

The wiring spec previously required a literal `working-directory:
cockpit/<cap>/python` step in ci.yml. After the matrix migration in
this PR, that path moves into the matrix entry (`python: cockpit/...`)
and the working-directory is templated as `${{ matrix.cap.python }}`.

Spec now accepts either form, so matrix-templated jobs and any
remaining literal-step jobs both pass the cross-check.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
blove added a commit that referenced this pull request May 19, 2026
First slice of Task #4 (aimock e2e for newly-eligible caps).
Generated via scripts/generate-aimock-scaffold.ts --cap c-messages,
with hand-authored fixture content and spec assertions.

- 5 new e2e/ files (playwright config + global-setup-impl + tsconfig
  + fixtures/c-messages.json + c-messages.spec.ts).
- project.json gains the e2e Nx target.
- ci.yml matrix gains a c-messages entry.

Two spec tests:
- user message + AI response both render via submitAndWaitForResponse.
- chat-message-list renders both turns (regression coverage for
  PR #466's primitive-demo fix).

The demo was broken at the component level in PR #462 (raw
ChatMessageListComponent without projected templates). PR #466 fixed
that by projecting the four chat-message templates. This re-pilot
verifies the aimock e2e against the fixed demo.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant