Nouvelle app Vite/React independante (workspace apps/*), calquee sur apps/web : port 5174, sa propre image Docker (nginx statique), son propre domaine/deploiement. - AdminApiClient (VITE_ADMIN_API_URL, credentials: include) + ApiError. - AdminAuthContext / RequireAdmin : restaure la session admin via GET /admin/auth/me, garde de route (miroir de AuthContext/RequireAuth). - LoginPage (/login) : validation cliente via adminLoginSchema partage, erreurs traduites via ErrorMessageService. - AdminLayout : sidebar (Tableau de bord / Monitoring / Corrections) + deconnexion, rendu une fois autour du groupe RequireAdmin. - Pages Dashboard / Monitoring / Corrections en placeholder (remplies aux PR 3-5). - i18n fr (bloc admin.* + sous-ensemble errors.*), tokens _theme.scss copies de apps/web (extraction en package partage : suivi separe). - Dockerfile multi-stage (node build -> nginx:alpine) + nginx.conf (SPA fallback). Service admin-web dans docker-compose.yml (port ADMIN_WEB_PORT, VITE_ADMIN_API_URL en build arg). - Cypress : login.feature (KO -> message, OK -> dashboard) + admin-layout .cy.ts (redirection /login sans session, nav entre sections, logout). Job "Run admin-web E2E tests" ajoute a ci.yml. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
24 lines
1 KiB
Gherkin
24 lines
1 KiB
Gherkin
Feature: Admin login
|
|
As an operator
|
|
I want to sign in to the admin application
|
|
So that I can reach the metrics, monitoring and correction-triage sections
|
|
|
|
Scenario: A wrong password shows a translated error, no redirect
|
|
Given the admin session check returns unauthenticated
|
|
And admin login fails with invalid credentials
|
|
When I visit "/login"
|
|
And I fill in the "email" field with "ops@example.com"
|
|
And I fill in the "password" field with "wrong"
|
|
And I click the button "Se connecter"
|
|
Then I should see "Email ou mot de passe incorrect"
|
|
And the URL should include "/login"
|
|
|
|
Scenario: A correct login lands on the dashboard
|
|
Given the admin session check returns unauthenticated
|
|
And admin login succeeds as "Ops"
|
|
When I visit "/login"
|
|
And I fill in the "email" field with "ops@example.com"
|
|
And I fill in the "password" field with "correct-horse"
|
|
And I click the button "Se connecter"
|
|
Then the URL should not include "/login"
|
|
And I should see the heading "Tableau de bord"
|