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 ordres indépendants une/deux colonnes et leur persistance après déplacement réel.
import { test, expect } from "@playwright/test";
import { movePointerTo, startPointerDrag } from "./helpers/pointer.js";
import { resetSokkoStorage } from "./helpers/storage.js";
async function setup(page, columns) {
@ -25,12 +26,10 @@ async function savedOrder(page) {
}
async function drag(page, title, target, after = false) {
await page.getByRole("button", { name: `Déplacer ${title}`, exact: true }).hover();
await page.mouse.down();
const handle = page.getByRole("button", { name: `Déplacer ${title}`, exact: true });
await startPointerDrag(page, handle);
await expect(page.locator("article.module.is-dragging")).toHaveCount(1);
await target.scrollIntoViewIfNeeded();
const box = await target.boundingBox();
await page.mouse.move(box.x + box.width / 2, box.y + box.height * (after ? 0.8 : 0.2), { steps: 5 });
await movePointerTo(page, target, { y: after ? 0.8 : 0.2 });
await page.mouse.up();
await expect(page.locator("article.module.is-dragging")).toHaveCount(0);
}