Remplacer un exercice en séance (lot 3b)
Lien « Machine prise ? » sur la carte, bibliothèque en mode choix (#/bibliotheque?remplacer=A.3), proches d'abord ; replaces dans SessionLogged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
b385c4566b
commit
38e0283f3d
@@ -289,6 +289,27 @@ function check(scheme, cond, msg) {
|
||||
await settle();
|
||||
ok(/## Ma demande/.test(await page.evaluate(() => navigator.clipboard.readText())), "texte pour l'IA copié");
|
||||
|
||||
// ---- remplacer un exercice en séance (lot 3b) -----------------------------------
|
||||
await go("#/seance/A");
|
||||
const firstCard = page.locator("details.exercise:not(.exercise--warmup)").first();
|
||||
if (!(await firstCard.getAttribute("open") !== null)) await firstCard.locator("summary").click();
|
||||
const planned = ((await firstCard.locator(".exercise__name strong").textContent()) ?? "").trim();
|
||||
await firstCard.getByRole("button", { name: "Machine prise ? Remplacer cet exercice" }).click();
|
||||
await settle();
|
||||
ok(await page.locator("h1").textContent() === "Remplacer" && page.url().includes("remplacer=A.1"), "bibliothèque en mode choix");
|
||||
await shot("21-remplacer", true);
|
||||
const pickRow = page.locator(".rows button.row").first();
|
||||
const picked = ((await pickRow.locator(".row__title").textContent()) ?? "").trim();
|
||||
await pickRow.click();
|
||||
await settle();
|
||||
const card = page.locator("details.exercise:not(.exercise--warmup)").first();
|
||||
ok(page.url().endsWith("#/seance/A") && ((await card.locator(".exercise__name strong").textContent()) ?? "").includes(picked), `remplacé : ${planned} → ${picked}`);
|
||||
ok(await card.getByText(`À la place de « ${planned} »`).isVisible(), "la carte rappelle l'exercice prévu");
|
||||
await shot("22-remplace", true);
|
||||
await card.getByRole("button", { name: `Revenir à « ${planned} »` }).click();
|
||||
await settle();
|
||||
ok(((await page.locator("details.exercise:not(.exercise--warmup)").first().locator(".exercise__name strong").textContent()) ?? "").includes(planned), "retour à l'exercice prévu");
|
||||
|
||||
// ---- données : export, texte pour l'IA, import ----------------------------------
|
||||
await go("#/donnees");
|
||||
const dl = page.waitForEvent("download");
|
||||
|
||||
Reference in New Issue
Block a user