✅ Tests Playwright (20 parcours utilisateur) + suite backend renforcee (56) + DOCUMENTATION.md + nettoyage (settings_store, react-router)
This commit is contained in:
1 parent
231a1f2599
commit
adab24ca61
20 files changed
+1315
-88
No files matched your search
@@ -0,0 +1,33 @@
|
||||
import {expect, test} from "@playwright/test";
|
||||
|
||||
import {login} from "./helpers";
|
||||
|
||||
test("la connexion refuse un mauvais mot de passe", async ({page}) => {
|
||||
await page.goto("/");
|
||||
await page.getByLabel("Nom d’utilisateur").fill("admin");
|
||||
await page.getByLabel("Mot de passe").fill("faux");
|
||||
await page.getByRole("button", {name: "Se connecter"}).click();
|
||||
await expect(page.getByText("Identifiants incorrects")).toBeVisible();
|
||||
await expect(page.getByRole("button", {name: "Se connecter"})).toBeVisible();
|
||||
});
|
||||
|
||||
test("la connexion réussie mène au tableau de bord, la déconnexion revient au login", async ({
|
||||
page,
|
||||
}) => {
|
||||
await login(page);
|
||||
await expect(page.getByRole("button", {name: "Tableau de bord"})).toBeVisible();
|
||||
|
||||
// Menu utilisateur: theme + déconnexion.
|
||||
await page.getByRole("button", {name: "Menu utilisateur"}).click();
|
||||
await page.getByRole("menuitem", {name: "Déconnexion"}).click();
|
||||
await expect(page.getByRole("button", {name: "Se connecter"})).toBeVisible();
|
||||
});
|
||||
|
||||
test("le basculement de thème persiste", async ({page}) => {
|
||||
await login(page);
|
||||
await page.getByRole("button", {name: "Menu utilisateur"}).click();
|
||||
await page.getByRole("menuitem", {name: "Passer en thème clair"}).click();
|
||||
await expect(page.locator("html")).toHaveAttribute("data-theme", "light");
|
||||
await page.reload();
|
||||
await expect(page.locator("html")).toHaveAttribute("data-theme", "light");
|
||||
});
|
||||
Reference in new issue
Block a user