Commit fe205e02 by PLN (Algolia)

test(redesign): Phase 1 Step 2 — add route-smoke safety net

Re-establish a baseline of coverage (Phase 0 removed all tests with Dunbar)
and guard the upcoming App Router migration: the route URLs are stable across
that migration, so this spec must stay green before and after.

- tests/e2e/smoke.spec.ts: visits all 14 public routes, asserts the document
  responds < 400, renders non-empty content, and throws no genuine uncaught
  exception. Tolerates dev-only React hydration warnings and third-party embed
  noise (would otherwise be flaky); caps the settle wait so embed-heavy pages
  don't hang.
- Fix a pre-existing Playwright version split: @playwright/test (1.57.0 via
  ^1.55.0) and playwright (1.58.2) resolved to two copies, breaking the runner
  ("test() not expected here"). Pin both to 1.60.0.

All 14 routes green (~55s, Node 20). Surfaced for later: a real /cosmicfest
dev-mode hydration mismatch (task #7), a legacyBehavior next/link deprecation,
and a next/head stylesheet warning — all to address in the App Router pass.
Co-Authored-By: 's avatarClaude Opus 4.8 (1M context) <noreply@anthropic.com>
parent 6e51fffd
......@@ -26,7 +26,7 @@ const RAW_RUNTIME_STATE =
[null, {\
"packageLocation": "./",\
"packageDependencies": [\
["@playwright/test", "npm:1.57.0"],\
["@playwright/test", "npm:1.60.0"],\
["@tailwindcss/postcss", "npm:4.2.1"],\
["@testing-library/dom", "npm:10.4.1"],\
["@testing-library/jest-dom", "npm:6.9.1"],\
......@@ -46,7 +46,7 @@ const RAW_RUNTIME_STATE =
["next", "virtual:599f9545309f05166d506895056809d0f5971d8f55d13475681739816b4bb6745eb725b53ed2108e22ea4ce46b8a2c491882d38a9948455117b545da3880eea7#npm:15.5.6"],\
["next-router-mock", "virtual:599f9545309f05166d506895056809d0f5971d8f55d13475681739816b4bb6745eb725b53ed2108e22ea4ce46b8a2c491882d38a9948455117b545da3880eea7#npm:1.0.4"],\
["p5", "npm:1.11.3"],\
["playwright", "npm:1.58.2"],\
["playwright", "npm:1.60.0"],\
["postcss", "npm:8.5.8"],\
["prismjs", "npm:1.30.0"],\
["react", "npm:18.3.1"],\
......@@ -2116,11 +2116,11 @@ const RAW_RUNTIME_STATE =
}]\
]],\
["@playwright/test", [\
["npm:1.57.0", {\
"packageLocation": "../../../.yarn/berry/cache/@playwright-test-npm-1.57.0-d5b9717312-10c0.zip/node_modules/@playwright/test/",\
["npm:1.60.0", {\
"packageLocation": "../../../.yarn/berry/cache/@playwright-test-npm-1.60.0-b1772ab412-10c0.zip/node_modules/@playwright/test/",\
"packageDependencies": [\
["@playwright/test", "npm:1.57.0"],\
["playwright", "npm:1.57.0"]\
["@playwright/test", "npm:1.60.0"],\
["playwright", "npm:1.60.0"]\
],\
"linkType": "HARD"\
}]\
......@@ -8245,7 +8245,7 @@ const RAW_RUNTIME_STATE =
["@next/swc-win32-arm64-msvc", "npm:15.5.6"],\
["@next/swc-win32-x64-msvc", "npm:15.5.6"],\
["@opentelemetry/api", null],\
["@playwright/test", "npm:1.57.0"],\
["@playwright/test", "npm:1.60.0"],\
["@swc/helpers", "npm:0.5.15"],\
["@types/babel-plugin-react-compiler", null],\
["@types/opentelemetry__api", null],\
......@@ -8814,37 +8814,21 @@ const RAW_RUNTIME_STATE =
}]\
]],\
["playwright", [\
["npm:1.57.0", {\
"packageLocation": "../../../.yarn/berry/cache/playwright-npm-1.57.0-1712c32e43-10c0.zip/node_modules/playwright/",\
["npm:1.60.0", {\
"packageLocation": "../../../.yarn/berry/cache/playwright-npm-1.60.0-f1d6ab02ce-10c0.zip/node_modules/playwright/",\
"packageDependencies": [\
["playwright", "npm:1.57.0"],\
["playwright", "npm:1.60.0"],\
["fsevents", "patch:fsevents@npm%3A2.3.2#optional!builtin<compat/fsevents>::version=2.3.2&hash=df0bf1"],\
["playwright-core", "npm:1.57.0"]\
],\
"linkType": "HARD"\
}],\
["npm:1.58.2", {\
"packageLocation": "../../../.yarn/berry/cache/playwright-npm-1.58.2-0c12daad27-10c0.zip/node_modules/playwright/",\
"packageDependencies": [\
["playwright", "npm:1.58.2"],\
["fsevents", "patch:fsevents@npm%3A2.3.2#optional!builtin<compat/fsevents>::version=2.3.2&hash=df0bf1"],\
["playwright-core", "npm:1.58.2"]\
["playwright-core", "npm:1.60.0"]\
],\
"linkType": "HARD"\
}]\
]],\
["playwright-core", [\
["npm:1.57.0", {\
"packageLocation": "../../../.yarn/berry/cache/playwright-core-npm-1.57.0-1ccd5476ca-10c0.zip/node_modules/playwright-core/",\
"packageDependencies": [\
["playwright-core", "npm:1.57.0"]\
],\
"linkType": "HARD"\
}],\
["npm:1.58.2", {\
"packageLocation": "../../../.yarn/berry/cache/playwright-core-npm-1.58.2-7d85ddc78a-10c0.zip/node_modules/playwright-core/",\
["npm:1.60.0", {\
"packageLocation": "../../../.yarn/berry/cache/playwright-core-npm-1.60.0-3d53a7d2d6-10c0.zip/node_modules/playwright-core/",\
"packageDependencies": [\
["playwright-core", "npm:1.58.2"]\
["playwright-core", "npm:1.60.0"]\
],\
"linkType": "HARD"\
}]\
......@@ -8854,7 +8838,7 @@ const RAW_RUNTIME_STATE =
"packageLocation": "./",\
"packageDependencies": [\
["pln-www", "workspace:."],\
["@playwright/test", "npm:1.57.0"],\
["@playwright/test", "npm:1.60.0"],\
["@tailwindcss/postcss", "npm:4.2.1"],\
["@testing-library/dom", "npm:10.4.1"],\
["@testing-library/jest-dom", "npm:6.9.1"],\
......@@ -8874,7 +8858,7 @@ const RAW_RUNTIME_STATE =
["next", "virtual:599f9545309f05166d506895056809d0f5971d8f55d13475681739816b4bb6745eb725b53ed2108e22ea4ce46b8a2c491882d38a9948455117b545da3880eea7#npm:15.5.6"],\
["next-router-mock", "virtual:599f9545309f05166d506895056809d0f5971d8f55d13475681739816b4bb6745eb725b53ed2108e22ea4ce46b8a2c491882d38a9948455117b545da3880eea7#npm:1.0.4"],\
["p5", "npm:1.11.3"],\
["playwright", "npm:1.58.2"],\
["playwright", "npm:1.60.0"],\
["postcss", "npm:8.5.8"],\
["prismjs", "npm:1.30.0"],\
["react", "npm:18.3.1"],\
......
No preview for this file type
......@@ -45,7 +45,7 @@
"tailwindcss": "^4.2.1"
},
"devDependencies": {
"@playwright/test": "^1.55.0",
"@playwright/test": "1.60.0",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.8.0",
"@testing-library/react": "^16.3.0",
......@@ -57,7 +57,7 @@
"jest-environment-jsdom": "^30.1.2",
"jest-pnp-resolver": "^1.2.3",
"next-router-mock": "^1.0.2",
"playwright": "^1.58.2",
"playwright": "1.60.0",
"typescript": "^5.3.3",
"vercel": "^39"
},
......
import { test, expect } from '@playwright/test';
/**
* Route-smoke safety net.
*
* Visits every public route and asserts: (1) the document responds < 400,
* (2) the page renders non-empty content, and (3) it throws no *genuine*
* uncaught exception. This is a regression guard for the App Router
* migration — the URLs below are stable across that migration, so this spec
* must stay green before and after.
*
* Tolerated noise (NOT failures): third-party embeds (SoundCloud, YouTube,
* Bandcamp, ReactPlayer) and React dev-mode hydration warnings. These are
* dev-server-only and/or out of our control; failing on them would make the
* net flaky. Known pre-existing issue: /cosmicfest emits a dev-mode hydration
* mismatch (tracked separately) — intentionally tolerated here.
*
* Dynamic routes use known-valid content slugs (see content/**).
*/
const ROUTES: string[] = [
'/',
'/talks',
'/poesie',
'/poesie/berg',
'/post/hello-world',
'/hydra',
'/hydra/adenora',
'/starry-nights',
'/fleurs',
'/cosmicfest',
'/parvagues',
'/parvagues/fiche',
'/parvagues/live', // redirects to /parvagues
'/parvagues/live/montreuil-algorave',
];
// Dev-only / third-party noise we deliberately ignore.
const IGNORABLE_ERRORS = [
/Hydration failed/i,
/Text content does not match/i,
/error while hydrating/i,
/switch to client rendering/i,
/ResizeObserver loop/i,
];
const isGenuineError = (err: Error) =>
!IGNORABLE_ERRORS.some((re) => re.test(err.message));
for (const route of ROUTES) {
test(`route loads: ${route}`, async ({ page }) => {
const pageErrors: Error[] = [];
page.on('pageerror', (err) => pageErrors.push(err));
const response = await page.goto(route, { waitUntil: 'domcontentloaded' });
// Main document must not be a 4xx/5xx (redirects resolve to their target).
expect(response, `no response for ${route}`).not.toBeNull();
expect(response!.status(), `bad status for ${route}`).toBeLessThan(400);
// The page must render something visible (catches blank/crashed renders).
await expect(page.locator('body')).not.toBeEmpty();
// Brief settle for hydration to surface any throw — capped so pages with
// persistent embeds (never reach networkidle) don't hang the test.
await page.waitForLoadState('networkidle', { timeout: 2500 }).catch(() => {});
const genuine = pageErrors.filter(isGenuineError);
expect(
genuine,
`uncaught exception(s) on ${route}:\n${genuine.map((e) => e.message).join('\n')}`,
).toHaveLength(0);
});
}
......@@ -1404,14 +1404,14 @@ __metadata:
languageName: node
linkType: hard
"@playwright/test@npm:^1.55.0":
version: 1.57.0
resolution: "@playwright/test@npm:1.57.0"
"@playwright/test@npm:1.60.0":
version: 1.60.0
resolution: "@playwright/test@npm:1.60.0"
dependencies:
playwright: "npm:1.57.0"
playwright: "npm:1.60.0"
bin:
playwright: cli.js
checksum: 10c0/35ba4b28be72bf0a53e33dbb11c6cff848fb9a37f49e893ce63a90675b5291ec29a1ba82c8a3b043abaead129400f0589623e9ace2e6a1c8eaa409721ecc3774
checksum: 10c0/86b06e6437933e741c7cd43f362024e857e7bc28a55fcbb0553ef55e01a2a403c64f4786868de8af86a6e303fe99e98a18a42ba19489f43ae122e457f9e2d189
languageName: node
linkType: hard
......@@ -7245,51 +7245,27 @@ __metadata:
languageName: node
linkType: hard
"playwright-core@npm:1.57.0":
version: 1.57.0
resolution: "playwright-core@npm:1.57.0"
"playwright-core@npm:1.60.0":
version: 1.60.0
resolution: "playwright-core@npm:1.60.0"
bin:
playwright-core: cli.js
checksum: 10c0/798e35d83bf48419a8c73de20bb94d68be5dde68de23f95d80a0ebe401e3b83e29e3e84aea7894d67fa6c79d2d3d40cc5bcde3e166f657ce50987aaa2421b6a9
checksum: 10c0/99ccd43923b6e9355e0723b7fe221e6326efd4687f8dafff951313662aea11db51f542a9c2122c704c445fb9baae1c9ec9fa6f895126bbddd9fe92313f6942c9
languageName: node
linkType: hard
"playwright-core@npm:1.58.2":
version: 1.58.2
resolution: "playwright-core@npm:1.58.2"
bin:
playwright-core: cli.js
checksum: 10c0/5aa15b2b764e6ffe738293a09081a6f7023847a0dbf4cd05fe10eed2e25450d321baf7482f938f2d2eb330291e197fa23e57b29a5b552b89927ceb791266225b
languageName: node
linkType: hard
"playwright@npm:1.57.0":
version: 1.57.0
resolution: "playwright@npm:1.57.0"
dependencies:
fsevents: "npm:2.3.2"
playwright-core: "npm:1.57.0"
dependenciesMeta:
fsevents:
optional: true
bin:
playwright: cli.js
checksum: 10c0/ab03c99a67b835bdea9059f516ad3b6e42c21025f9adaa161a4ef6bc7ca716dcba476d287140bb240d06126eb23f889a8933b8f5f1f1a56b80659d92d1358899
languageName: node
linkType: hard
"playwright@npm:^1.58.2":
version: 1.58.2
resolution: "playwright@npm:1.58.2"
"playwright@npm:1.60.0":
version: 1.60.0
resolution: "playwright@npm:1.60.0"
dependencies:
fsevents: "npm:2.3.2"
playwright-core: "npm:1.58.2"
playwright-core: "npm:1.60.0"
dependenciesMeta:
fsevents:
optional: true
bin:
playwright: cli.js
checksum: 10c0/d060d9b7cc124bd8b5dffebaab5e84f6b34654a553758fe7b19cc598dfbee93f6ecfbdc1832b40a6380ae04eade86ef3285ba03aa0b136799e83402246dc0727
checksum: 10c0/714ad76d85b4865d7e43c0012f9039800c1485373388973ed39d79339cee5ad467052d1e2f1eaeca107a1cb6e65342186a8578a4c3504853d84c3a691250d5db
languageName: node
linkType: hard
......@@ -7297,7 +7273,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "pln-www@workspace:."
dependencies:
"@playwright/test": "npm:^1.55.0"
"@playwright/test": "npm:1.60.0"
"@tailwindcss/postcss": "npm:^4.2.1"
"@testing-library/dom": "npm:^10.4.1"
"@testing-library/jest-dom": "npm:^6.8.0"
......@@ -7317,7 +7293,7 @@ __metadata:
next: "npm:^15.3.0"
next-router-mock: "npm:^1.0.2"
p5: "npm:1.11.3"
playwright: "npm:^1.58.2"
playwright: "npm:1.60.0"
postcss: "npm:^8.5.8"
prismjs: "npm:^1.30.0"
react: "npm:^18.2.0"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment