From d64edcf48f105c9f88ac0b6cbd60e0416141109a Mon Sep 17 00:00:00 2001 From: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com> Date: Mon, 1 Jun 2026 19:46:41 +0100 Subject: [PATCH] fix(e2e): set webServer.cwd to repo root in Playwright config (refs #118) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When Playwright is invoked with `working-directory: tools/compat-testing` (per .github/workflows/e2e-playwright.yml), the webServer command spawns `deno task dev:vite` from that same directory. Vite uses process.cwd() as its project root by default — without an explicit cwd setting, it serves files from tools/compat-testing/ instead of the repo root. The smoking gun in the failed run logs: Failed to load http://localhost:1984/assets/main/ui.webp.json TypeError: Failed to fetch at chunk-QIAJ6TT7.js (vite-bundled PixiJS Loader) at async Module.showScreen (Navigation.res.mjs:94) at async startApp (Main.res.mjs:101) The asset files exist at the correct paths in public/assets/main/ — they just can't be served because vite's static-serve root is wrong. This commit adds `cwd: '../..'` to webServer config so vite resolves public/, src/, index.html, and vite.config.js from the actual repo root. Also adds stdout/stderr: 'pipe' so vite startup logs are visible in Playwright's output for future debugging. The Firefox-specific "CanvasRenderer is not yet implemented" error (PixiJS v8 has no Canvas2D fallback) is a separate WebGL-availability issue tracked alongside this in #118. Refs #118. Co-Authored-By: Claude Opus 4.7 (1M context) Signed-off-by: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com> --- tools/compat-testing/playwright.config.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/compat-testing/playwright.config.js b/tools/compat-testing/playwright.config.js index a1106472..03d47783 100644 --- a/tools/compat-testing/playwright.config.js +++ b/tools/compat-testing/playwright.config.js @@ -74,8 +74,20 @@ export default defineConfig({ webServer: { command: 'deno task dev:vite', + // Playwright is invoked with cwd = tools/compat-testing/ (via `working-directory` + // in .github/workflows/e2e-playwright.yml). Without `cwd: '../..'`, vite starts + // with process.cwd() = tools/compat-testing/, which has no index.html and no + // public/ — Vite walks up to find vite.config.js but still treats the spawn + // directory as project root, so /assets/main/ui.webp.json 404s and + // PixiJS Loader fails during preload bundle init. + // + // Setting cwd to the repo root (two levels up from tools/compat-testing/) + // makes vite serve public/, raw-assets/, src/, index.html correctly. + cwd: '../..', port: 1984, reuseExistingServer: true, timeout: 60000, + stdout: 'pipe', + stderr: 'pipe', }, });