- home con hero, servizi, studio e professionisti, abilitazioni, partner, banda CTA e sedi con mappa click-to-load - lo studio, servizi (hub con ancore del vecchio sito e redirect), dettaglio servizio con barra laterale e precedente/successivo - contatti (recapiti, modulo o card e-mail, mappa), dove siamo, link utili - pagina 404 e pagina di conferma del modulo (noindex, fuori sitemap) - script per screenshot di tutte le pagine; preview Astro in primo piano Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016zJ9ZWGKvoKoxYwbmnRKdJ
46 lines
1.3 KiB
TypeScript
46 lines
1.3 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: {
|
|
// --ignore-lock: resta in primo piano anche quando Astro rileva un agente AI.
|
|
command: `npx astro preview --host ${HOST} --port ${PORT} --ignore-lock`,
|
|
url: `http://${HOST}:${PORT}/`,
|
|
reuseExistingServer: !process.env.CI,
|
|
timeout: 60_000,
|
|
stdout: 'ignore',
|
|
stderr: 'pipe',
|
|
},
|
|
});
|