Files
Studio_Grasso/playwright.config.ts
T
Claude b740fee017 chore: bootstrap del progetto Astro con strumenti di qualità
- Astro 7.4.0 in output statico, TypeScript strict, sitemap
- ESLint (flat config, Astro + TS), Prettier, EditorConfig, .nvmrc
- configurazioni di Playwright, Lighthouse CI e html-validate
- script npm di §3.3 (segnaposto per gli script non ancora implementati)
- README, DECISIONS, TODO-STUDIO e CHANGELOG iniziali
- mockup e brief in docs/

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016zJ9ZWGKvoKoxYwbmnRKdJ
2026-10-15 21:50:35 +00:00

45 lines
1.2 KiB
TypeScript

import { defineConfig, devices } from '@playwright/test';
/**
* Test end-to-end e di accessibilità sul sito compilato (`dist/`), servito da `astro preview`.
* Esegui prima `npm run build`: l'elenco delle pagine viene letto dalla sitemap generata.
*/
const PORT = Number(process.env.PREVIEW_PORT ?? 4321);
const HOST = '127.0.0.1';
export default defineConfig({
testDir: 'tests',
fullyParallel: true,
forbidOnly: Boolean(process.env.CI),
retries: 0,
workers: process.env.CI ? 2 : undefined,
timeout: 30_000,
reporter: [['list'], ['html', { outputFolder: 'playwright-report', open: 'never' }]],
use: {
baseURL: `http://${HOST}:${PORT}`,
locale: 'it-IT',
trace: 'retain-on-failure',
screenshot: 'only-on-failure',
},
projects: [
{
name: 'e2e',
testDir: 'tests/e2e',
use: { ...devices['Desktop Chrome'], viewport: { width: 1440, height: 900 } },
},
{
name: 'a11y',
testDir: 'tests/a11y',
use: { ...devices['Desktop Chrome'] },
},
],
webServer: {
command: `npx astro preview --host ${HOST} --port ${PORT}`,
url: `http://${HOST}:${PORT}/`,
reuseExistingServer: !process.env.CI,
timeout: 60_000,
stdout: 'ignore',
stderr: 'pipe',
},
});