Files
simplex-chat/scripts/ci/desktop-linux/smoke-test.sh
T
spacedandy-agents-simplex 497c451e59 ci: run the desktop smoke test on the released app as well
The branch's Kotlin does not compile yet (DirectorySearch.kt and DirectorySearchView.kt import chat.simplex.res.MR instead of chat.simplex.res.*), so the app job stops before the UI steps. A new release job downloads the desktop .deb of the branch's latest release tag for the runner's Ubuntu and runs the same smoke test on it, which exercises Xvfb, openbox, xdotool and the OCR helper independently of the branch build. The smoke test now checks that the typed text appears in the search field and reports whether the Search in Directory row is shown, since releases before directory search don't have it. This run also checks that the core library cache is hit.
2026-10-14 19:45:10 +00:00

74 lines
2.1 KiB
Bash
Executable File

#!/bin/bash
# Starts the desktop app on a virtual display and runs the scripted UI cases with the ui helper:
# onboarding to the chat list, and typing in the chat list search field.
# Usage: scripts/ci/desktop-linux/smoke-test.sh <app dir> <output dir>
# Each step saves a numbered screenshot and the text read from it to the output dir, prints the text to the log,
# and adds a line to steps.log there. The app keeps running for later steps of the job, which get UI_OUT.
set -euo pipefail
app_dir=$1
export UI_OUT=$2
search_text="ci smoke"
ui=$(dirname "$0")/ui
mkdir -p "$UI_OUT"
if [ -n "${GITHUB_ENV:-}" ]; then
echo "UI_OUT=$UI_OUT" >> "$GITHUB_ENV"
fi
finish() {
local status=$?
"$ui" shot final || true
echo "::group::app log, last 300 lines"
tail -n 300 "$UI_OUT/app.log" || true
echo "::endgroup::"
exit "$status"
}
trap finish EXIT
"$ui" start "$app_dir"
# onboarding to the chat list
"$ui" wait "Create your profile" 180
"$ui" shot first-screen
"$ui" click-text "Create your profile"
"$ui" wait "Create profile" 30
"$ui" click-text "Enter profile name"
"$ui" type citester
"$ui" shot profile-name
"$ui" click-text "Create profile"
# a new desktop database gets a random passphrase, which onboarding offers to replace
"$ui" wait "Use random passphrase" 60
"$ui" shot database-passphrase
"$ui" click-text "Use random passphrase"
"$ui" wait "OK" 10
"$ui" shot random-passphrase-alert
"$ui" click-text "OK"
"$ui" wait "Continue" 60
"$ui" shot your-network
"$ui" click-text "Continue"
"$ui" wait "Accept" 30
"$ui" shot network-commitments
"$ui" click-text "Accept"
"$ui" wait "Search or paste SimpleX link" 60
sleep 3
"$ui" shot chat-list
"$ui" click-text "Search or paste SimpleX link"
"$ui" type "$search_text"
"$ui" wait "$search_text" 15
# builds with directory search offer it for typed text that is not a SimpleX link; releases before it don't
if "$ui" wait "Search in Directory" 10; then
directory_row=shown
else
directory_row="not shown"
fi
"$ui" shot search-typed
echo "smoke test passed: onboarding reached the chat list, its search field shows \"$search_text\", and the \"Search in Directory\" row is $directory_row"