Bibliothèque consultable (lot 3a), arbitrages du lot 4

Écran #/bibliotheque : recherche, filtres zone, muscle, famille et matériel
dans l'adresse (nav.set), fiche avec place dans le programme, exercices
proches et « Demander à mon IA » ; exercices génériques. #import-json=
devient un fragment réservé. Plan du lot 4 (WOD).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Pierre MARTIN
2026-11-18 14:20:47 +01:00
co-authored by Claude Opus 5.5
parent 25639639cc
commit be3e820b88
15 changed files with 655 additions and 6 deletions
+31
View File
@@ -258,6 +258,37 @@ function check(scheme, cond, msg) {
ok(await page.getByText("Premier pas").isVisible(), "succès « Premier pas »");
await shot("14-progression", true);
// ---- bibliothèque : filtres dans l'adresse, fiche, retour (ADR 0009) -------------
await go("#/");
await page.getByRole("link", { name: /Bibliothèque/ }).click();
await settle();
ok(await page.locator("h1").textContent() === "Bibliothèque", "tuile vers la bibliothèque");
await button("Bas du corps").click();
await button("Fessiers").click();
await page.locator("#lib-q").fill("pont");
await page.waitForTimeout(400);
ok(page.url().endsWith("#/bibliotheque?q=pont&zone=lower&muscle=glutes"), "filtres dans l'adresse : " + page.url().split("#")[1]);
await shot("19-bibliotheque", true);
await page.reload();
await page.waitForSelector("h1");
await settle();
ok(await page.locator("#lib-q").inputValue() === "pont" && await button("Fessiers").getAttribute("aria-pressed") === "true", "filtres retrouvés après rechargement");
const firstHit = page.locator(".lib-results .row").first();
const hitName = (await firstHit.locator(".row__title").textContent()) ?? "";
await firstHit.click();
await settle();
ok(await page.locator("h1").textContent() === hitName, "fiche : " + hitName);
ok(await page.getByRole("heading", { name: "Exercices proches" }).isVisible(), "fiche : exercices proches");
await shot("20-fiche", true);
await page.goBack();
await settle();
ok(page.url().endsWith("?q=pont&zone=lower&muscle=glutes"), "retour : la liste filtrée");
await go("#/bibliotheque/squat");
ok(await page.getByText(/Fait \d+ fois/).isVisible(), "fiche du squat : historique et lien vers les analyses");
await button(/Demander à mon IA/).click();
await settle();
ok(/## Ma demande/.test(await page.evaluate(() => navigator.clipboard.readText())), "texte pour l'IA copié");
// ---- données : export, texte pour l'IA, import ----------------------------------
await go("#/donnees");
const dl = page.waitForEvent("download");