mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
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:
@@ -234,7 +234,7 @@ test.describe("Visual Desktop (1280x720)", () => {
|
||||
|
||||
// ---- Tool page - resize (empty, no file) ----
|
||||
test("resize tool empty - light and dark", async ({ loggedInPage: page }) => {
|
||||
await page.goto("/resize");
|
||||
await page.goto("/image/resize");
|
||||
await page.waitForLoadState("networkidle");
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
@@ -243,7 +243,7 @@ test.describe("Visual Desktop (1280x720)", () => {
|
||||
|
||||
// ---- Tool page - resize (file uploaded, settings visible) ----
|
||||
test("resize tool with file - light and dark", async ({ loggedInPage: page }) => {
|
||||
await page.goto("/resize");
|
||||
await page.goto("/image/resize");
|
||||
await uploadTestImage(page);
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
@@ -255,7 +255,7 @@ test.describe("Visual Desktop (1280x720)", () => {
|
||||
|
||||
// ---- Tool page - compress (before-after result) ----
|
||||
test("compress tool before-after result - light and dark", async ({ loggedInPage: page }) => {
|
||||
await page.goto("/compress");
|
||||
await page.goto("/image/compress");
|
||||
await page.waitForLoadState("networkidle");
|
||||
|
||||
// Upload image and wait for auto-processing
|
||||
@@ -272,7 +272,7 @@ test.describe("Visual Desktop (1280x720)", () => {
|
||||
|
||||
// ---- Tool page - crop (interactive canvas) ----
|
||||
test("crop tool interactive canvas - light and dark", async ({ loggedInPage: page }) => {
|
||||
await page.goto("/crop");
|
||||
await page.goto("/image/crop");
|
||||
await page.waitForLoadState("networkidle");
|
||||
|
||||
// Upload image to get the interactive crop canvas
|
||||
@@ -289,7 +289,7 @@ test.describe("Visual Desktop (1280x720)", () => {
|
||||
|
||||
// ---- Tool page - qr-generate (no-dropzone, QR preview) ----
|
||||
test("qr-generate tool with preview - light and dark", async ({ loggedInPage: page }) => {
|
||||
await page.goto("/qr-generate");
|
||||
await page.goto("/image/qr-generate");
|
||||
await page.waitForLoadState("networkidle");
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
@@ -308,7 +308,7 @@ test.describe("Visual Desktop (1280x720)", () => {
|
||||
|
||||
// ---- Tool page - collage (template selection) ----
|
||||
test("collage tool template selection - light and dark", async ({ loggedInPage: page }) => {
|
||||
await page.goto("/collage");
|
||||
await page.goto("/image/collage");
|
||||
await page.waitForLoadState("networkidle");
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
@@ -316,30 +316,6 @@ test.describe("Visual Desktop (1280x720)", () => {
|
||||
await takeThemedScreenshots(page, "tool-collage-templates");
|
||||
});
|
||||
|
||||
// ---- Analytics consent page ----
|
||||
test.describe("Analytics consent page", () => {
|
||||
test.use({ storageState: { cookies: [], origins: [] } });
|
||||
|
||||
test("analytics consent page - light and dark", async ({ page }) => {
|
||||
await page.goto("/analytics-consent");
|
||||
await page.waitForLoadState("networkidle");
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
// Light screenshot
|
||||
await expect(page).toHaveScreenshot("desktop-analytics-consent-light.png", {
|
||||
fullPage: false,
|
||||
});
|
||||
|
||||
// Toggle to dark
|
||||
await page.keyboard.press(`${MOD}+Shift+d`);
|
||||
await page.waitForTimeout(300);
|
||||
|
||||
await expect(page).toHaveScreenshot("desktop-analytics-consent-dark.png", {
|
||||
fullPage: false,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// ---- Change password page ----
|
||||
test("change password page - light and dark", async ({ loggedInPage: page }) => {
|
||||
await page.goto("/change-password");
|
||||
@@ -393,7 +369,7 @@ test.describe("Visual Desktop (1280x720)", () => {
|
||||
|
||||
// ---- Tool page - convert (empty state) ----
|
||||
test("convert tool empty - light and dark", async ({ loggedInPage: page }) => {
|
||||
await page.goto("/convert");
|
||||
await page.goto("/image/convert");
|
||||
await page.waitForLoadState("networkidle");
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
@@ -402,7 +378,7 @@ test.describe("Visual Desktop (1280x720)", () => {
|
||||
|
||||
// ---- Tool page - convert (file uploaded, format selection visible) ----
|
||||
test("convert tool with file - light and dark", async ({ loggedInPage: page }) => {
|
||||
await page.goto("/convert");
|
||||
await page.goto("/image/convert");
|
||||
await uploadTestImage(page);
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
@@ -413,7 +389,7 @@ test.describe("Visual Desktop (1280x720)", () => {
|
||||
|
||||
// ---- 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.goto("/image/watermark-text");
|
||||
await page.waitForLoadState("networkidle");
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
@@ -422,7 +398,7 @@ test.describe("Visual Desktop (1280x720)", () => {
|
||||
|
||||
// ---- Tool page - border (live-preview mode) ----
|
||||
test("border tool empty - light and dark", async ({ loggedInPage: page }) => {
|
||||
await page.goto("/border");
|
||||
await page.goto("/image/border");
|
||||
await page.waitForLoadState("networkidle");
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
@@ -473,7 +449,7 @@ test.describe("Visual Desktop (1280x720)", () => {
|
||||
|
||||
// ---- 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.goto("/image/strip-metadata");
|
||||
await page.waitForLoadState("networkidle");
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
@@ -482,7 +458,7 @@ test.describe("Visual Desktop (1280x720)", () => {
|
||||
|
||||
// ---- Tool page - info (before-after mode) ----
|
||||
test("info tool empty - light and dark", async ({ loggedInPage: page }) => {
|
||||
await page.goto("/info");
|
||||
await page.goto("/image/info");
|
||||
await page.waitForLoadState("networkidle");
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user