Functional testing for Textual applications using App.runtest() and the Pilot class.
Run app in headless mode (no terminal output, all other behavior identical):
| Assertion fails before update | Add await pilot.pause() after interactions | | Worker result not available | Use await pilot.app.workers.waitforcomplete() | | Animation state varies | Use await pilot.waitforanimation() | | Missing async def | All test functions must be async def | | Missing await | All pilot methods are async and need await |
내장된 테스트 프레임워크를 사용하여 텍스트 TUI 애플리케이션을 테스트합니다. App.run_test()를 통한 헤드리스 모드 테스트, 전체 파일럿 API(마우스, 키보드, 타이밍, 애니메이션), 위젯 쿼리 및 작업자 관리를 다룹니다. 사용 시기: TUI 위젯에 대한 테스트 작성, 사용자 상호 작용(클릭, 키 누르기, 마우스 오버) 테스트, 위젯 상태 확인, 이벤트 처리 테스트 또는 통합 테스트 실행. 기능적 텍스트 테스트를 위한 기본 기술입니다. 출처: dawiddutoit/custom-claude.