Session 24 — Resilience post-redemarrage + CT-002 Selenium PASS¶
Duree : ~8h
Ce qui a ete produit¶
Corrections de fond — JWT et configuration¶
SQUASH_AUTOM_TOKENcorrige dans 4 fichiers : token HS512 remplace par le bon token RSA RS512 (eyJhbGciOiJSUzUxMiI...genere avecopentf-ctldepuistrusted_key.pem)- Doublon
SQUASH_AUTOM_TOKENsupprime dans.env.productionet.env.example - Commentaires anti-confusion ajoutes dans tous les fichiers concernes
Fichiers modifies¶
| Fichier | Modification |
|---|---|
.env.production |
Token RS512, suppression doublon |
.env.example |
Token RS512, suppression doublon |
squash-seed/seed.py |
Token RS512 par defaut hardcode |
docker-compose.yml |
Token RS512 + PUBLIC_API_URL dans test-runner |
docker-compose.desktop.yml |
Token RS512 + PUBLIC_API_URL dans test-runner |
docker-compose.build.yml |
Token RS512 + PUBLIC_API_URL dans test-runner |
Variables SSH — docker-entrypoint.sh¶
Nouveau fichier test-runner/docker-entrypoint.sh :
sshd n'herite pas des variables Docker Compose. Le script ecrit /etc/environment
au demarrage pour que robot et pytest les voient dans les sessions SSH :
PUBLIC_API_URL=https://perfshop-api.perfshop.io
PERFSHOP_FRONTEND_URL=https://perfshop.perfshop.io
SELENIUM_REMOTE_URL=http://perfshop-selenium:4444/wd/hub
test-runner/Dockerfile mis a jour : COPY docker-entrypoint.sh + CMD pointe vers le script.
CT-001 — smoke-test.robot¶
Script reecrit pour utiliser PUBLIC_API_URL depuis /etc/environment :
- Keyword custom Get Squash Param via Evaluate (import dynamique squash_tf)
- squash_tf v2.0 n'expose plus Get Global Param comme keyword RF — resolu par import Python inline
- Fallback sur http://perfshop-app:8080 si variable absente
CT-002 — CT-002-prix-coherence.robot¶
Bugs corriges (memes causes que test_prix_panier.py) :
| Bug | Correction |
|---|---|
Selecteur .product-card inexistant |
XPath sur style inline React rgb(102, 126 |
Go To /cart vide le panier React |
Clic sur lien navbar (SPA routing) |
StaleElementReferenceException |
Sleep 2s apres Wait Until Element Is Visible |
| Formats prix differents catalogue/panier | Comparaison numerique via extraction chiffres |
PERFSHOP_FRONTEND_INTERNAL mauvaise variable |
PERFSHOP_FRONTEND_URL depuis /etc/environment |
Resultat : CT-002 PASS via Squash TM avec Chrome visible dans Selenium noVNC.
test_prix_panier.py — corrige (pas encore valide)¶
Memes corrections que CT-002 appliquees au script Python/pytest :
- XPath corrects pour les prix (style inline React)
- Navigation SPA (clic navbar, pas driver.get)
- time.sleep(2) pour stabilisation React
- Fonction _extract_price() pour comparaison numerique
- Variable PERFSHOP_FRONTEND_URL (pas PERFSHOP_FRONTEND_INTERNAL)
- Options Chrome correctes (--ignore-certificate-errors)
Architecture multi-environnement finalisee¶
| Variable | NAS prod | Desktop / Build local |
|---|---|---|
PUBLIC_API_URL |
https://perfshop-api.perfshop.io |
http://perfshop-app:8080 |
PERFSHOP_FRONTEND_URL |
https://perfshop.perfshop.io |
http://perfshop-frontend |
| CT-001 cible | API publique | API interne Docker |
| CT-002 cible | Frontend public (Chrome reel) | Frontend interne Docker |
Documentation produite¶
| Fichier | Contenu |
|---|---|
guides/squash-orchestrator-setup.md |
Reecrit complet — token RS512, seed auto, troubleshooting |
guides/squash-configuration.md |
Nouveau — configuration pas-a-pas avec toutes les valeurs exactes |
guides/robot-framework-guide.md |
Nouveau — guide eleve RF avec selecteurs PerfShop, exemples, prerequis |
vibe-coding/session-23.md |
Journal de session |
mkdocs.yml |
Session 23 + 2 nouveaux guides ajoutes a la navigation |