test: expand test coverage across all layers (+1,157 tests)

Fix 2 failing unit tests (landing hero text mismatch) and broken
coverage tooling (brace-expansion v5 override breaking minimatch).
Add ~1,097 new test cases via 14-agent parallel expansion:

- Unit: +290 tests (AI bridge, image-engine, stores, API helpers)
- Integration: +504 tests (all tools, cross-format matrix, adversarial)
- E2E: +363 tests (navigation, tool UI, batch/pipeline, settings,
  visual regression, accessibility, performance, cross-browser)

Total: 4,223 unit + 6,057 integration + 1,563 E2E = 11,843 tests
This commit is contained in:
SnapOtter
2026-06-06 19:37:29 +08:00
parent 66e503730d
commit 06d1822491
67 changed files with 20114 additions and 49 deletions
+136
View File
@@ -334,4 +334,140 @@ test.describe("Visual Tablet (768x1024)", () => {
await takeThemedScreenshots(page, "analytics-consent");
});
});
// ---- Change password page ----
test("change password page - light and dark", async ({ loggedInPage: page }) => {
await page.goto("/change-password");
await page.waitForLoadState("networkidle");
await page.waitForTimeout(500);
await takeThemedScreenshots(page, "change-password");
});
// ---- Privacy policy page ----
test.describe("Privacy policy page", () => {
test.use({ storageState: { cookies: [], origins: [] } });
test("privacy policy page - light and dark", async ({ page }) => {
await page.goto("/privacy");
await page.waitForLoadState("networkidle");
await page.waitForTimeout(500);
await takeThemedScreenshots(page, "privacy-policy");
});
});
// ---- 404 Not Found page ----
test("not found page - light and dark", async ({ loggedInPage: page }) => {
await page.goto("/this-route-does-not-exist-404");
await page.waitForLoadState("networkidle");
await page.waitForTimeout(500);
await takeThemedScreenshots(page, "not-found");
});
// ---- Editor page (welcome/empty state) ----
test("editor page welcome state - light and dark", async ({ loggedInPage: page }) => {
await page.goto("/editor");
await page.waitForLoadState("networkidle");
await page.waitForTimeout(500);
await takeThemedScreenshots(page, "editor-welcome");
});
// ---- Tool page - convert (empty state) ----
test("convert tool empty - light and dark", async ({ loggedInPage: page }) => {
await page.goto("/convert");
await page.waitForLoadState("networkidle");
await page.waitForTimeout(500);
await takeThemedScreenshots(page, "tool-convert-empty");
});
// ---- Tool page - convert (file uploaded, format selection visible) ----
test("convert tool with file - light and dark", async ({ loggedInPage: page }) => {
await page.goto("/convert");
await uploadTestImage(page);
await page.waitForTimeout(500);
await expect(page.getByText("Settings").first()).toBeVisible();
// Verify settings panel fits within 768px tablet viewport
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-convert-settings");
});
// ---- Tool page - watermark-text (before-after mode) ----
test("watermark-text tool empty - light and dark", async ({ loggedInPage: page }) => {
await page.goto("/watermark-text");
await page.waitForLoadState("networkidle");
await page.waitForTimeout(500);
await takeThemedScreenshots(page, "tool-watermark-text-empty");
});
// ---- Tool page - border (live-preview mode) ----
test("border tool empty - light and dark", async ({ loggedInPage: page }) => {
await page.goto("/border");
await page.waitForLoadState("networkidle");
await page.waitForTimeout(500);
await takeThemedScreenshots(page, "tool-border-empty");
});
// ---- Settings dialog - Security tab ----
test("settings dialog security tab - light and dark", async ({ loggedInPage: page }) => {
await openSettings(page);
// Navigate to Security tab
await page.getByRole("button", { name: "Security" }).click();
await page.waitForTimeout(500);
// Verify dialog fits within 768px tablet viewport
const dialog = page.getByRole("dialog");
const dialogBox = await dialog.boundingBox();
if (dialogBox) {
expect(dialogBox.x + dialogBox.width).toBeLessThanOrEqual(768 + 1);
}
await takeThemedScreenshots(page, "settings-security");
});
// ---- Home page with search focused ----
test("home page search focused - light and dark", async ({ loggedInPage: page }) => {
await page.waitForLoadState("networkidle");
await page.waitForTimeout(500);
// Focus search bar via keyboard shortcut
const MOD_KEY = process.platform === "darwin" ? "Meta" : "Control";
await page.keyboard.press(`${MOD_KEY}+k`);
await page.waitForTimeout(300);
await takeThemedScreenshots(page, "home-search-focused");
});
// ---- Tool page - strip-metadata (no-comparison mode) ----
test("strip-metadata tool empty - light and dark", async ({ loggedInPage: page }) => {
await page.goto("/strip-metadata");
await page.waitForLoadState("networkidle");
await page.waitForTimeout(500);
await takeThemedScreenshots(page, "tool-strip-metadata-empty");
});
// ---- Tool page - info (before-after mode) ----
test("info tool empty - light and dark", async ({ loggedInPage: page }) => {
await page.goto("/info");
await page.waitForLoadState("networkidle");
await page.waitForTimeout(500);
await takeThemedScreenshots(page, "tool-info-empty");
});
});