fix: only use local system Chromium in Playwright config outside CI

The blocking carpenter smoke test (introduced in this branch) exposed
a pre-existing gap: playwright.config.js hardcoded
executablePath: '/snap/bin/chromium' plus channel: 'chromium' for the
maintainer's local CachyOS machine. CI has no /snap/bin/chromium (it
installs its own Chromium via `playwright install --with-deps
chromium`), so every CI run was silently failing to launch the browser
- previously masked because the whole E2E step had
continue-on-error: true.

Gate both overrides behind `!process.env.CI` so local runs keep using
system Chromium and CI falls back to its own installed browser.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
alexpolo1
2026-08-20 13:37:23 +02:00
parent 9b7df90385
commit 081e46cb44

View File

@@ -29,8 +29,9 @@ module.exports = defineConfig({
/* Run in headless mode */
headless: true,
/* Use system Chrome/Chromium for CachyOS compatibility */
channel: 'chromium',
/* Use system Chrome/Chromium for CachyOS compatibility (local runs only -
CI uses its own Playwright-installed Chromium, see the chromium project below) */
...(process.env.CI ? {} : { channel: 'chromium' }),
/* Extra headers to send with requests */
extraHTTPHeaders: {
@@ -61,10 +62,14 @@ module.exports = defineConfig({
name: 'chromium',
use: {
...devices['Desktop Chrome'],
// Use system Chromium on CachyOS
launchOptions: {
executablePath: '/snap/bin/chromium'
}
// Use system Chromium on CachyOS for local runs. CI installs its own
// Chromium via `playwright install` and has no /snap/bin/chromium, so
// this override must not apply there.
...(process.env.CI ? {} : {
launchOptions: {
executablePath: '/snap/bin/chromium'
}
})
},
}
],