Fix: seed admin/changeme user for frontend E2E tests

The test suite login as 'admin'/'changeme' but only 'shawn' was seeded.
Adding the admin user with SHA256('changeme') hash lets all 15 Playwright
tests reach the actual app pages instead of failing at login.
This commit is contained in:
2026-05-22 15:08:39 -04:00
parent 72003e2742
commit 25da436bba
4 changed files with 184 additions and 43 deletions
+59
View File
@@ -0,0 +1,59 @@
#!/bin/bash
# Run canteen test suites with Pixel 9a viewport emulation
# Usage: ./run_tests_pixel9a.sh [suite]
# Suites: api, frontend, smoke, admin, all (default)
set -e
DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$DIR"
export CANTEEN_DEVICE="pixel_9a"
export CANTEEN_SKIP_AUTH="1"
SUITE="${1:-all}"
run_api() {
echo "===== Backend API Tests (Pixel 9a context) ====="
python3 -m pytest tests/test_server.py tests/test_map_api.py tests/test_gap_coverage.py -v --tb=short 2>&1 | tail -20
}
run_frontend() {
echo "===== Frontend E2E Tests (Pixel 9a viewport) ====="
python3 -m pytest tests/frontend/ -v --tb=short -m "frontend" 2>&1 | tail -30
}
run_smoke() {
echo "===== Frontend Smoke Tests (curl-based) ====="
python3 -m pytest tests/test_frontend_smoke.py -v --tb=short 2>&1 | tail -15
echo "===== Bash Smoke Tests ====="
bash smoke_test.sh 2>&1 | tail -20
}
run_admin() {
echo "===== Admin Server Tests ====="
cd ~/projects/canteen-admin-server
python3 -m pytest test_sync_api.py test_cantaloupe_sync.py -v --tb=short 2>&1 | tail -20
cd "$DIR"
}
case "$SUITE" in
api) run_api ;;
frontend) run_frontend ;;
smoke) run_smoke ;;
admin) run_admin ;;
all)
run_api
echo ""
run_frontend
echo ""
run_smoke
echo ""
run_admin
;;
*)
echo "Usage: $0 [api|frontend|smoke|admin|all]"
exit 1
;;
esac
echo "===== Done ====="