ttry is a Playwright-style end-to-end testing framework for terminal applications.
It launches real terminal binaries inside a Unix pseudo-terminal (PTY), sends keyboard and paste events, reconstructs the rendered screen, and provides live text locators, retrying assertions, process lifecycle checks, and plain-text snapshots.
Tests can be written using a native TOML runner (ttry.toml) or embedded as a Rust testing library (TuiSession). The application under test can use any language or TUI framework (such as Ratatui, Bubble Tea, or Textual).
Highlights
- Unix PTY Execution: Spawns real binaries in an isolated PTY without requiring a display server or shell.
- Live Text Locators: Query text, lines, or clipped regions with auto-retrying assertions.
- Deterministic Snapshots: Full-screen or region plain-text snapshots with diff-on-failure output.
- TOML & Rust APIs: Configure test suites via
ttry.tomlor write programmatic Rust tests. - Bounded Lifecycle & Cleanup: Idempotent process termination, signal handling, and descendant process group cleanup.
- Framework Agnostic: Works with Rust, Go, Python, C/C++, or Node.js terminal applications.
Quick Install
brew install delaudio/tap/ttry