Skip to content

Examples

These examples run in the repository test pipeline. Start with the generic example, then choose the framework closest to your application.

ExampleWhat it demonstrates
Getting startedGeneric Node CLI, real keyboard input, text assertions, and no semantic integration.
Ink todoEnd-to-end and component tests, semantic locators, snapshots, and application mouse routing.
OpenTUI formFocused input, semantic values, intended geometry, and exact pointer ownership.
Textual notesPython application launched through the Textual integration with semantic assertions.
tview menuInstrumented Go build, semantic navigation, and snapshots.
Bubble Tea loginInstrumented Go build, secret fields, and locator clicks handled as normal tea.MouseClickMsg input.
Ratatui listInstrumented Cargo build and locator clicks handled as normal crossterm::Event::Mouse input.

From the repository root:

Terminal window
pnpm install
pnpm --filter @termwright-examples/getting-started test

Each example has its own package scripts and checked-in fixture application. The root CI runs the examples to catch public API and integration drift.

The framework pages state which geometry, visibility, and pointer capabilities each integration can provide.

TaskTested example or guide
Run a command and assert its exit codeShell commands
Test keyboard navigationtview menu or Ratatui list
Test exact mouse targetingTextual notes, OpenTUI form, or the application-provider tests in Ink, Ratatui, and Bubble Tea
Test terminal resize behaviorActions and input
Test a component without the complete applicationTest Ink components
Keep secrets out of semantics and tracesBubble Tea login and Security
Inspect a failed or flaky testDebug a failed test and Traces and reports
Capture application logsApplication logs
Run in CIRun tests in CI
Record a testRecord a test
Drive a session through an agentUse Termwright with AI agents