mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
test: expand coverage across all layers -- 1,268 new tests, fix replace-color div-by-zero
14-agent parallel test expansion covering integration, unit, E2E, E2E-Docker, cross-format matrix, adversarial, GUI navigation/tools/settings/visual/a11y/perf. - Integration: expand 23 tool test files with HEIC, stress, batch, edge cases - Unit: close coverage gaps in image-engine, stores, lib (metadata, auto-enhance, connection-store, lazy-with-retry, collage/file-store HEIC preview) - AI bridge: 141 new tests for dispatcher buffering, crash recovery, OOM/segfault - Cross-format: 794 parameterized tests (16 formats x 12 tools + no-crash matrix) - Adversarial: memory stress (50x large file), zero-byte, corrupted headers, unicode - E2E-Docker: expand 8 spec files with dimension verification, pipeline chains - GUI E2E: tool UI settings/interactions for all 47 tools, remove all test.skip, RBAC per-role verification, visual screenshot naming, cross-browser smoke tests, a11y ARIA/focus/contrast, performance budgets, 15-tool stability test - Fix: replace-color.ts tolerance=0 caused division-by-zero producing NaN pixels Total: 8,958 tests passing across 202 files. Zero failures, zero skips.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { expect, openSettings, test, uploadTestImage } from "./helpers";
|
||||
|
||||
const isDocker = process.env.CI === "true" || process.env.DOCKER === "true";
|
||||
const MOD = process.platform === "darwin" ? "Meta" : "Control";
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -40,7 +39,6 @@ async function takeThemedScreenshots(page: import("@playwright/test").Page, base
|
||||
// Tablet visual regression: 768x1024
|
||||
// ---------------------------------------------------------------------------
|
||||
test.describe("Visual Tablet (768x1024)", () => {
|
||||
test.skip(!isDocker, "Visual regression baselines are Docker-specific");
|
||||
test.use({ viewport: { width: 768, height: 1024 } });
|
||||
|
||||
// ---- Login page (unauthenticated) ----
|
||||
@@ -78,6 +76,16 @@ test.describe("Visual Tablet (768x1024)", () => {
|
||||
await page.waitForLoadState("networkidle");
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
// Verify sidebar transitions at tablet width: sidebar should collapse or narrow
|
||||
const sidebar = page.locator("aside");
|
||||
if (await sidebar.isVisible({ timeout: 2000 }).catch(() => false)) {
|
||||
const sidebarBox = await sidebar.boundingBox();
|
||||
if (sidebarBox) {
|
||||
// Sidebar should be narrower than full desktop width (< 280px)
|
||||
expect(sidebarBox.width).toBeLessThan(280);
|
||||
}
|
||||
}
|
||||
|
||||
await takeThemedScreenshots(page, "home-empty");
|
||||
});
|
||||
|
||||
@@ -167,6 +175,14 @@ test.describe("Visual Tablet (768x1024)", () => {
|
||||
await openSettings(page);
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
// Verify settings dialog fits within 768px tablet viewport
|
||||
const dialog = page.getByRole("dialog");
|
||||
const dialogBox = await dialog.boundingBox();
|
||||
if (dialogBox) {
|
||||
expect(dialogBox.x).toBeGreaterThanOrEqual(0);
|
||||
expect(dialogBox.x + dialogBox.width).toBeLessThanOrEqual(768 + 1);
|
||||
}
|
||||
|
||||
await takeThemedScreenshots(page, "settings-general");
|
||||
});
|
||||
|
||||
@@ -226,8 +242,15 @@ test.describe("Visual Tablet (768x1024)", () => {
|
||||
await uploadTestImage(page);
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
// Verify settings panel layout at tablet width
|
||||
// Verify settings panel layout at tablet width -- panel should not overflow viewport
|
||||
await expect(page.getByText("Settings").first()).toBeVisible();
|
||||
const settingsPanel = page.locator("[class*='settings'], [class*='Settings']").first();
|
||||
if (await settingsPanel.isVisible({ timeout: 2000 }).catch(() => false)) {
|
||||
const panelBox = await settingsPanel.boundingBox();
|
||||
if (panelBox) {
|
||||
expect(panelBox.x + panelBox.width).toBeLessThanOrEqual(768 + 1);
|
||||
}
|
||||
}
|
||||
|
||||
await takeThemedScreenshots(page, "tool-resize-settings");
|
||||
});
|
||||
@@ -245,6 +268,14 @@ test.describe("Visual Tablet (768x1024)", () => {
|
||||
await slider.waitFor({ state: "visible", timeout: 15000 }).catch(() => {});
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
// Verify comparison mode renders within narrower tablet width
|
||||
if (await slider.isVisible()) {
|
||||
const sliderBox = await slider.boundingBox();
|
||||
if (sliderBox) {
|
||||
expect(sliderBox.x + sliderBox.width).toBeLessThanOrEqual(768 + 1);
|
||||
}
|
||||
}
|
||||
|
||||
await takeThemedScreenshots(page, "tool-compress-result");
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user