Skip to content

feat: add TUI integration tests#549

Open
aidandaly24 wants to merge 2 commits intofeat/tui-harnessfrom
feat/tui-harness-tests
Open

feat: add TUI integration tests#549
aidandaly24 wants to merge 2 commits intofeat/tui-harnessfrom
feat/tui-harness-tests

Conversation

@aidandaly24
Copy link
Contributor

Description

Adds 27 integration tests across 5 test suites that exercise the TUI harness against the real AgentCore CLI binary. These tests validate that AI agents can reliably drive the TUI through all major user flows.

Test suites:

  • harness.test.ts (9 tests) — Self-tests for TuiSession using simple Unix commands (echo, cat, bash). Validates launch, sendKeys, close, dead-session errors, waitFor success/timeout, LaunchError, concurrent sessions, and numbered readScreen.
  • navigation.test.ts (8 tests) — TUI navigation against the real CLI. HomeScreen rendering, HelpScreen rendering, forward/backward navigation, exit via double-Escape and Ctrl+C.
  • create-flow.test.ts (3 tests) — Full create-project wizard: create with agent (20+ step wizard), create without agent, and back-navigation during wizard.
  • add-flow.test.ts (4 tests) — Add-resource flow: navigate to Add Resource screen, drill into Add Agent wizard, and escape-back at each level.
  • deploy-screen.test.ts (3 tests) — Deploy screen: renders, shows AWS configuration, supports Escape-back. Never actually deploys.

Infrastructure:

  • setup.ts — Vitest global setup checking harness availability and cleaning up orphaned PTY sessions
  • helpers.ts — Re-exports createMinimalProjectDir from the harness library

Stacked on #548 — retarget to main after PR 1 merges.

Related Issue

Closes #

Documentation PR

N/A — test documentation is in docs/TESTING.md (included in PR #548)

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

How have you tested the change?

  • I ran npm run test:unit and npm run test:integ
  • I ran npm run typecheck
  • I ran npm run lint
  • If I modified src/assets/, I ran npm run test:update-snapshots and committed the updated snapshots

All 27 tests pass: npm run test:tui → 27 passed, 0 failed.

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.

aidandaly24 and others added 2 commits March 17, 2026 15:14
The harness is dev-only tooling for AI agents and integration tests.
It should not ship to end users who install the CLI.

- Gate MCP harness esbuild behind BUILD_HARNESS=1 env var
- Remove agent-tui-harness bin entry from package.json
- Add !dist/mcp-harness to files array (npm publish exclusion)
- Remove node-pty from optionalDependencies (stays in devDependencies)
- Add build:harness script, update test:tui to use it
- Update AGENTS.md to reference npm run build:harness

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
27 tests across 5 suites verifying the TUI harness against the real
AgentCore CLI: harness self-tests, navigation flows, create wizard,
add-resource flows, and deploy screen rendering.

Tests use describe.skipIf(!isAvailable) to gracefully skip when
node-pty is not installed. createMinimalProjectDir provides fast
(~10ms) project directory setup without npm install.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@aidandaly24 aidandaly24 force-pushed the feat/tui-harness-tests branch from 3110b1e to 04533ce Compare March 17, 2026 19:14
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