From a4aa5954c2bcb4fcfce7c019f0572dad4b2cb9fc Mon Sep 17 00:00:00 2001 From: margrop <1731827+margrop@users.noreply.github.com> Date: Fri, 4 Dec 2026 21:12:10 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E7=AD=89=E5=BE=85=E8=A3=81=E5=89=AA?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E6=89=93=E5=BC=80=E5=8A=A8=E7=94=BB=E7=BB=93?= =?UTF-8?q?=E6=9D=9F=E5=86=8D=E6=B5=8B=E9=87=8F=E5=B9=B6=E6=8B=96=E5=8A=A8?= =?UTF-8?q?=E4=B8=8B=E8=BE=B9=E6=89=8B=E6=9F=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- e2e/image-input.spec.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/e2e/image-input.spec.ts b/e2e/image-input.spec.ts index 1cc76764..2a6e3203 100644 --- a/e2e/image-input.spec.ts +++ b/e2e/image-input.spec.ts @@ -63,6 +63,8 @@ async function assertBottomCropHandle(page: Page) { const selection = cropper.locator('.ReactCrop__crop-selection'); const handle = cropper.locator('.ReactCrop__drag-handle.ord-se'); await expect(selection).toBeVisible(); + // 等进入动画结束再量位置与拖动,避免 zoom-in-95 缩放期间坐标与高度偏移 + await expect.poll(() => cropper.evaluate((el) => el.getAnimations().length)).toBe(0); const viewportBox = await viewport.boundingBox(); const selectionBox = await selection.boundingBox(); const handleBox = await handle.boundingBox(); @@ -72,7 +74,7 @@ async function assertBottomCropHandle(page: Page) { const before = selectionBox.height; await page.mouse.move(handleBox.x + handleBox.width / 2, handleBox.y + handleBox.height / 2); await page.mouse.down(); - await page.mouse.move(handleBox.x + handleBox.width / 2, handleBox.y + handleBox.height / 2 - 40); + await page.mouse.move(handleBox.x + handleBox.width / 2, handleBox.y + handleBox.height / 2 - 40, { steps: 5 }); await page.mouse.up(); await expect.poll(async () => (await selection.boundingBox())?.height ?? 0).toBeLessThan(before - 10); }