2.5 KiB
2.5 KiB
Full Flows and Command Sequences
Use this file when you need a complete, end-to-end command sequence.
Standard CLI Regression Test (human-like flow)
- Start the app under test:
agent-tui run <your-cli> -- <args>
- Capture session id from JSON output (use
--session <id>for the rest). - First snapshot (text or structure):
agent-tui --session <id> screenshot --format json
- Act based on the latest screen:
agent-tui --session <id> type "value"agent-tui --session <id> press Enter
- Wait for expected state:
agent-tui --session <id> wait "Expected text" --assert
- Repeat steps 3-5 until the flow finishes.
- Cleanup:
agent-tui --session <id> kill --yes
Form Interaction Flow
agent-tui run <app>agent-tui --session <id> screenshot --format json- Focus the input (if needed):
agent-tui --session <id> press Tab - Type value:
agent-tui --session <id> type "my-value" - Submit:
agent-tui --session <id> press Enter - Wait for success:
agent-tui --session <id> wait "Success" --assert - Cleanup:
agent-tui --session <id> kill --yes
Dynamic UI / Flaky Rendering Flow
- Start:
agent-tui run <app> - Stabilize:
agent-tui --session <id> wait --stable - Snapshot:
agent-tui --session <id> screenshot --format json - Act:
agent-tui --session <id> press Enteroragent-tui --session <id> type "text" - Re-stabilize:
agent-tui --session <id> wait --stable - Re-snapshot and continue.
- Cleanup:
agent-tui --session <id> kill --yes
Live Preview Flow (optional)
- Ask user if they want live preview.
- If yes:
agent-tui live start --open - Run the app:
agent-tui run <app> - Continue normal flow (snapshot/act/wait).
- Stop standalone preview state when done:
agent-tui live stop - If preview is daemon-backed and the daemon should stop too:
agent-tui daemon stop --yes - Cleanup:
agent-tui kill --yes
Debug/Attach Flow (existing session)
- List sessions:
agent-tui sessions - Switch active session if needed:
agent-tui sessions switch <id> - Attach to active session:
agent-tui sessions attach - Interact/observe, then detach (Ctrl-P Ctrl-B).
- Cleanup:
agent-tui kill --yesoragent-tui sessions cleanup --yes
Smoke Test Example (htop)
agent-tui run htopagent-tui --session <id> screenshot- Verify UI text (e.g., "F1 Help").
- Quit:
agent-tui --session <id> press F10 - Confirm quit:
agent-tui --session <id> wait "Quit" --gone - Cleanup:
agent-tui --session <id> kill --yes