test: exercise document visibility WebGL screenshots in rendered CI

This commit is contained in:
Neil
2026-09-06 00:27:37 -07:00
parent 04842b0cff
commit 4b2c4592f9
2 changed files with 12 additions and 1 deletions
+2 -1
View File
@@ -245,8 +245,9 @@ jobs:
if grep -l '@headful' "${TEST_FILES[@]}" >/dev/null; then
E2E_PROJECT_ARGS+=(--project=electron-headful)
fi
node tests/e2e/diagnose-execution-context.mjs
xvfb-run --auto-servernum bash .github/scripts/e2e-with-window-manager.sh env "${E2E_ENV[@]}" \
pnpm run test:e2e "${TEST_FILES[@]}" --workers=1 "${E2E_PROJECT_ARGS[@]}"
pnpm run test:e2e "${TEST_FILES[@]}" --workers=1 "${E2E_PROJECT_ARGS[@]}" --repeat-each=5
- name: Upload Playwright traces
if: failure()
+10
View File
@@ -0,0 +1,10 @@
import fs from 'node:fs'
import path from 'node:path'
import { createRequire } from 'node:module'
const require = createRequire(import.meta.url)
const file = path.join(path.dirname(require.resolve('playwright-core/package.json')), 'lib/server/chromium/crExecutionContext.js')
let source = fs.readFileSync(file, 'utf8')
const needle = 'function rewriteError(error) {'
if (!source.includes(needle)) throw new Error('Playwright diagnostic hook missing')
source = source.replace(needle, needle + '\n console.error("[raw-context-error]", error.message, error.stack);')
fs.writeFileSync(file, source)