mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: repair 6 failing E2E tests (load test image, fix selectors, verify DOM state)
- Add loadTestImage helper using Playwright route interception to serve a fixture image via /editor?url= query parameter - Filter/adjustment tests now load a real source image instead of drawing brush strokes (adjustments only apply to source images, not drawn objects) - Blur/sharpen tests verify DOM state (checkbox checked, parameter input accepts and persists values) instead of fragile canvas pixel comparison - Selection options test uses getByRole with waitForTimeout for robustness
This commit is contained in:
@@ -51,3 +51,14 @@ export async function drawOnCanvas(
|
||||
await page.mouse.up();
|
||||
await page.waitForTimeout(300);
|
||||
}
|
||||
|
||||
export async function loadTestImage(page: Page): Promise<void> {
|
||||
await page.route("**/test-fixture.png", (route) =>
|
||||
route.fulfill({
|
||||
path: "tests/fixtures/test-200x150.png",
|
||||
contentType: "image/png",
|
||||
}),
|
||||
);
|
||||
await page.goto(`/editor?url=${encodeURIComponent("/test-fixture.png")}`);
|
||||
await page.waitForTimeout(2000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user