Stabilize Playwright pointer interactions after lazy loading
This commit is contained in:
parent
9242becb1d
commit
4cb6487f85
12 changed files with 59 additions and 38 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue