forked from baron/baron-sso
fix(userfront-e2e): fix widespread test failures in non-Chromium browsers
- Add COOP/COEP headers to serve script for Flutter WASM compatibility (SharedArrayBuffer) - Update CI workflow to install all Playwright browsers for userfront-e2e - Fix command reporting consistency in adminfront test script
This commit is contained in:
@@ -423,7 +423,7 @@ jobs:
|
||||
run: |
|
||||
set +e
|
||||
cd userfront-e2e
|
||||
npx playwright install --with-deps chromium 2>&1 | tee ../reports/userfront-e2e-provision.log
|
||||
npx playwright install --with-deps 2>&1 | tee ../reports/userfront-e2e-provision.log
|
||||
provision_exit_code=${PIPESTATUS[0]}
|
||||
cd ..
|
||||
set -e
|
||||
@@ -438,7 +438,7 @@ jobs:
|
||||
echo "- Exit Code: \`$provision_exit_code\`"
|
||||
echo
|
||||
echo "## Command"
|
||||
echo "\`cd userfront-e2e && npx playwright install --with-deps chromium\`"
|
||||
echo "\`cd userfront-e2e && npx playwright install --with-deps\`"
|
||||
echo
|
||||
echo "## Provision Log Tail (last 200 lines)"
|
||||
echo '```text'
|
||||
@@ -470,7 +470,7 @@ jobs:
|
||||
echo "1. \`cd userfront-e2e\`"
|
||||
echo "2. \`npm ci\`"
|
||||
echo "3. \`cd ../userfront && flutter build web --wasm --release\`"
|
||||
echo "4. \`cd ../userfront-e2e && npx playwright install --with-deps chromium\`"
|
||||
echo "4. \`cd ../userfront-e2e && npx playwright install --with-deps\`"
|
||||
echo "5. \`npm test\`"
|
||||
echo
|
||||
echo "## Log Tail (last 200 lines)"
|
||||
|
||||
@@ -217,7 +217,7 @@ if [ "$install_exit_code" -ne 0 ]; then
|
||||
echo "- Exit Code: \`$install_exit_code\`"
|
||||
echo
|
||||
echo "## Command"
|
||||
echo "\`cd adminfront && if [ \"$reuse_seed_node_modules\" -eq 0 ]; then if ! command -v pnpm >/dev/null 2>&1; then npm install -g pnpm; fi && pnpm install -C ../common --no-frozen-lockfile --store-dir \"\$TMPDIR/pnpm-store\"; fi\`"
|
||||
echo "\`cd adminfront && if [ \"$reuse_seed_node_modules\" -eq 0 ]; then if ! command -v pnpm >/dev/null 2>&1; then npm install -g pnpm; fi && pnpm install --no-frozen-lockfile --store-dir \"\$TMPDIR/pnpm-store\"; fi\`"
|
||||
echo
|
||||
echo "## Install Log Tail (last 200 lines)"
|
||||
echo '```text'
|
||||
@@ -284,7 +284,7 @@ if [ "$test_exit_code" -ne 0 ]; then
|
||||
echo
|
||||
echo "## Commands"
|
||||
echo "1. \`cd adminfront\`"
|
||||
echo "2. \`if [ \"$reuse_seed_node_modules\" -eq 0 ]; then if ! command -v pnpm >/dev/null 2>&1; then npm install -g pnpm; fi && pnpm install -C ../common --no-frozen-lockfile --store-dir \"\$TMPDIR/pnpm-store\"; fi\`"
|
||||
echo "2. \`if [ \"$reuse_seed_node_modules\" -eq 0 ]; then if ! command -v pnpm >/dev/null 2>&1; then npm install -g pnpm; fi && pnpm install --no-frozen-lockfile --store-dir \"\$TMPDIR/pnpm-store\"; fi\`"
|
||||
echo "3. \`${playwright_install_desc}\`"
|
||||
echo "4. \`npx playwright test\`"
|
||||
echo
|
||||
|
||||
@@ -81,6 +81,12 @@ const server = createServer((req, res) => {
|
||||
res.setHeader('Last-Modified', stats.mtime.toUTCString());
|
||||
res.setHeader('Cache-Control', cacheControl);
|
||||
res.setHeader('Vary', 'Accept-Encoding');
|
||||
|
||||
// Flutter WASM requires SharedArrayBuffer which needs these COOP/COEP headers
|
||||
// to be cross-origin isolated in most modern browsers (WebKit, Firefox, etc.)
|
||||
res.setHeader('Cross-Origin-Opener-Policy', 'same-origin');
|
||||
res.setHeader('Cross-Origin-Embedder-Policy', 'require-corp');
|
||||
|
||||
if (servedPath === brotliPath) {
|
||||
res.setHeader('Content-Encoding', 'br');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user