Repository Public
1/**2 * =============================================================================3 * SP BOUCHER | SOFTWARE & RESEARCH4 * ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5 * =============================================================================6 *7 * Project : KA Maps Engine8 * File : sdk/web/playwright.config.ts9 * Module : sdk10 * Repository : https://git.spboucher.ai/ka-maps-engine11 * Created : 2026-12-0112 * Last Modified : 2026-12-0113 *14 * Author : Simon-Pierre Boucher15 * Position : Professor of Finance16 * Institution : Université du Québec en Outaouais (UQO)17 * Organization : SP Boucher18 * Website : https://spboucher.ai19 * Git : https://git.spboucher.ai20 *21 * Preferred Contact: support@spboucher.ai22 * Development : dev@spboucher.ai23 * Support : support@spboucher.ai24 * Security/Admin : admin@spboucher.ai25 *26 * Copyright (c) 202627 * Simon-Pierre Boucher28 * All rights reserved where applicable. This file is governed by the29 * applicable project license, copyright notices and relevant law.30 * Existing third-party rights and notices remain unaffected.31 *32 * License : None specified (no license file in this repository)33 *34 * Do not embed credentials, private keys, access tokens,35 * certificates or confidential personal information.36 *37 * =============================================================================38 * END OF SP BOUCHER SOURCE HEADER39 * =============================================================================40 */4142// Essais de bout en bout, sans fenêtre, contre les vraies tuiles (tiles.spboucher.ai).43// Quatre projets : Chromium WebGPU, Chromium WebGL 2 forcé, Firefox, WebKit.44// La démonstration est construite puis servie sous CSP stricte par tests/e2e/server.mjs.45import { defineConfig } from '@playwright/test';4647// Chromium sans fenêtre avec GPU réel (Metal) : WebGPU exige le « nouveau » mode headless (canal chromium).48const CHROMIUM_ARGS = ['--enable-unsafe-webgpu', '--enable-gpu', '--use-angle=metal', '--ignore-gpu-blocklist', '--enable-features=WebGPU', '--enable-precise-memory-info', '--js-flags=--expose-gc'];4950const UNCAPPED = ['--disable-frame-rate-limit', '--disable-gpu-vsync'];5152const SOAK = !!process.env.KA_SOAK;5354export default defineConfig({55 testDir: 'tests/e2e',56 outputDir: 'test-results',57 snapshotPathTemplate: '{testDir}/__screenshots__/{projectName}/{arg}{ext}',58 fullyParallel: false,59 workers: 1,60 retries: process.env.CI ? 1 : 0,61 timeout: SOAK ? 600_000 : 90_000,62 expect: {63 timeout: 20_000,64 // Tolérance des images de référence : anticrénelage et pilotes diffèrent légèrement d'une exécution à l'autre.65 toHaveScreenshot: { maxDiffPixelRatio: 0.04, threshold: 0.25, animations: 'disabled' },66 },67 reporter: [['list'], ['json', { outputFile: 'test-results/report.json' }]],68 grep: SOAK ? /@soak/ : undefined,69 grepInvert: SOAK ? undefined : /@soak/,70 use: {71 baseURL: 'http://127.0.0.1:5311/',72 headless: true,73 viewport: { width: 1280, height: 800 },74 deviceScaleFactor: 1,75 locale: 'fr-CA',76 trace: 'retain-on-failure',77 },78 webServer: {79 command: 'npx vite build --config demo/vite.config.ts --logLevel warn && node tests/e2e/server.mjs',80 url: 'http://127.0.0.1:5311/',81 reuseExistingServer: !process.env.CI,82 timeout: 120_000,83 },84 projects: [85 { name: 'chromium-webgpu', use: { browserName: 'chromium', channel: 'chromium', launchOptions: { args: CHROMIUM_ARGS } }, metadata: { backend: 'webgpu' } },86 { name: 'chromium-webgl2', use: { browserName: 'chromium', channel: 'chromium', launchOptions: { args: CHROMIUM_ARGS } }, metadata: { backend: 'webgl2', force: 'webgl2' } },87 { name: 'firefox', use: { browserName: 'firefox', launchOptions: { firefoxUserPrefs: { 'webgl.force-enabled': true } } }, metadata: { backend: 'webgl2' } },88 { name: 'webkit', use: { browserName: 'webkit' }, metadata: { backend: 'any' } },89 // Mesures seulement : synchronisation verticale coupée, pour connaître le débit réel au-delà de 60 trames/s.90 { name: 'chromium-webgpu-libre', testMatch: /perf\.spec\.ts/, use: { browserName: 'chromium', channel: 'chromium', launchOptions: { args: [...CHROMIUM_ARGS, ...UNCAPPED] } }, metadata: { backend: 'webgpu' } },91 { name: 'chromium-webgl2-libre', testMatch: /perf\.spec\.ts/, use: { browserName: 'chromium', channel: 'chromium', launchOptions: { args: [...CHROMIUM_ARGS, ...UNCAPPED] } }, metadata: { backend: 'webgl2', force: 'webgl2' } },92 // Idem à la taille d'un écran Retina de MacBook Pro 16 pouces (1728 × 1117 points, densité 2).93 { name: 'chromium-webgpu-libre-retina', testMatch: /perf\.spec\.ts/, use: { browserName: 'chromium', channel: 'chromium', viewport: { width: 1728, height: 1117 }, deviceScaleFactor: 2, launchOptions: { args: [...CHROMIUM_ARGS, ...UNCAPPED] } }, metadata: { backend: 'webgpu' } },94 { name: 'chromium-webgl2-libre-retina', testMatch: /perf\.spec\.ts/, use: { browserName: 'chromium', channel: 'chromium', viewport: { width: 1728, height: 1117 }, deviceScaleFactor: 2, launchOptions: { args: [...CHROMIUM_ARGS, ...UNCAPPED] } }, metadata: { backend: 'webgl2', force: 'webgl2' } },95 ],96});97