Sessions are now the unit of the product instead of an implicit capture run. - Nothing is deleted by default: the fixed 10-session cap is gone. An age limit (Never / 7 / 14 / 30 / 90 / 180 / 365 days) is chosen in Settings > Sessions and applied on launch, after archiving, and by "Clean up now". Sent PDFs are never touched. - Each session carries review details: lane, deployed version, commit, reviewer (pre-filled with the Mac user) and a free note. They persist in session.json and are inherited by the next session, so a review run is typed once. - PDF file names are Redline-<yyyyMMdd-HHmm>-<LANE>-<SHORTID>.pdf, and every page carries a two-line reference footer (tool, build time, session / lane, deployed build, commit, reviewer, note). The PDF document info carries the same values in Author and Keywords. - Verification: 159 tests, a headless panel self-test, and a LaunchServices-driven end-to-end run that types and clicks the real panel.
67 lines
2.5 KiB
Bash
Executable File
67 lines
2.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# End-to-end UI run: the real panel, in the ACTIVE app, typed into with the keyboard
|
|
# and clicked with the mouse. Launched through LaunchServices ("open -n") because a
|
|
# background shell launch can never get a key window — macOS will not let it activate.
|
|
#
|
|
# ./scripts/run-e2e-ui.sh
|
|
#
|
|
# Builds a throwaway copy of the signed app under a separate bundle identifier
|
|
# (ai.flowmaster.shotdeck.e2e) so it can run alongside the installed Redline without
|
|
# touching /Applications, Ben's real captures, or his real preferences. It writes its
|
|
# results to a file and exits.
|
|
|
|
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
SOURCE_APP="${ROOT}/.build/Redline.app"
|
|
E2E_APP="${ROOT}/.build/RedlineE2E.app"
|
|
IDENTITY="Apple Development: ben@flow-master.ai (QH2H9G2LK5)"
|
|
BUNDLE_ID="ai.flowmaster.shotdeck.e2e"
|
|
WORK_DIR="$(mktemp -d /tmp/redline-e2e.XXXXXX)"
|
|
RESULT="${WORK_DIR}/result.txt"
|
|
|
|
if [[ ! -d "${SOURCE_APP}" ]]; then
|
|
echo "No ${SOURCE_APP} found. Run ./scripts/build-app.sh first." >&2
|
|
exit 1
|
|
fi
|
|
|
|
# A leftover instance from an interrupted run would hold the bundle identifier and
|
|
# make "open -n" a no-op.
|
|
pkill -f "RedlineE2E.app/Contents/MacOS/Shotdeck" >/dev/null 2>&1 || true
|
|
for _ in $(seq 1 20); do
|
|
pgrep -f "RedlineE2E.app/Contents/MacOS/Shotdeck" >/dev/null 2>&1 || break
|
|
sleep 0.2
|
|
done
|
|
rm -rf "${E2E_APP}"
|
|
ditto "${SOURCE_APP}" "${E2E_APP}"
|
|
/usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier ${BUNDLE_ID}" "${E2E_APP}/Contents/Info.plist"
|
|
/usr/libexec/PlistBuddy -c "Set :CFBundleName Redline E2E" "${E2E_APP}/Contents/Info.plist"
|
|
# A menu-bar app (LSUIElement) is never activated by LaunchServices, and macOS only
|
|
# lets an active app own the key window the keyboard goes to. The test copy is a
|
|
# regular app for the duration of the run; the shipped app keeps LSUIElement.
|
|
/usr/libexec/PlistBuddy -c "Set :LSUIElement false" "${E2E_APP}/Contents/Info.plist"
|
|
codesign --force --options runtime \
|
|
--sign "${IDENTITY}" \
|
|
--identifier "${BUNDLE_ID}" \
|
|
"${E2E_APP}"
|
|
|
|
open -n "${E2E_APP}" --args --selftest e2e --root "${WORK_DIR}/storage" --result "${RESULT}"
|
|
|
|
for _ in $(seq 1 120); do
|
|
if [[ -f "${RESULT}" ]] && grep -qE "^E2E (PASS|FAIL)$" "${RESULT}"; then
|
|
break
|
|
fi
|
|
sleep 0.25
|
|
done
|
|
|
|
sleep 0.5
|
|
osascript -e "tell application id \"${BUNDLE_ID}\" to quit" >/dev/null 2>&1 || true
|
|
|
|
if [[ ! -f "${RESULT}" ]]; then
|
|
echo "E2E FAIL: no result file was written (${RESULT})" >&2
|
|
exit 1
|
|
fi
|
|
|
|
cat "${RESULT}"
|
|
grep -q "^E2E PASS$" "${RESULT}"
|