Expand graphical acceptance coverage

This commit is contained in:
David Heinemeier Hansson
2026-07-22 17:31:14 -07:00
parent 83d20b07d1
commit 1de4c89030
8 changed files with 460 additions and 31 deletions
+15 -11
View File
@@ -5,7 +5,7 @@ set -euo pipefail
source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"
launch_and_verify() {
local name="$1" command="$2" class="$3"
local name="$1" command="$2" class="$3" timeout="${4:-45}"
# A pre-existing window makes the test ambiguous (and closing it would be
# hostile on a dev machine) — acceptance runs expect a fresh session.
@@ -14,9 +14,9 @@ launch_and_verify() {
fi
launch_app "$command"
wait_until "$name opens a window" 90 window_present "$class"
wait_until "$name opens a window" "$timeout" window_present "$class"
sleep 1
screenshot "app-$name"
screenshot "success-app-$name"
local deadline=$((SECONDS + 30))
while window_present "$class" >/dev/null 2>&1; do
@@ -31,15 +31,19 @@ launch_and_verify() {
pass "$name window closes"
}
# name|command|window class regex
# Keep launch coverage to the primary daily-use paths. The system acceptance
# test separately verifies the complete core package manifest.
# name|command|window class regex|launch timeout
apps='terminal|foot|^foot$
browser|chromium --new-window|(?i)chromium
files|nautilus --new-window|org.gnome.Nautilus
calculator|gnome-calculator|org.gnome.Calculator
notes|obsidian|(?i)obsidian
office|libreoffice|(?i)(soffice|libreoffice)
pdf-viewer|evince|(?i)evince'
neovim|xdg-terminal-exec --app-id=org.omarchy.nvim nvim|org.omarchy.nvim
writer|omawrite|(?i)omawrite'
while IFS='|' read -r name command class; do
launch_and_verify "$name" "$command" "$class"
status=0
while IFS='|' read -r name command class timeout; do
if ! (launch_and_verify "$name" "$command" "$class" "$timeout"); then
status=1
fi
done <<<"$apps"
exit $status