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 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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue