Files
portfolio-next/playwright.config.ts
Lucas WintherandClaude Sonnet 5.5 994f41558c test(e2e): cover sparse content
Second webServer builds fixtures/sparse (no sources) on 4379; third-party allow-list
now derives from the configured servers; the embed test re-checks blocked requests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 09:43:34 +01:00

34 lines
1.4 KiB
TypeScript

import { defineConfig, devices } from '@playwright/test';
// Builds the synthetic fixture content and serves it with the app's own static server.
export default defineConfig({
testDir: 'e2e',
fullyParallel: true,
reporter: [['list']],
use: { baseURL: 'http://localhost:4378' },
projects: [
{ name: 'desktop', use: { ...devices['Desktop Chrome'] } },
{ name: 'phone', use: { ...devices['Pixel 7'] } },
],
webServer: [
{
command: 'bun src/cli.ts build fixtures/content .tmp/e2e-site && bun src/cli.ts preview .tmp/e2e-site 4378',
url: 'http://localhost:4378/',
timeout: 180_000,
reuseExistingServer: false,
// Fixture Trakt/Hardcover/Ghost data, so the Now strips and live cards render.
env: { SOURCES_FIXTURES: 'fixtures/sources' },
},
{
// Almost no content (one project, no items) and no external sources: sections must hide cleanly.
command:
'rm -rf .tmp/e2e-sparse-cache && bun src/cli.ts build fixtures/sparse .tmp/e2e-sparse .tmp/e2e-sparse-cache && bun src/cli.ts preview .tmp/e2e-sparse 4379',
url: 'http://localhost:4379/',
timeout: 180_000,
reuseExistingServer: false,
// Blank credentials: every source is "not configured" and nothing is fetched.
env: { SOURCES_FIXTURES: '', GHOST_URL: '', GHOST_CONTENT_KEY: '', TRAKT_CLIENT_ID: '', HARDCOVER_TOKEN: '' },
},
],
});