explaingit

pandelisz/tuiwright

Analysis updated 2026-05-18

0PythonAudience · developer

TLDR

A Python end-to-end testing library that drives real terminal applications through a pseudo-terminal, checking on-screen text like a human would.

Mindmap

mindmap
  root((repo))
    What it does
      Spawns real terminal app
      Simulates user input
      Reads screen grid
    Tech stack
      Python
      pytest plugin
      pyte emulator
    Use cases
      End to end testing
      Screen snapshot checks
      PNG pixel comparison
    Audience
      Backend developers
    Constraints
      POSIX systems only
      Async test functions

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Write end-to-end tests for full-screen terminal applications.

USE CASE 2

Simulate keyboard, mouse, and paste events against a real running binary.

USE CASE 3

Compare terminal screens against saved text snapshots in code review.

What is it built with?

Pythonpytestpyte

How does it compare?

pandelisz/tuiwright0xhassaan/nn-from-scratch3ks/embedoc
Stars00
LanguagePythonPythonPython
Last pushed2023-06-08
MaintenanceDormant
Setup difficultymoderatehard
Complexity4/51/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

In plain English

This is a Python testing library for applications that run in a terminal, the kind of full-screen programs that draw text-based user interfaces. End-to-end testing means the library runs the actual application binary in a real terminal environment and drives it the same way a human would, rather than testing internal code directly. The core problem it solves is that existing approaches either treat terminal output as plain text (which breaks on full-screen apps that move the cursor around), or only work inside the app's own framework, meaning the real binary and the real terminal layer are never actually exercised. This library takes a black-box approach: it spawns the application inside a real pseudo-terminal (PTY), simulates keyboard input, mouse clicks, scrolling, paste events, and window resizes, then checks the screen by reading the resulting grid of on-screen characters. It integrates with pytest as an async plugin, so tests are written as standard async test functions. The API provides methods to type text, press key combinations, click at specific row and column positions, and wait until specific text appears on screen before moving to the next step. Assertions can compare the whole screen against a saved snapshot, which is stored as a plain text file that shows up cleanly in code reviews. Optionally, screenshots can be saved as PNG images and compared pixel by pixel. Internally, the library uses pyte as its terminal emulator to parse screen output, and ptyprocess to manage the pseudo-terminal. The library is written in Python and is described as working on POSIX systems only in its current version.

Copy-paste prompts

Prompt 1
Show me how to write a pytest test that types text and waits for output using this library.
Prompt 2
Explain how the pseudo-terminal and screen-snapshot approach works here.
Prompt 3
Help me set up pixel-level PNG screenshot comparisons for my terminal app.
Prompt 4
Walk me through simulating a window resize event in a test with this library.

Frequently asked questions

What is tuiwright?

A Python end-to-end testing library that drives real terminal applications through a pseudo-terminal, checking on-screen text like a human would.

What language is tuiwright written in?

Mainly Python. The stack also includes Python, pytest, pyte.

Who is tuiwright for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.