Code/tests/integration/test_plan_action.py
Stéphan Peccini cf91d0b69e
test(integration): 3 scénarios E2E Playwright (Fiches, Analyse, Plan d'action)
- Infrastructure test : StreamlitApp helper, réinitialisation session, serveur dédié port 8502
- Scénario Fiches : sélection dossier Assemblage + fiche casques VR
- Scénario Analyse : Serveur→Pays géo, Germanium, Chine, filtre IHH Pays, vérification Sankey
- Scénario Plan d'action : Serveur + Germanium, vérification dashboard criticités

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 11:52:40 +01:00

36 lines
1.2 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""Test E2E Scénario 3 : Plan d'action Serveur + Germanium."""
import pytest
from playwright.sync_api import expect
pytestmark = pytest.mark.integration
def test_plan_action_serveur_germanium(app):
"""Soumet Serveur + Germanium et vérifie le dashboard de résultats."""
page = app.page
# Naviguer vers l'onglet Plan d'action
app.naviguer_vers("Plan d'action")
expect(page.get_by_role("heading", name="Analyse du graphe pour action")).to_be_visible(timeout=15000)
# Sélectionner le produit final : Serveur
app.ajouter_multiselect("noeuds de départ", "Serveur")
# Ajouter le minerai : Germanium
app.ajouter_multiselect("minerais", "Germanium")
# Soumettre la demande
app.cliquer_bouton("Soumettre")
# Vérifier le dashboard (stage 1)
expect(page.get_by_text("Panneau de sélection")).to_be_visible(timeout=30000)
expect(page.get_by_text("Top chaînes critiques")).to_be_visible()
# Vérifier la chaîne critique principale
expect(page.get_by_text("Serveur ↔ Carte mère ↔ Germanium").first).to_be_visible()
# Vérifier les criticités
expect(page.get_by_text("Synthèse des criticités")).to_be_visible()
expect(page.get_by_text("Criticité globale").first).to_be_visible()