test(e2e): modernize stale routes for 2.0 section URLs (#347)

The e2e specs predate the 2.0 section-route migration and navigated to
single-segment tool URLs (/resize) that now 404 (App.tsx only mounts
/:section/:toolId). This broke the whole e2e suite (Cross-Browser, Device
Matrix, E2E Full, Visual) - part of the known stale-spec backlog.

- Sweep 929 goto("/<tool>") -> goto("/<section>/<tool>") across 45 spec
  files, using the authoritative TOOLS + toolSection() mapping. Two-segment
  routes, top-level routes (/automate, /editor, ...), and intentional 404
  tests (/nonexistent-*) are untouched.
- Implement the legacy redirects the specs already assert: the 1.x color
  tools (brightness-contrast, saturation, color-channels, color-effects)
  redirect to /image/adjust-colors (App.tsx). Good for old bookmarks too.
- Remove the analytics-consent page tests (gui-navigation + gui-visual);
  #336 deleted that page.

Mechanical + biome-clean + web typecheck passes. Browser-specific behavior
can only be confirmed by the nightly e2e jobs.
This commit is contained in:
SnapOtter
2026-06-24 20:19:37 +08:00
committed by GitHub
parent 3dd0ebb49d
commit 0f98f60c33
46 changed files with 947 additions and 969 deletions
+18 -18
View File
@@ -6,12 +6,12 @@ import { expect, test, uploadTestImage } from "./helpers";
test.describe("Beautify Screenshot", () => {
test("renders tool page with settings", async ({ loggedInPage: page }) => {
await page.goto("/beautify");
await page.goto("/image/beautify");
await expect(page.getByText("Beautify Screenshot").first()).toBeVisible();
});
test("uploads image and shows preview", async ({ loggedInPage: page }) => {
await page.goto("/beautify");
await page.goto("/image/beautify");
await uploadTestImage(page);
await page.waitForTimeout(1000);
@@ -20,7 +20,7 @@ test.describe("Beautify Screenshot", () => {
});
test("shows preset cards", async ({ loggedInPage: page }) => {
await page.goto("/beautify");
await page.goto("/image/beautify");
// Quick Presets section is open by default
await expect(page.getByText("Quick Presets").first()).toBeVisible();
@@ -30,7 +30,7 @@ test.describe("Beautify Screenshot", () => {
});
test("shows background, frame, spacing, and shadow sections", async ({ loggedInPage: page }) => {
await page.goto("/beautify");
await page.goto("/image/beautify");
await expect(page.getByText("Background").first()).toBeVisible();
await expect(page.getByText("Device Frame").first()).toBeVisible();
@@ -39,14 +39,14 @@ test.describe("Beautify Screenshot", () => {
});
test("submit button uses data-testid", async ({ loggedInPage: page }) => {
await page.goto("/beautify");
await page.goto("/image/beautify");
await uploadTestImage(page);
await expect(page.getByTestId("beautify-submit")).toBeVisible();
});
test("processes image with default settings", async ({ loggedInPage: page }) => {
await page.goto("/beautify");
await page.goto("/image/beautify");
await uploadTestImage(page);
await page.waitForTimeout(1500);
@@ -64,7 +64,7 @@ test.describe("Beautify Screenshot", () => {
});
test("applies preset and processes", async ({ loggedInPage: page }) => {
await page.goto("/beautify");
await page.goto("/image/beautify");
await uploadTestImage(page);
await page.waitForTimeout(1500);
@@ -97,7 +97,7 @@ test.describe("Beautify Screenshot", () => {
// ---------------------------------------------------------------------------
test("live preview shows gradient background on wrapper", async ({ loggedInPage: page }) => {
await page.goto("/beautify");
await page.goto("/image/beautify");
await uploadTestImage(page);
await page.waitForTimeout(1000);
@@ -109,7 +109,7 @@ test.describe("Beautify Screenshot", () => {
});
test("live preview renders macOS frame chrome", async ({ loggedInPage: page }) => {
await page.goto("/beautify");
await page.goto("/image/beautify");
await uploadTestImage(page);
await page.waitForTimeout(1000);
@@ -118,7 +118,7 @@ test.describe("Beautify Screenshot", () => {
});
test("switching to Windows frame shows Windows title bar", async ({ loggedInPage: page }) => {
await page.goto("/beautify");
await page.goto("/image/beautify");
await uploadTestImage(page);
await page.waitForTimeout(1000);
@@ -130,7 +130,7 @@ test.describe("Beautify Screenshot", () => {
});
test("switching to Browser frame shows tab bar and URL bar", async ({ loggedInPage: page }) => {
await page.goto("/beautify");
await page.goto("/image/beautify");
await uploadTestImage(page);
await page.waitForTimeout(1000);
@@ -141,7 +141,7 @@ test.describe("Beautify Screenshot", () => {
});
test("switching to None frame removes frame preview", async ({ loggedInPage: page }) => {
await page.goto("/beautify");
await page.goto("/image/beautify");
await uploadTestImage(page);
await page.waitForTimeout(1000);
@@ -159,7 +159,7 @@ test.describe("Beautify Screenshot", () => {
});
test("device frame shows label indicator", async ({ loggedInPage: page }) => {
await page.goto("/beautify");
await page.goto("/image/beautify");
await uploadTestImage(page);
await page.waitForTimeout(1000);
@@ -170,7 +170,7 @@ test.describe("Beautify Screenshot", () => {
});
test("custom shadow values reflect in preview", async ({ loggedInPage: page }) => {
await page.goto("/beautify");
await page.goto("/image/beautify");
await uploadTestImage(page);
await page.waitForTimeout(1000);
@@ -189,7 +189,7 @@ test.describe("Beautify Screenshot", () => {
});
test("watermark text appears in preview overlay", async ({ loggedInPage: page }) => {
await page.goto("/beautify");
await page.goto("/image/beautify");
await uploadTestImage(page);
await page.waitForTimeout(1000);
@@ -212,7 +212,7 @@ test.describe("Beautify Screenshot", () => {
test("image stays visible for every preset (no zero-height collapse)", async ({
loggedInPage: page,
}) => {
await page.goto("/beautify");
await page.goto("/image/beautify");
await uploadTestImage(page);
await page.waitForTimeout(1000);
@@ -241,7 +241,7 @@ test.describe("Beautify Screenshot", () => {
test("image stays visible when watermark is added without a frame", async ({
loggedInPage: page,
}) => {
await page.goto("/beautify");
await page.goto("/image/beautify");
await uploadTestImage(page);
await page.waitForTimeout(1000);
@@ -270,7 +270,7 @@ test.describe("Beautify Screenshot", () => {
test("image stays visible when watermark is added with a frame", async ({
loggedInPage: page,
}) => {
await page.goto("/beautify");
await page.goto("/image/beautify");
await uploadTestImage(page);
await page.waitForTimeout(1000);