Stabilize Playwright pointer interactions after lazy loading
All checks were successful
Validate and deploy Sokko G / validate (push) Successful in 18m11s
Validate and deploy Sokko G / deploy (push) Successful in 10s

This commit is contained in:
Shinuwa 2026-10-30 14:14:23 +01:00
parent 9242becb1d
commit 4cb6487f85
12 changed files with 59 additions and 38 deletions

View file

@ -1,5 +1,6 @@
// Rôle : vérifie les calculs hiérarchiques et les actions du calculateur dans une toolbox réelle.
import { expect, test } from "@playwright/test";
import { movePointerTo, startPointerDrag } from "./helpers/pointer.js";
import { readStoredModuleData } from "./helpers/storage.js";
async function setup(page) {
@ -156,12 +157,9 @@ test("reordering roots keeps descendants attached and rejects moving a child to
await tool.getByLabel("Libellé", { exact: true }).fill("Child");
await tool.getByRole("button", { name: "Mettre à jour", exact: true }).click();
async function drag(label, targetLabel) {
await tool.getByRole("button", { name: `Déplacer ${label}`, exact: true }).hover();
await page.mouse.down();
await startPointerDrag(page, tool.getByRole("button", { name: `Déplacer ${label}`, exact: true }));
const target = entry(tool, targetLabel);
await target.scrollIntoViewIfNeeded();
const box = await target.boundingBox();
await page.mouse.move(box.x + box.width / 2, box.y + box.height * 0.2, { steps: 5 });
await movePointerTo(page, target, { y: 0.2 });
await page.mouse.up();
}
await drag("Second", "First");