mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
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:
@@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user