Tests navigateur : bilan en page, et fin-de-partie.mjs (1m)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Pierre MARTIN
2026-11-23 16:55:03 +01:00
co-authored by Claude Opus 5.5
parent 2a8d14d02b
commit d74e70f02b
11 changed files with 672 additions and 77 deletions
+15 -3
View File
@@ -36,9 +36,14 @@
# continue, bilan, analyse, « Mes parties », export SGF, prompt), captures
# dans build/browser-shots/match-bilan/.
#
# La fin de partie et le bilan en page (tests/browser/fin-de-partie.mjs,
# étape 1m : plateau final 600 ms, places réservées qui ne bougent pas à
# l'arrivée de l'analyse, barre d'actions fixe, retour au plateau final, fin
# de match), captures dans build/browser-shots/fin-de-partie/.
#
# BROWSERS=chromium et SCRIPTS=accueil (ou play, match, maitre, bilan,
# prompts, nouvelle-partie, retours-joueurs, lecons, progression, plateau,
# match-bilan, retours-2)
# match-bilan, retours-2, fin-de-partie)
# restreignent le test.
#
# Outils : l'image de Playwright (navigateurs) et le paquet playwright,
@@ -52,7 +57,7 @@ cd "$(dirname "$0")/.."
image="${PLAYWRIGHT_IMAGE:?lancer via make test-browser}"
browsers="${BROWSERS:-chromium firefox}"
# Les scripts à lancer (tests/browser/<nom>.mjs), tous par défaut.
scripts="${SCRIPTS:-play accueil match maitre bilan prompts nouvelle-partie retours-joueurs lecons progression plateau match-bilan retours-2}"
scripts="${SCRIPTS:-play accueil match maitre bilan prompts nouvelle-partie retours-joueurs lecons progression plateau match-bilan retours-2 fin-de-partie}"
unset MAKEFLAGS MFLAGS MAKELEVEL
make -s package >/dev/null
@@ -92,7 +97,7 @@ mkdir -p build/browser-shots
cp tests/browser/play.mjs tests/browser/accueil.mjs tests/browser/match.mjs tests/browser/recette.mjs \
tests/browser/maitre.mjs tests/browser/bilan.mjs tests/browser/prompts.mjs tests/browser/nouvelle-partie.mjs \
tests/browser/retours-joueurs.mjs tests/browser/lecons.mjs tests/browser/progression.mjs tests/browser/plateau.mjs \
tests/browser/retours-2.mjs tests/browser/match-bilan.mjs "$tools/"
tests/browser/retours-2.mjs tests/browser/match-bilan.mjs tests/browser/fin-de-partie.mjs "$tools/"
status=0
for browser in $browsers; do
# Réseau de l'hôte : le site est sur 127.0.0.1. Le service worker
@@ -190,5 +195,12 @@ for browser in $browsers; do
-v "$PWD/$tools:/tools" -v "$PWD/build/browser-shots:/shots" -w /tools "$image" \
node match-bilan.mjs "http://localhost:$port/" "$browser" /shots || status=1
fi
if [[ " $scripts " == *" fin-de-partie "* ]]; then
# La fin de partie et le bilan en page (étape 1m) ; captures dans
# build/browser-shots/fin-de-partie/.
docker run --rm --init --ipc=host --network host --user "$(id -u):$(id -g)" -e HOME=/tmp \
-v "$PWD/$tools:/tools" -v "$PWD/build/browser-shots:/shots" -w /tools "$image" \
node fin-de-partie.mjs "http://localhost:$port/" "$browser" /shots || status=1
fi
done
exit "$status"