- 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>
49 lines
1.7 KiB
Python
49 lines
1.7 KiB
Python
"""Test E2E – Scénario 2 : Analyse complète Produit final → Pays géographique."""
|
||
|
||
import pytest
|
||
from playwright.sync_api import expect
|
||
|
||
pytestmark = pytest.mark.integration
|
||
|
||
|
||
def test_analyse_serveur_germanium_chine(app):
|
||
"""Formulaire complet : Serveur → Pays géo, Germanium, Chine, filtre IHH Pays."""
|
||
page = app.page
|
||
|
||
# Naviguer vers l'onglet Analyse (le graphe se charge automatiquement)
|
||
app.naviguer_vers("Analyse")
|
||
expect(page.get_by_role("heading", name="Analyse du graphe")).to_be_visible(timeout=15000)
|
||
|
||
# Sélectionner le niveau de départ : Produit final
|
||
app.choisir_selectbox("Niveau de départ", "Produit final")
|
||
|
||
# Sélectionner le niveau d'arrivée : Pays géographique
|
||
app.choisir_selectbox("Niveau d'arrivée", "Pays géographique")
|
||
|
||
# Ajouter le minerai Germanium
|
||
expect(page.get_by_text("Filtrer par minerais")).to_be_visible(timeout=10000)
|
||
app.ajouter_multiselect("minerais", "Germanium")
|
||
|
||
# Ajouter le nœud de départ : Serveur
|
||
app.ajouter_multiselect("noeuds de départ", "Serveur")
|
||
|
||
# Ajouter le nœud d'arrivée : Chine
|
||
app.ajouter_multiselect("noeuds d'arrivée", "Chine")
|
||
|
||
# Cocher le filtre IHH
|
||
app.cocher("IHH")
|
||
|
||
# Sélectionner Pays pour le filtre IHH
|
||
app.choisir_radio("Pays")
|
||
|
||
# Lancer l'analyse
|
||
app.cliquer_bouton("Lancer l'analyse")
|
||
|
||
# Vérifier que le diagramme Sankey s'affiche
|
||
expect(page.get_by_text("Hiérarchie filtrée")).to_be_visible(timeout=15000)
|
||
|
||
# Vérifier la présence de nœuds clés dans le graphe Sankey (Plotly)
|
||
sankey = page.get_by_test_id("stPlotlyChart")
|
||
expect(sankey.get_by_text("Serveur").first).to_be_visible()
|
||
expect(sankey.get_by_text("Germanium").first).to_be_visible()
|