sokko-g/e2e/helpers/pointer.js
Shinuwa 22b397ebfa Document Sokko G's architecture and folders, and move JavaScript file headers to JSDoc @file blocks
Add ARCHITECTURE.md (layers, flows, folder map, glossary), CONTRIBUTING.md
(setup and step-by-step recipes) and a README in each main folder, with an
index of docs/. Convert the 511 JavaScript headers from "// Rôle :" lines to
JSDoc @file blocks, define a three-level header template in website/AGENTS.md
and check the header in tests/file-headers.test.mjs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 09:42:13 +01:00

28 lines
951 B
JavaScript

/**
* @file Stabilise les gestes pointeur Playwright face aux chargements différés et aux déplacements de mise en
* page.
*/
import { expect } from "@playwright/test";
export async function waitForLazyModules(page) {
await expect(page.locator(".module-loading-fallback")).toHaveCount(0);
}
export async function startPointerDrag(page, source) {
await expect(source).toBeVisible();
await waitForLazyModules(page);
await source.scrollIntoViewIfNeeded();
const box = await source.boundingBox();
expect(box).not.toBeNull();
await page.mouse.move(box.x + box.width / 2, box.y + box.height / 2);
await page.mouse.down();
return box;
}
export async function movePointerTo(page, target, { x = 0.5, y = 0.5, steps = 5 } = {}) {
await target.scrollIntoViewIfNeeded();
const box = await target.boundingBox();
expect(box).not.toBeNull();
await page.mouse.move(box.x + box.width * x, box.y + box.height * y, { steps });
}