Examples
These examples run in the repository test pipeline. Start with the generic example, then choose the framework closest to your application.
| Example | What it demonstrates |
|---|---|
| Getting started | Generic Node CLI, real keyboard input, text assertions, and no semantic integration. |
| Ink todo | End-to-end and component tests, semantic locators, snapshots, and application mouse routing. |
| OpenTUI form | Focused input, semantic values, intended geometry, and exact pointer ownership. |
| Textual notes | Python application launched through the Textual integration with semantic assertions. |
| tview menu | Instrumented Go build, semantic navigation, and snapshots. |
| Bubble Tea login | Instrumented Go build, secret fields, and locator clicks handled as normal tea.MouseClickMsg input. |
| Ratatui list | Instrumented Cargo build and locator clicks handled as normal crossterm::Event::Mouse input. |
Run an example
Section titled “Run an example”From the repository root:
pnpm installpnpm --filter @termwright-examples/getting-started testEach 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.
Find a recipe
Section titled “Find a recipe”| Task | Tested example or guide |
|---|---|
| Run a command and assert its exit code | Shell commands |
| Test keyboard navigation | tview menu or Ratatui list |
| Test exact mouse targeting | Textual notes, OpenTUI form, or the application-provider tests in Ink, Ratatui, and Bubble Tea |
| Test terminal resize behavior | Actions and input |
| Test a component without the complete application | Test Ink components |
| Keep secrets out of semantics and traces | Bubble Tea login and Security |
| Inspect a failed or flaky test | Debug a failed test and Traces and reports |
| Capture application logs | Application logs |
| Run in CI | Run tests in CI |
| Record a test | Record a test |
| Drive a session through an agent | Use Termwright with AI agents |