Exercices de chaque côté : objectif « / côté », chrono droite puis gauche (R1)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Pierre MARTIN
2026-11-22 21:36:04 +01:00
co-authored by Claude Opus 5.5
parent ca680c7035
commit 4456327417
20 changed files with 310 additions and 18 deletions
+32
View File
@@ -484,6 +484,38 @@ function check(scheme, cond, msg) {
await go("#/analyses");
ok(await page.getByText(`Record ${wodTime} · Scaled`).isVisible(), "analyses : record du WOD");
// ---- de chaque côté : le chrono enchaîne droite, changement de côté, gauche ------------
const sidesLink = await page.evaluate(async () => {
const { store } = await import("./main.js");
const program = structuredClone(store.getState().program);
program.sessions.push({ key: "G1", oneOff: true, name: "Gainage", warmup: [], exercises: [{ ref: "side-plank", sets: 1, reps: "1 min", rest: 0 }] });
return "#import-json=" + encodeURIComponent(JSON.stringify({ program, reason: "Du gainage latéral." }));
});
await go(sidesLink);
await button("Adopter").click();
await settle();
await go("#/seance/G1");
await page.locator("summary", { hasText: "Gainage latéral" }).click();
const side = page.locator("details[open]", { hasText: "Gainage latéral" });
ok(/1 × 60 s \/ côté/.test(await side.locator(".exercise__sub").textContent() ?? ""), "de chaque côté : objectif « / côté »");
await side.getByRole("button", { name: "Lancer la série · 60 s par côté" }).click();
ok(/^Côté droit/.test(await page.locator(".timer__label").textContent() ?? ""), "chrono : côté droit d'abord");
await page.clock.fastForward(61000);
await page.waitForTimeout(300);
ok(await page.locator(".timer__label").textContent() === "Change de côté", "chrono : changement de côté");
ok(await side.locator(".set-btn--done").count() === 0, "la série n'est pas cochée après un seul côté");
await page.clock.fastForward(6000);
await page.waitForTimeout(300);
ok(/^Côté gauche/.test(await page.locator(".timer__label").textContent() ?? ""), "chrono : puis côté gauche");
await shot("23b-cotes");
await page.clock.fastForward(61000);
await page.waitForTimeout(300);
ok(await side.locator(".set-btn--done").count() === 1, "les deux côtés faits : la série est cochée");
await side.locator(".effort[data-effort=ok]").click();
await button("Terminer la séance").click();
await settle();
ok(page.url().endsWith("#/bravo"), "séance de gainage enregistrée");
// ---- WOD de référence (lot 4d) : catalogue, fiche, « Faire aujourd'hui » ----------
await go("#/");
await page.getByRole("link", { name: /^WOD/ }).click();