aws-samples / aws-samples/agents4energy

Strengthen chat E2E test to verify AG-UI event stream

Open
#146 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
48
Forks
68
PR merge metrics
No merged PRs in 30d

Description

## Goal
Extend `web/e2e/chat.spec.ts` to explicitly verify the AG-UI binary event stream protocol, not just that a response eventually appears.

## Current gap
`chat.spec.ts` waits up to 60s for an assistant message to appear but doesn't verify streaming — the test would pass even if the response arrived as a single batch after the stream was finished.

## Acceptance criteria
- Test intercepts `POST /harnesses/invoke` and asserts response `Content-Type: application/vnd.amazon.eventstream`
- Test asserts a partial/streaming message appears in the UI before the full response is complete (the shimmer/cursor must be visible during streaming)
- Test asserts the shimmer disappears and the submit button returns to idle state after streaming completes
- Test runs reliably in < 90s
- Test file: `web/e2e/chat.spec.ts`

## Notes
Use Playwright `page.route()` or `page.on('response', ...)` to inspect the event stream response headers before the UI updates.

---
*Imported from `waltmayf/agentcore-amplify-fullstack`#32 — originally filed by @waltmayf on 2026-07-02. Migrated to open-source repo; cross-references updated post-import.*

Contributor guide

Open the contributing guide

Research direction

Start with web/e2e/chat.spec.ts and trace the existing chat flow and its 60-second wait. Intercept POST /harnesses/invoke with Playwright and verify the event-stream Content-Type, then observe the partial message and shimmer before completion. Done means the shimmer disappears, the submit button returns to idle, and the test completes reliably in under 90 seconds.

Written by the indexing model from the issue text.

Assessment

Tech stack
playwright, typescript
Domain
frontend, testing
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.