Files
softharbor/playwright.config.ts
T
poli0981andClaude Opus 5.5 981e625ca1
CI / build (push) Successful in 3m19s
CI / gates (push) Successful in 1m5s
CI / record (push) Skipped
Reusable / Qodana / Qodana (push) Successful in 3m7s
Qodana / qodana (push) Successful in 3m7s
Reusable / Security / Secrets (gitleaks) (push) Successful in 10s
Reusable / Security / Rust (cargo-deny) (push) Skipped
Reusable / Security / .NET (NuGetAudit) (push) Skipped
Reusable / Security / SAST (Opengrep) (push) Successful in 24s
Reusable / Security / Dependencies (osv-scanner) (push) Successful in 17s
Security / security (push) Successful in 52s
CI / deploy (push) Successful in 1m9s
chore: move the repository to Gitea (D38) (#1)
- ci: move the workflows to Gitea Actions (D38)
- feat(site): source on Gitea, issues and bug reports on the GitLab mirror
- docs: where the project lives now — Gitea, the GitLab mirror, e-mail
- docs: the suite on Gitea — D38, CI/CD rewritten, every GitHub-era claim synced
- fix(ci): what the first Gitea runs found — Qodana and gitleaks
- fix(ci): .gitleaksignore describes the Sonar key instead of quoting it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 05:29:57 +00:00

70 lines
2.9 KiB
TypeScript

// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 (SkullMute)
//
// docs/11 — end-to-end smoke suite against the BUILT site (`astro preview`
// serves dist/ exactly as built, including the per-page meta CSP).
//
// What it exists to catch is the class of bug this project kept shipping with
// every unit test green: a script or style the CSP silently refused, a dialog
// the platform could dismiss, an island that threw on hydration. The shared
// fixture (e2e/fixtures.ts) fails any test whose page logged a console error
// or a CSP violation.
//
// `astro preview` applies neither _headers nor the Worker, so a second server
// does: `wrangler dev` on the same dist/ with the real wrangler.jsonc, for the
// `worker` project alone (e2e/worker.spec.ts — routing, the rate limits, the
// 429 page). Cloudflare's own edge is verified on production after each
// deploy (ci.yml `deploy`, docs/13 §3) — there are no preview versions since
// the move to Gitea (D38).
import { defineConfig, devices } from '@playwright/test';
const PORT = 4321;
// Not wrangler's default 8787/8788: another project's `wrangler dev` may hold
// those, and reuseExistingServer would then test the wrong site.
const WORKER_PORT = 8799;
const WORKER_SPEC = /worker\.spec\.ts$/;
export default defineConfig({
testDir: 'e2e',
fullyParallel: true,
forbidOnly: Boolean(process.env['CI']),
retries: process.env['CI'] ? 1 : 0,
// `list` in CI too: Gitea shows no annotations, so the github reporter's
// terse `::error` lines would only hide the readable output.
reporter: process.env['CI'] ? [['list'], ['html', { open: 'never' }]] : 'list',
use: {
baseURL: `http://127.0.0.1:${PORT}`,
trace: 'retain-on-failure',
},
projects: [
{ name: 'desktop', use: { ...devices['Desktop Chrome'] }, testIgnore: WORKER_SPEC },
// Bottom sheets, the wrapped header and touch targets live here.
{ name: 'mobile', use: { ...devices['Pixel 7'] }, testIgnore: WORKER_SPEC },
{
name: 'worker',
testMatch: WORKER_SPEC,
use: { ...devices['Desktop Chrome'], baseURL: `http://127.0.0.1:${WORKER_PORT}` },
},
],
webServer: [
{
command: `pnpm exec astro preview --port ${PORT} --host 127.0.0.1`,
url: `http://127.0.0.1:${PORT}`,
reuseExistingServer: !process.env['CI'],
timeout: 60_000,
// Astro ≥ 7.2 backgrounds `astro preview` when it detects an AI agent or
// CI; Playwright needs it in the foreground to own its lifetime.
env: { ASTRO_PREVIEW_BACKGROUND: '0' },
},
{
command: `pnpm exec wrangler dev --port ${WORKER_PORT} --ip 127.0.0.1 --show-interactive-dev-session=false`,
// An asset-first path (a negative pattern), so the readiness probes
// spend nothing from the rate limit the tests measure.
url: `http://127.0.0.1:${WORKER_PORT}/favicon.svg`,
reuseExistingServer: !process.env['CI'],
timeout: 90_000,
env: { WRANGLER_SEND_METRICS: 'false' },
},
],
});