ssh-workbench/scripts/test.sh
jima 2a87fb58d1 100% Compose migration, AQB/CQB separation, password prompt, ADB test framework
Compose migration (4 files, 2059 lines of View code → Compose):
- ThemePickerDialog: Compose Canvas preview, LazyColumn theme list
- TerminalDialogs: 6 dead dialogs deleted, 2 migrated (hostKey, authPrompt)
  with TerminalDialogRequest sealed interface on MainViewModel for
  imperative→declarative bridge. Added PasswordDialog for no-stored-pw case.
- SnippetDialogs: full-screen Compose dialog with LazyColumn, search,
  inline create form, context menu
- KeyboardSettingsDialog: TabRow, Slider, Canvas preview, color picker.
  Data classes extracted to KeyboardModels.kt

AQB/CQB separation:
- Independent Quick Bar preferences for AKB vs CKB modes
- Settings UI mode-aware: CKB shows full keyboard dialog, AKB shows QB-only
- AQB positions filtered (no above/below keyboard)
- New docs: KEYBOARD.md, GLOSSARY.md (TV, AKB, CKB, AQB, CQB)

Password prompt:
- TerminalService prompts for password when no stored auth (SSHAuth.None)
- Compose PasswordDialog with remember checkbox
- clearPassword ADB broadcast for test cleanup

ADB test framework (Python):
- test.py runner with menu, --all, single test modes
- AI visual verification via claude -p reading screenshots
- 5 tests, 52 checks: connect, htop, vim, password prompt, multi-session
- Timestamped results with manifest.json for cross-run comparison

Coding conventions updated: 100% Compose mandated, no programmatic Views.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 15:00:35 +02:00

87 lines
1.8 KiB
Bash
Executable file

#!/bin/bash
# SSH Workbench Test Runner
#
# Usage:
# ./scripts/test.sh ← interactive menu
# ./scripts/test.sh --all ← run all tests
# ./scripts/test.sh 01 ← run test 01 only
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
TESTS_DIR="$SCRIPT_DIR/tests"
source "$SCRIPT_DIR/test_lib/common.sh"
init_results
# Collect available tests
mapfile -t TEST_FILES < <(ls "$TESTS_DIR"/*.sh 2>/dev/null | sort)
if [ ${#TEST_FILES[@]} -eq 0 ]; then
echo "No tests found in $TESTS_DIR"
exit 1
fi
run_test() {
local test_file="$1"
echo ""
echo ">>> Running: $(basename "$test_file")"
export RESULTS_DIR
source "$test_file"
}
# --- CLI mode ---
if [ "${1:-}" = "--all" ]; then
echo "Running all ${#TEST_FILES[@]} tests..."
for f in "${TEST_FILES[@]}"; do
run_test "$f"
done
print_summary
exit $?
fi
# --- Single test by number ---
if [ -n "${1:-}" ]; then
match=$(printf '%s\n' "${TEST_FILES[@]}" | grep "/${1}" | head -1)
if [ -n "$match" ]; then
run_test "$match"
print_summary
exit $?
else
echo "No test matching '$1'"
exit 1
fi
fi
# --- Interactive menu ---
echo ""
echo "=== SSH Workbench Test Runner ==="
echo ""
for i in "${!TEST_FILES[@]}"; do
echo " $((i+1)). $(basename "${TEST_FILES[$i]}" .sh)"
done
echo ""
echo " a. Run all"
echo " q. Quit"
echo ""
read -rp "Choice: " choice
case "$choice" in
a|A)
for f in "${TEST_FILES[@]}"; do
run_test "$f"
done
;;
q|Q)
exit 0
;;
*)
idx=$((choice - 1))
if [ "$idx" -ge 0 ] && [ "$idx" -lt ${#TEST_FILES[@]} ]; then
run_test "${TEST_FILES[$idx]}"
else
echo "Invalid choice"
exit 1
fi
;;
esac
print_summary