بنقرة واحدة
kon-tmux-test
// E2E testing of kon using tmux sessions; IMPORTANT: only trigger this skill when user asks for e2e testing of kon
// E2E testing of kon using tmux sessions; IMPORTANT: only trigger this skill when user asks for e2e testing of kon
| name | kon-tmux-test |
| description | E2E testing of kon using tmux sessions; IMPORTANT: only trigger this skill when user asks for e2e testing of kon |
End-to-end testing of kon using tmux sessions to programmatically control the TUI application.
Kon is a TUI (Textual-based) app. Running tests programmatically is hard. Tmux provides:
tmux new-session - isolate test environmenttmux send-keys - send keyboard inputtmux capture-pane - capture outputtmux has-session - check if kon is runningHOME=/tmp/kon-e2e-home so runtime settings do not mutate the real user config; auth JSON files are copied into the temp HOME when present so provider startup still works@, /, runtime pickers, keybindings) by checking UI elements appear/tmp/kon-test-project# Run all e2e tests from the repo root
bash .kon/skills/kon-tmux-test/run-e2e-tests.sh
# Optional: keep the temporary HOME for debugging
KEEP_E2E_HOME=1 bash .kon/skills/kon-tmux-test/run-e2e-tests.sh
# Optional: override launch command/provider/model
KON_CMD='uv run kon --model gpt-5.5' \
bash .kon/skills/kon-tmux-test/run-e2e-tests.sh
After running, read /tmp/kon-test-*.txt and evaluate the captured pane/config/filesystem outputs.
setup-test-project.shCreates a deterministic test project structure at /tmp/kon-test-project/.
bash .kon/skills/kon-tmux-test/setup-test-project.sh
run-e2e-tests.shRuns comprehensive e2e tests including UI triggers, runtime controls, tab completion, and tool execution.
bash .kon/skills/kon-tmux-test/run-e2e-tests.sh
/, verify slash command list appears with core and newer commands@pyproject, verify file picker appears with pyproject.toml/model, verify model selector appears, then dismiss/new, verify new conversation is started/resume, verify session list appears, then dismiss/session, verify session info/statistics displayedprompt and auto, with current mode checked✓✓ auto / ⏸ prompt) and temp config persists permissions.modenone, minimal, low, medium, high, xhigh, with current level checkedminimalon and off, with current mode checkednotifications.enabledpypr + Tab, verify completes to pyproject.tomlsrc/kon/ui/s + Tab, verify floating list shows selection_mode.py, session_ui.py, styles.pysrc/kon/ui/widg + Tab, verify completes to src/kon/ui/widgets.pysrc/kon/ui/s + Tab + Enter, verify first completion is applied to input/tmp/kon-test-project/test1.txt, verified by file existencetest1.txt, verified by content changing from hello to world3+3, verified in LLM output where practicalEdit or override environment variables for run-e2e-tests.sh:
WAIT_TIME=30 # Time for LLM to complete all tool tasks
COMMAND_WAIT_TIME=3 # Time for UI commands to settle
SESSION_NAME="kon-test" # Tmux session name
TEST_DIR="/tmp/kon-test-project" # Test project directory for tool execution
TEST_HOME="/tmp/kon-e2e-home" # Isolated HOME/config/session directory
KON_DIR="$PWD" # Kon repo directory for tab completion tests
KON_CMD="uv run kon --model gpt-5.5"
KEEP_E2E_HOME=0 # Set to 1 to preserve temp HOME after run
The main script writes captured outputs to /tmp/kon-test-*.txt:
/tmp/kon-test-1-commands.txt - / slash command list/tmp/kon-test-2-at-trigger.txt - @pyproject file picker/tmp/kon-test-3-model.txt - /model selector/tmp/kon-test-4-new.txt - /new result/tmp/kon-test-5-permissions-picker.txt - /permissions picker/tmp/kon-test-6-permissions-auto.txt and ...-config.txt - /permissions auto/tmp/kon-test-7-permissions-prompt.txt and ...-config.txt - /permissions prompt/tmp/kon-test-8-permissions-shift-tab.txt and ...-config.txt - Shift+Tab mode cycling/tmp/kon-test-9-thinking-picker.txt - /thinking picker/tmp/kon-test-10-thinking-minimal.txt - /thinking minimal/tmp/kon-test-11-thinking-cycle.txt - Ctrl+Shift+T thinking cycle/tmp/kon-test-12-notifications-picker.txt - /notifications picker/tmp/kon-test-13-notifications-on.txt and ...-config.txt - /notifications on/tmp/kon-test-14-notifications-off.txt and ...-config.txt - /notifications off/tmp/kon-test-15-tab-unique.txt - Tab completion unique match/tmp/kon-test-16-tab-multiple.txt - Tab completion alternatives/tmp/kon-test-17-tab-nested-unique.txt - Nested unique file completion/tmp/kon-test-18-tab-select.txt - Tab completion selection/tmp/kon-test-19-tools.txt - Tool execution turn/tmp/kon-test-20-session.txt - /session stats/tmp/kon-test-21-resume.txt - /resume session list/tmp/kon-test-files.txt - Test project file listing/tmp/kon-test-test1-content.txt - Final test1.txt content or FILE_NOT_FOUND/tmp/kon-test-session-files.txt - Session JSONL paths under temp HOME/tmp/kon-test-final-config.txt - Final temp configEscape not Esc: tmux recognizes Escape. Esc sends literal characters.Escape to dismiss completions, then C-u to clear text.Escape '[' 'Z' rather than relying on a tmux key name.Escape '[84;6u' because C-S-t often collapses to Ctrl+T.After running the test script, evaluate results by reading the output files.
UI Trigger Tests:
/ test: Slash command list includes themes, permissions, thinking, notifications, init, compact, handoff, export, copy, login, logout@ test: File picker appears and shows pyproject.toml/model test: Model selector appears with model list/current markers/new test: Started new conversation appears/resume test: Session list appears with prior sessions/session test: Session info/statistics displayedRuntime Mode Tests:
/permissions picker shows prompt and auto, current item checked/permissions auto shows ✓✓ auto, saved status, and config has mode = "auto"/permissions prompt shows ⏸ prompt, saved status, and config has mode = "prompt"auto and config has mode = "auto"/thinking picker shows none, minimal, low, medium, high, xhigh/thinking minimal shows Thinking level changed to minimal and info bar row2-right includes minimalminimal to the next level/notifications picker shows on and off, current item checked/notifications on/off status says saved and config flips enabled = true/falseTab Path Completion Tests:
pypr + Tab shows pyproject.tomlsrc/kon/ui/s + Tab shows selection_mode.py, session_ui.py, styles.pysrc/kon/ui/widg + Tab shows src/kon/ui/widgets.pysrc/kon/ui/s + Tab + Enter applies a selected completionTool Execution Tests:
/tmp/kon-test-project/test1.txt exists/tmp/kon-test-test1-content.txt contains world/tmp/kon-test-files.txt lists test1.txt/tmp/kon-test-19-tools.txt shows relevant tool blocks/resultsProvide a summary showing:
After presenting the report, ALWAYS give the user this shell command so they can inspect raw captured outputs:
for f in /tmp/kon-test-*.txt; do printf "\n\033[1;36m▶▶▶ %s\033[0m\n" "$f"; awk 'NF{found=1} found{lines[++n]=$0} END{while(n>0 && lines[n]=="") n--; for(i=1;i<=n;i++) print lines[i]}' "$f"; done
# Test script auto-cleans tmux session and temp HOME unless KEEP_E2E_HOME=1.
# Output files remain for evaluation (/tmp/kon-test-*.txt).
# Manual cleanup if needed:
tmux kill-session -t kon-test 2>/dev/null
rm -rf /tmp/kon-test-project /tmp/kon-e2e-home
rm -f /tmp/kon-test-*.txt
# Session management
tmux new-session -d -s <name> -c <dir> '<command>'
tmux kill-session -t <name>
tmux has-session -t <name>
# Input — IMPORTANT: use full key names (Escape, Enter, not Esc)
tmux send-keys -t <name> "text"
tmux send-keys -t <name> Enter
tmux send-keys -t <name> Escape
tmux send-keys -t <name> Tab
tmux send-keys -t <name> C-c
tmux send-keys -t <name> C-u
# Output
tmux capture-pane -t <name> -p
tmux capture-pane -t <name> -p > file.txt
KEEP_E2E_HOME=1 to inspect temp config/session files after failures./resume so there is a session with messages in the list.Review code changes and return prioritized, actionable findings
Tag, publish to PyPI, and create GitHub release for Kon with validation and rollback-safe steps
Create or update AGENTS.md for this repository