Files
SnapOtter/tests/e2e/gui-qa-fixes.spec.ts
T
SnapOtterandGitHub d10d0f544f fix: release QA hardening across processing, media, security, and CI gates (#649)
A release-readiness QA pass over the whole product. The commits split into
defects a user would hit and gates that were reporting green while measuring
nothing.

## Fixes that change behaviour

Rate limiting was bypassable on every install: TRUST_PROXY defaulted to true, so
request.ip came from a client-set header and a forged X-Forwarded-For got past
the login limiter. The default is now a private-network trust list.

A transient Postgres outage stranded in-flight jobs, leaving finished output on
disk with no row pointing at it. A reconciler now resolves those rows and adopts
the bytes rather than dropping the work.

A Redis connection that moved to a new address wedged every read-blocked
consumer, so completions stopped signalling while health still answered 200.
Socket timeouts plus subscriber pings recover it.

Installing more than one AI bundle left the shared venv multi-versioned and
silently broke three tools. The installer now reconciles distributions to one
version each.

Converting an image to JXL at quality 1 through 4 returned a 500, because
libjxl 0.7 rejects the distance those values compute. The quality is floored at
what the encoder honours. A missing ffmpeg was also reported to the user as a
corrupt upload; it now says the engine is unavailable.

RAW uploads reached an unpatched LibRaw on arm64, so it is built from source at
0.22.2, and the release scan was split so it can fail on an unfixed critical
instead of hiding it behind ignore-unfixed.

## Gates that could not fail

Two mutation lanes ran zero mutants because Stryker crawled the gitignored docs
build; coverage discarded its whole report on any failing test; the lint gate
skipped root tests, scripts, and two workspaces; and several generated matrices
counted a host missing ffmpeg as a passing tool. Each now measures what it
claims.

Full evidence and the outstanding release items are tracked locally and are not
part of this branch.
2026-07-27 15:37:30 +08:00

96 lines
3.6 KiB
TypeScript

import { expect, test } from "./helpers";
test.describe("QA Fixes Verification", () => {
test("home page loads after login", async ({ page }) => {
await page.goto("/");
await page.waitForLoadState("networkidle");
await expect(page.locator("body")).not.toBeEmpty();
// Should see the main app, not the login page
await expect(page.locator("text=Login").first())
.not.toBeVisible({ timeout: 5_000 })
.catch(() => {});
});
test("tool page loads correctly", async ({ page }) => {
await page.goto("/image/resize");
await page.waitForLoadState("networkidle");
// Should see resize tool content
await expect(page.locator("text=Resize").first()).toBeVisible({ timeout: 10_000 });
});
test("noncanonical section for a known tool shows not-found state", async ({ page }) => {
await page.goto("/tools/resize");
await expect(page.getByText(/tool not found/i)).toBeVisible();
});
test("invalid tool slug shows not-found state", async ({ page }) => {
await page.goto("/zzz-nonexistent-tool-xyz");
await page.waitForLoadState("networkidle");
// Should show "Tool not found" or 404 text
const notFound = page.locator("text=not found").or(page.locator("text=404"));
await expect(notFound.first()).toBeVisible({ timeout: 10_000 });
});
test("multi-segment invalid URL shows 404 page", async ({ page }) => {
await page.goto("/some/deep/nested/invalid/path");
await page.waitForLoadState("networkidle");
const notFound = page
.locator("text=404")
.or(page.locator("text=not found"))
.or(page.locator("text=Page not found"))
.first();
await expect(notFound).toBeVisible({ timeout: 10_000 });
});
test("privacy page renders", async ({ page }) => {
await page.goto("/privacy");
await page.waitForLoadState("networkidle");
// Should show privacy policy content, not redirect away
const content = page.locator("text=Privacy").first();
await expect(content).toBeVisible({ timeout: 10_000 });
});
test("automate page loads and shows tool palette", async ({ page }) => {
await page.goto("/automate");
await page.waitForLoadState("networkidle");
// Should see the pipeline builder
const palette = page.locator("text=Resize").first();
await expect(palette).toBeVisible({ timeout: 10_000 });
});
test("files page loads", async ({ page }) => {
await page.goto("/files");
await page.waitForLoadState("networkidle");
// Should see the files interface (even if empty)
await expect(page.locator("body")).not.toBeEmpty();
});
test("settings dialog opens and shows tabs", async ({ page }) => {
await page.goto("/");
await page.waitForLoadState("networkidle");
// Click settings in sidebar
const settingsBtn = page.locator("text=Settings").first();
if (await settingsBtn.isVisible({ timeout: 3_000 }).catch(() => false)) {
await settingsBtn.click();
// Should see settings dialog with tabs
await expect(page.locator("text=General").first()).toBeVisible({ timeout: 5_000 });
}
});
test("editor page loads", async ({ page }) => {
await page.goto("/editor");
await page.waitForLoadState("networkidle");
// Should see the editor interface
await expect(page.locator("body")).not.toBeEmpty();
});
test("dropzone uses i18n strings (no hardcoded 'or')", async ({ page }) => {
await page.goto("/image/resize");
await page.waitForLoadState("networkidle");
// The dropzone should be visible with upload button
const uploadBtn = page.locator("text=Upload").first();
await expect(uploadBtn).toBeVisible({ timeout: 10_000 });
});
});