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:
SnapOtter
2026-05-09 18:02:58 +08:00
parent 7b1f09f5d0
commit a0556772e8
76 changed files with 13112 additions and 117 deletions
+66
View File
@@ -142,6 +142,24 @@ test.describe("GUI Essential Tools", () => {
await expect(downloadLink).toBeVisible({ timeout: 15_000 });
await expect(downloadLink).toHaveText(/Download/);
});
test("width and height inputs accept numeric values", async ({ loggedInPage: page }) => {
await page.goto("/resize");
await uploadTestImage(page);
await page.locator("#resize-width").fill("200");
await expect(page.locator("#resize-width")).toHaveValue("200");
});
test("scale percentage quick buttons are interactive", async ({ loggedInPage: page }) => {
await page.goto("/resize");
await uploadTestImage(page);
await page.getByText("Scale").click();
await page.getByRole("button", { name: "50%" }).click();
// Scale value should update
await expect(page.locator("#resize-scale")).toHaveValue("50");
});
});
// ========================================================================
@@ -482,6 +500,31 @@ test.describe("GUI Essential Tools", () => {
await expect(page.getByTestId("convert-submit")).toBeVisible();
});
test("quality slider hidden for TIFF lossless format", async ({ loggedInPage: page }) => {
await page.goto("/convert");
await uploadTestImage(page);
await page.selectOption("#convert-target-format", "tiff");
await expect(page.locator("#convert-quality")).not.toBeVisible();
});
test("changing format resets quality slider visibility", async ({ loggedInPage: page }) => {
await page.goto("/convert");
await uploadTestImage(page);
// Start with JPG (lossy, shows quality)
await page.selectOption("#convert-target-format", "jpg");
await expect(page.locator("#convert-quality")).toBeVisible();
// Switch to PNG (lossless, hides quality)
await page.selectOption("#convert-target-format", "png");
await expect(page.locator("#convert-quality")).not.toBeVisible();
// Switch back to WebP (lossy, shows quality)
await page.selectOption("#convert-target-format", "webp");
await expect(page.locator("#convert-quality")).toBeVisible();
});
test("processes conversion and shows download", async ({ loggedInPage: page }) => {
await page.goto("/convert");
await uploadTestImage(page);
@@ -554,6 +597,29 @@ test.describe("GUI Essential Tools", () => {
await expect(page.getByTestId("compress-submit")).toBeVisible();
});
test("switching between Quality and Target Size modes", async ({ loggedInPage: page }) => {
await page.goto("/compress");
await uploadTestImage(page);
// Switch to Target Size
await page.getByRole("button", { name: "Target Size" }).click();
await expect(page.locator("#compress-target-size")).toBeVisible();
// Switch back to Quality
await page.getByRole("button", { name: "Quality" }).click();
await expect(page.locator("#compress-quality")).toBeVisible();
});
test("submit disabled without file, enabled with file", async ({ loggedInPage: page }) => {
await page.goto("/compress");
const submitBtn = page.getByTestId("compress-submit");
await expect(submitBtn).toBeDisabled();
await uploadTestImage(page);
await expect(submitBtn).toBeEnabled();
});
test("processes compression and shows download with size info", async ({
loggedInPage: page,
}) => {